adium: cc89675a: Reapply Adium's "If we choose Digest-md5...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Thu Feb 18 12:01:54 EST 2010


-----------------------------------------------------------------
Revision: cc89675a5981c1c6c951285f37a734b33512072c
Ancestor: 3171769c37ae8760750c72030e11ddfb20d05ca4
Author: darkrain42 at pidgin.im
Date: 2010-02-18T16:49:01
Branch: im.pidgin.adium
URL: http://d.pidgin.im/viewmtn/revision/info/cc89675a5981c1c6c951285f37a734b33512072c

Modified files:
        libpurple/protocols/jabber/auth_cyrus.c

ChangeLog: 

Reapply Adium's "If we choose Digest-md5, fall back to libpurple's implementation" patch.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth_cyrus.c	7961f08b1d98e8bbb353c802d343d771e568832a
+++ libpurple/protocols/jabber/auth_cyrus.c	588cacec2f65f05294a70a5910567fdc8e13a8f2
@@ -327,6 +327,23 @@ jabber_auth_start_cyrus(JabberStream *js
 			}
 		}
 
+		if (purple_strequal(js->current_mech, "DIGEST-MD5")) {
+			/* 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 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->sasl_mech = jabber_auth_get_digest_md5_mech();
+			js->sasl_state = SASL_OK;
+			sasl_dispose(&js->sasl);
+			js->sasl = NULL;
+		}
+
 		*reply = auth;
 		return JABBER_SASL_STATE_CONTINUE;
 	} else {


More information about the Commits mailing list