adium: 52d04452: libpurple_jabber_avoid_sasl_option_hack....

evands at pidgin.im evands at pidgin.im
Wed Jan 14 08:37:32 EST 2009


-----------------------------------------------------------------
Revision: 52d0445289e648c528c58c4efa47be163c3a7e1b
Ancestor: 212a16caf2b938700c44727a91cd89f80549bbee
Author: evands at pidgin.im
Date: 2009-01-14T13:28:12
Branch: im.pidgin.adium
URL: http://d.pidgin.im/viewmtn/revision/info/52d0445289e648c528c58c4efa47be163c3a7e1b

Modified files:
        libpurple/protocols/jabber/auth.c
        libpurple/protocols/jabber/libxmpp.c

ChangeLog: 

libpurple_jabber_avoid_sasl_option_hack.diff:
Avoid PLAIN via SASL auth in XMPP. This is only needed for 10.4 compatibility
and can be reverted when Adium is 10.5+. See Adium's [21712] for details; mods
were made in [21714] and [22025].

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth.c	f2ff11e621fda2d79838697334eb2f0c82e114a8
+++ libpurple/protocols/jabber/auth.c	14d486302f345459948de253f4d1432308bbf85a
@@ -394,6 +394,32 @@ static void jabber_auth_start_cyrus(Jabb
 	} while (again);
 
 	if (js->sasl_state == SASL_CONTINUE || js->sasl_state == SASL_OK) {
+	
+		/* Adium: Avoid SASL PLAIN for 10.4 compatibility, as it's broken there */
+		if (js->current_mech && (strcmp(js->current_mech, "PLAIN") == 0) && purple_prefs_get_bool("/plugins/prpl/jabber/avoid_sasl_for_plain_auth")) {
+			js->auth_type = JABBER_AUTH_PLAIN;
+			js->sasl_state = SASL_OK;
+			sasl_dispose(&js->sasl);
+			js->sasl = NULL;
+
+			if(js->gsc == NULL && !purple_account_get_bool(js->gc->account, "auth_plain_in_clear", FALSE)) {
+				char *msg = g_strdup_printf(_("%s requires plaintext authentication over an unencrypted connection.  Allow this and continue authentication?"),
+											js->gc->account->username);
+				purple_request_yes_no(js->gc, _("Plaintext Authentication"),
+									  _("Plaintext Authentication"),
+									  msg,
+									  2,
+									  purple_connection_get_account(js->gc), NULL, NULL,
+									  purple_connection_get_account(js->gc), allow_plaintext_auth,
+									  disallow_plaintext_auth);
+				g_free(msg);
+				return;
+			}
+			finish_plaintext_authentication(js);
+
+			return;
+		}
+
 		auth = xmlnode_new("auth");
 		xmlnode_set_namespace(auth, "urn:ietf:params:xml:ns:xmpp-sasl");
 		xmlnode_set_attrib(auth, "mechanism", js->current_mech);
============================================================
--- libpurple/protocols/jabber/libxmpp.c	57be32934eb9f7a99243045cadba2059bcc3a4f4
+++ libpurple/protocols/jabber/libxmpp.c	1ec26a3195a4660a17b0a16e15ceb3f33c5c8328
@@ -270,6 +270,10 @@ init_plugin(PurplePlugin *plugin)
 	/* Restore the original error mode */
 	SetErrorMode(old_error_mode);
 #endif
+
+    /* Adium hack for Mac OS X 10.4 support */
+ 	purple_prefs_add_none("/plugins/prpl/jabber");
+ 	purple_prefs_add_bool("/plugins/prpl/jabber/avoid_sasl_for_plain_auth", FALSE);
 #endif
 	jabber_register_commands();
 	


More information about the Commits mailing list