adium: cc264ee1: Restored libpurple_jabber_use_builtin_di...

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


-----------------------------------------------------------------
Revision: cc264ee13ce87b2c15067b6d4fb66d7eb1861b4a
Ancestor: 8e1d9c0aaa4508bb252a61a612290cc8e17a8586
Author: evands at pidgin.im
Date: 2009-01-14T13:31:27
Branch: im.pidgin.adium
URL: http://d.pidgin.im/viewmtn/revision/info/cc264ee13ce87b2c15067b6d4fb66d7eb1861b4a

Modified files:
        libpurple/Makefile.am libpurple/protocols/jabber/auth.c

ChangeLog: 

Restored libpurple_jabber_use_builtin_digestmd5 patch, which was used in adium 1.2.x and removed in 1.3svn. It's still needed to be able to connect to certain old servers, as cyrus-sasl's digest-md5 doesn't agree with them, and I'd rather us just work than try to convince network admins to upgrade their jabber servers given that that the workaround does quite well. Fixes #10265

-------------- next part --------------
============================================================
--- libpurple/Makefile.am	ea431ecfb45e9b1e546b7f8dd0d012a98bb1aaf7
+++ libpurple/Makefile.am	903fd27832b0922a3a8a084517ec65536ce34b36
@@ -243,6 +243,7 @@ libpurple_la_LIBADD = \
 libpurple_la_LDFLAGS = -export-dynamic -version-info $(PURPLE_LT_VERSION_INFO) -no-undefined
 libpurple_la_LIBADD = \
 	$(STATIC_LINK_LIBS) \
+	$(KRB4_LDFLAGS) $(KRB4_LIBS) \
 	$(DBUS_LIBS) \
 	$(GLIB_LIBS) \
 	$(LIBXML_LIBS) \
============================================================
--- libpurple/protocols/jabber/auth.c	14d486302f345459948de253f4d1432308bbf85a
+++ libpurple/protocols/jabber/auth.c	49746dd872f97a62e56187725b1537ba5b14104a
@@ -436,6 +436,24 @@ static void jabber_auth_start_cyrus(Jabb
 				g_free(enc_out);
 			}
 		}
+		
+		if (js->current_mech && (strcmp(js->current_mech, "DIGEST-MD5") == 0)) {
+			/* CYRUS-SASL's DIGEST-MD5 and Java's DIGEST-MD5 are mutually incompatible because of different interpretations of RFC2831.
+			 * This means that if we are using SASL and connecting to a Java-based server such as OpenFire, we will receive an authentication
+			 * failure if that server offers DIGEST-MD5 in such a way that SASL chooses it as the best mechanism for us.
+			 *
+			 * However, we implement our own DIGEST-MD5 for use when we're compiled without SASL support, and that implementation
+			 * works correctly. Therefore, if SASL chooses DIGEST-MD5, we switch over to our own implementation.
+			 * jabber_auth_handle_challenge() will note the auth_type and take it from there.
+			 *
+			 * SASL would change state to SASL_OK after when handling the challenge; we do so immediately to avoid an error later.
+			 */
+			js->auth_type = JABBER_AUTH_DIGEST_MD5;
+			js->sasl_state = SASL_OK;
+			sasl_dispose(&js->sasl);
+			js->sasl = NULL;
+		}
+
 		jabber_send(js, auth);
 		xmlnode_free(auth);
 	} else {


More information about the Commits mailing list