changeset 21856:2e899bbbf14c

Last minute 'cleanup' actually resulted in breakage on my cram-md5 commit. Fixed it.
author Evan Schoenberg <evan.s@dreskin.net>
date Tue, 18 Dec 2007 22:57:55 +0000
parents 214da49fdcd4
children 9a43b7ed0f74
files libpurple/protocols/jabber/auth.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth.c	Tue Dec 18 02:26:57 2007 +0000
+++ b/libpurple/protocols/jabber/auth.c	Tue Dec 18 22:57:55 2007 +0000
@@ -690,6 +690,10 @@
 			char h[17], *p;
 			int i;
 
+			challenge = xmlnode_get_attrib(xmlnode_get_child(query, "crammd5"), "challenge");
+			auth_hmac_md5(challenge, strlen(challenge), pw, strlen(pw), &digest);
+
+			/* Create the response query */
 			iq = jabber_iq_new_query(js, JABBER_IQ_SET, "jabber:iq:auth");
 			query = xmlnode_get_child(iq->node, "query");
 
@@ -699,8 +703,6 @@
 			xmlnode_insert_data(x, js->user->resource, -1);
 
 			x = xmlnode_new_child(query, "crammd5");
-			challenge = xmlnode_get_attrib(xmlnode_get_child(query, "crammd5"), "challenge");
-			auth_hmac_md5(challenge, strlen(challenge), pw, strlen(pw), &digest);
 
 			/* Translate the digest to a hexadecimal notation */
 			p = h;