pidgin: 932eeb7a: jabber: Always require a resource when s...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Thu Sep 24 23:47:16 EDT 2009


-----------------------------------------------------------------
Revision: 932eeb7a0332703a53529cc3583d8088db89170c
Ancestor: 46797f86bb26f4b4c73cd408387c3f5ca9caccca
Author: darkrain42 at pidgin.im
Date: 2009-09-24T16:38:49
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/932eeb7a0332703a53529cc3583d8088db89170c

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

ChangeLog: 

jabber: Always require a resource when starting Legacy IQ Auth.

It's possible to get to jabber_auth_start_old via SASL auth (when
iChat Server says it will accept only GSSAPI). If the user has no
resource specified, iChat Server will silently fail the authentication
but pretend it succeeded.

-------------- next part --------------
============================================================
--- ChangeLog	35beb512fffcbf750ac4a295364b13e0c69b506e
+++ ChangeLog	12253c4c9f663dde096dc532f36badd997af95cd
@@ -3,6 +3,8 @@ version 2.6.3 (??/??/20??):
 version 2.6.3 (??/??/20??):
 	XMPP:
 	* Fix a crash when attempting to validate an invalid JID.
+	* Resolve an issue when connecting to iChat Server when no resource
+	  is specified.
 
 	General:
 	* New 'plugins' sub-command to 'debug' command (i.e. '/debug plugins')
============================================================
--- libpurple/protocols/jabber/auth.c	61b2ff9dacd9b550e6a7f89f2193c788876c3155
+++ libpurple/protocols/jabber/auth.c	2582339652b9b85d482ea6187b7a549f1fc1b2c4
@@ -692,7 +692,8 @@ void jabber_auth_start_old(JabberStream 
 	JabberIq *iq;
 	xmlnode *query, *username;
 
-	/* We can end up here without encryption if the server doesn't support
+	/*
+	 * We can end up here without encryption if the server doesn't support
 	 * <stream:features/> and we're not using old-style SSL.  If the user
 	 * is requiring SSL/TLS, we need to enforce it.
 	 */
@@ -704,6 +705,16 @@ void jabber_auth_start_old(JabberStream 
 		return;
 	}
 
+	/*
+	 * IQ Auth doesn't have support for resource binding, so we need to pick a
+	 * default resource so it will work properly.  jabberd14 throws an error and
+	 * iChat server just fails silently.
+	 */
+	if (!js->user->resource || *js->user->resource == '\0') {
+		g_free(js->user->resource);
+		js->user->resource = g_strdup("Home");
+	}
+
 #ifdef HAVE_CYRUS_SASL
 	/* If we have Cyrus SASL, then passwords will have been set
 	 * to OPTIONAL for this protocol. So, we need to do our own
============================================================
--- libpurple/protocols/jabber/jabber.c	3c994999c0655645585c1ed5e1d7c8fd70c565d6
+++ libpurple/protocols/jabber/jabber.c	5b978baf1e664da07470b6af18f7a48974c8f4d0
@@ -1593,15 +1593,6 @@ void jabber_stream_set_state(JabberStrea
 			if(js->protocol_version == JABBER_PROTO_0_9 && js->registration) {
 				jabber_register_start(js);
 			} else if(js->auth_type == JABBER_AUTH_IQ_AUTH) {
-				/* with dreamhost's xmpp server at least, you have to
-				   specify a resource or you will get a "406: Not
-				   Acceptable"
-				*/
-				if(!js->user->resource || *js->user->resource == '\0') {
-					g_free(js->user->resource);
-					js->user->resource = g_strdup("Home");
-				}
-
 				jabber_auth_start_old(js);
 			}
 			break;


More information about the Commits mailing list