diff libpurple/protocols/jabber/auth.c @ 30896:4072761e3454

jabber: Slight improvements to the stream ID fix This warns that it will fail miserably with digestmd5 legacy auth. Also, document that crammd5 code and remove a check for js->stream_id since crammd5 doesn't use it (no salt!)
author Paul Aurich <paul@darkrain42.org>
date Tue, 31 Aug 2010 02:52:28 +0000
parents 8084631e2e84
children cea7e713ef07
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth.c	Tue Aug 31 02:28:05 2010 +0000
+++ b/libpurple/protocols/jabber/auth.c	Tue Aug 31 02:52:28 2010 +0000
@@ -251,7 +251,8 @@
 		g_free(msg);
 	} else if (type == JABBER_IQ_RESULT) {
 		query = xmlnode_get_child(packet, "query");
-		if(js->stream_id && xmlnode_get_child(query, "digest")) {
+		if (js->stream_id && *js->stream_id &&
+				xmlnode_get_child(query, "digest")) {
 			char *s, *hash;
 
 			iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:auth");
@@ -269,8 +270,10 @@
 			g_free(s);
 			jabber_iq_set_callback(iq, auth_old_result_cb, NULL);
 			jabber_iq_send(iq);
-
-		} else if(js->stream_id && (x = xmlnode_get_child(query, "crammd5"))) {
+		} else if ((x = xmlnode_get_child(query, "crammd5"))) {
+			/* For future reference, this appears to be a custom OS X extension
+			 * to non-SASL authentication.
+			 */
 			const char *challenge;
 			gchar digest[33];
 			PurpleCipherContext *hmac;