changeset 21900:9a43b7ed0f74

merge of '596c9f710fd64a951cbce4bb92b6e051ae3805b1' and 'a29666fd1b9fb1eda082e5ed58e5ad2cbd2dfc0f'
author Will Thompson <will.thompson@collabora.co.uk>
date Wed, 19 Dec 2007 00:43:23 +0000
parents af389f2537ad (current diff) 2e899bbbf14c (diff)
children e1c0b28b69c0
files
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth.c	Tue Dec 18 22:12:10 2007 +0000
+++ b/libpurple/protocols/jabber/auth.c	Wed Dec 19 00:43:23 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;