adium: 4b400980: Reapply Adium's "Fall back from GSSAPI t...

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


-----------------------------------------------------------------
Revision: 4b400980d7af30dbb1fe8d9cd46cd324a6cf864d
Ancestor: cc89675a5981c1c6c951285f37a734b33512072c
Author: darkrain42 at pidgin.im
Date: 2010-02-18T16:53:52
Branch: im.pidgin.adium
URL: http://d.pidgin.im/viewmtn/revision/info/4b400980d7af30dbb1fe8d9cd46cd324a6cf864d

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

ChangeLog: 

Reapply Adium's "Fall back from GSSAPI to jabber:iq:auth" patch (untested)

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth_cyrus.c	588cacec2f65f05294a70a5910567fdc8e13a8f2
+++ libpurple/protocols/jabber/auth_cyrus.c	6c6622ba6a337d6b7e2c926ecc106c6bcc3bf1fc
@@ -542,6 +542,10 @@ jabber_cyrus_handle_failure(JabberStream
                             xmlnode **reply, char **error)
 {
 	if (js->auth_fail_count++ < 5) {
+		gboolean tried_gssapi_first = FALSE;
+
+		tried_gssapi_first = (js->auth_fail_count == 1 && g_str_equal(js->current_mech, "GSSAPI"));
+
 		if (js->current_mech && *js->current_mech) {
 			char *pos;
 			if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) {
@@ -557,6 +561,15 @@ jabber_cyrus_handle_failure(JabberStream
 			sasl_dispose(&js->sasl);
 
 			return jabber_auth_start_cyrus(js, reply, error);
+		} else if (tried_gssapi_first) {
+			/* If we tried GSSAPI first, it failed, and it was our only shot, try jabber:iq:auth
+			 * for compatibility with iChat 10.5 Server.
+			 */
+			 sasl_dispose(&js->sasl);
+			 js->sasl = NULL;
+			 js->auth_mech = NULL;
+			 jabber_auth_start_old(js);
+			 return JABBER_SASL_STATE_CONTINUE;
 		}
 	}
 


More information about the Commits mailing list