# HG changeset patch # User Paul Aurich # Date 1253810329 0 # Node ID fa77b70c8ca621ef7855d288fb789556d07aaf8d # Parent c9d3bda6ef81d6ab6fb8dc1f0906f1c60eab7dfd 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. diff -r c9d3bda6ef81 -r fa77b70c8ca6 ChangeLog --- a/ChangeLog Thu Sep 24 01:50:02 2009 +0000 +++ b/ChangeLog Thu Sep 24 16:38:49 2009 +0000 @@ -3,6 +3,8 @@ 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') diff -r c9d3bda6ef81 -r fa77b70c8ca6 libpurple/protocols/jabber/auth.c --- a/libpurple/protocols/jabber/auth.c Thu Sep 24 01:50:02 2009 +0000 +++ b/libpurple/protocols/jabber/auth.c Thu Sep 24 16:38:49 2009 +0000 @@ -692,7 +692,8 @@ 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 * and we're not using old-style SSL. If the user * is requiring SSL/TLS, we need to enforce it. */ @@ -704,6 +705,16 @@ 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 diff -r c9d3bda6ef81 -r fa77b70c8ca6 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Thu Sep 24 01:50:02 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Thu Sep 24 16:38:49 2009 +0000 @@ -1593,15 +1593,6 @@ 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;