[ekg2-commit] ekg2: jabber_handlers.c (HEAD) [darkjames]

CVS commit cvs w toxygen.net
Śro, 5 Wrz 2007, 19:31:40 CEST


Module name:	ekg2
Changes by:	darkjames	2007-09-05 19:31:37

Modified files:
	jabber_handlers.c

Log message:
fix SASL auth with chrome.pl (and possible other jabberd servers)
ekg2 recv: realm="chrome.pl", nonce="KcFOJc6f1M5aK2Vc5P1+Tg==", qop="auth, auth-int", charset=utf-8, algorithm=md5-ses
(gdb) call array_make("realm=\"chrome.pl\", nonce=\"KcFOJc6f1M5aK2Vc5P1+Tg==\", qop=\"auth, auth-int\", charset=utf-8, algorithm=md5-ses", "=,", 0, 1, 1)[2]
$3 = 0x64c670 " nonce"
we check only for !xstrcmp(arr[i], "nonce")
so let's use strip_spaces() and get rid of these space.
Thx to Wojciech Szymak for challange string.

Index: jabber_handlers.c
===================================================================
RCS file: /home/cvs/ekg2/plugins/jabber/jabber_handlers.c,v
diff -d -u -r1.125 -r1.126
--- jabber_handlers.c	5 Sep 2007 16:52:36 -0000	1.125
+++ jabber_handlers.c	5 Sep 2007 17:31:37 -0000	1.126
@@ -638,9 +638,13 @@
 			return;
 		}
 
-		if (!xstrcmp(arr[i], "realm"))		realm	= arr[i+1];
-		if (!xstrcmp(arr[i], "rspauth"))	rspauth	= arr[i+1];
-		if (!xstrcmp(arr[i], "nonce"))		nonce	= arr[i+1];
+		{
+			char *tmp = strip_spaces(arr[i]);
+
+			if (!xstrcmp(tmp, "realm"))		realm	= arr[i+1];
+			else if (!xstrcmp(tmp, "rspauth"))	rspauth	= arr[i+1];
+			else if (!xstrcmp(tmp, "nonce"))	nonce	= arr[i+1];
+		}
 
 		i++;
 		if (arr[i]) i++;


Więcej informacji o liście dyskusyjnej ekg2-commit