adium: 88ecf027: Fallback to old auth if GSSAPI fails, fi...

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


-----------------------------------------------------------------
Revision: 88ecf027c5322ffd5437c194ca0a7258a9a33b5d
Ancestor: cc264ee13ce87b2c15067b6d4fb66d7eb1861b4a
Author: evands at pidgin.im
Date: 2009-01-14T13:32:09
Branch: im.pidgin.adium
URL: http://d.pidgin.im/viewmtn/revision/info/88ecf027c5322ffd5437c194ca0a7258a9a33b5d

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

ChangeLog: 

Fallback to old auth if GSSAPI fails, fixing connections to iChat 10.5 server. libpurple_jabber_fallback_to_auth_old_after_gssapi_only_fails.diff

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth.c	49746dd872f97a62e56187725b1537ba5b14104a
+++ libpurple/protocols/jabber/auth.c	e39d3c2dfa2428cc5aa617afb29f25f764811761
@@ -1094,6 +1094,11 @@ void jabber_auth_handle_failure(JabberSt
 
 #ifdef HAVE_CYRUS_SASL
 	if(js->auth_fail_count++ < 5) {
+		gboolean tried_gssapi_first = FALSE;
+
+		if (js->auth_fail_count == 1 && !strcmp(js->current_mech, "GSSAPI"))
+			tried_gssapi_first = TRUE;
+
 		if (js->current_mech && strlen(js->current_mech) > 0) {
 			char *pos;
 			if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) {
@@ -1110,6 +1115,17 @@ void jabber_auth_handle_failure(JabberSt
 			
 			jabber_auth_start_cyrus(js);
 			return;
+
+		} else if (tried_gssapi_first) {
+			/* If we tried GSSAPI first, it failed, and it was our only shot, try iq:jabber:auth
+			 * for compatibility with iChat 10.5 Server.
+			 */
+			sasl_dispose(&js->sasl);
+			js->sasl = NULL;
+
+			js->auth_type = JABBER_AUTH_IQ_AUTH;
+			jabber_auth_start_old(js);
+			return;			
 		}
 	}
 #endif


More information about the Commits mailing list