Fri, 25 May 2018 01:44:37 +0000
Merged in rw_grim/pidgin/auth-webex (pull request #313)
Auth webex
Approved-by: Eion Robb <eionrobb@gmail.com>
Approved-by: Nikhil K <nikhilkalige@gmail.com>
| finch/meson.build | file | annotate | diff | comparison | revisions | |
| pidgin/meson.build | file | annotate | diff | comparison | revisions |
--- a/libpurple/protocols/jabber/auth.c Thu May 24 22:12:43 2018 +0000 +++ b/libpurple/protocols/jabber/auth.c Fri May 25 01:44:37 2018 +0000 @@ -521,6 +521,9 @@ #ifdef HAVE_CYRUS_SASL jabber_auth_add_mech(jabber_auth_get_cyrus_mech()); #endif +#ifdef HAVE_WEBEX_TOKEN + jabber_auth_add_mech(jabber_auth_get_webex_token_mech()); +#endif tmp = jabber_auth_get_scram_mechs(&count); for (i = 0; i < count; ++i)
--- a/libpurple/protocols/jabber/auth.h Thu May 24 22:12:43 2018 +0000 +++ b/libpurple/protocols/jabber/auth.h Fri May 25 01:44:37 2018 +0000 @@ -57,6 +57,7 @@ #ifdef HAVE_CYRUS_SASL JabberSaslMech *jabber_auth_get_cyrus_mech(void); #endif +JabberSaslMech *jabber_auth_get_webex_token_mech(void); void jabber_auth_add_mech(JabberSaslMech *); void jabber_auth_remove_mech(JabberSaslMech *);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libpurple/protocols/jabber/auth_webex.c Fri May 25 01:44:37 2018 +0000 @@ -0,0 +1,70 @@ +/* + * purple - Jabber Protocol Plugin + * + * Purple is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA + * + */ +#include "internal.h" + +#include "account.h" +#include "debug.h" +#include "request.h" +#include "util.h" +#include "xmlnode.h" + +#include "jabber.h" +#include "auth.h" + +static PurpleXmlNode *finish_webex_authentication(JabberStream *js) +{ + PurpleXmlNode *auth; + + auth = purple_xmlnode_new("auth"); + purple_xmlnode_set_namespace(auth, NS_XMPP_SASL); + + purple_xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth"); + purple_xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true"); + + purple_xmlnode_set_attrib(auth, "mechanism", "WEBEX-TOKEN"); + purple_xmlnode_insert_data(auth, purple_connection_get_password(js->gc), -1); + + return auth; +} + +static JabberSaslState +jabber_webex_start(JabberStream *js, PurpleXmlNode *packet, PurpleXmlNode **response, char **error) +{ + *response = finish_webex_authentication(js); + return JABBER_SASL_STATE_OK; +} + +static JabberSaslMech webex_token_mech = { + 101, /* priority */ + "WEBEX-TOKEN", /* name */ + jabber_webex_start, + NULL, /* handle_challenge */ + NULL, /* handle_success */ + NULL, /* handle_failure */ + NULL /* dispose */ +}; + +JabberSaslMech *jabber_auth_get_webex_token_mech(void) +{ + return &webex_token_mech; +}
--- a/libpurple/protocols/jabber/meson.build Thu May 24 22:12:43 2018 +0000 +++ b/libpurple/protocols/jabber/meson.build Fri May 25 01:44:37 2018 +0000 @@ -8,6 +8,7 @@ 'auth_plain.c', 'auth_scram.c', 'auth_scram.h', + 'auth_webex.c', 'buddy.c', 'buddy.h', 'bosh.c',