changeset 27041:9df57b1a3569

merge of '75a466dd96590961d154c6e5d131d85bcae642c6' and '920617286db82f86def448f0e2233ade2f89a0a9'
author Paul Aurich <paul@darkrain42.org>
date Fri, 05 Jun 2009 19:06:22 +0000
parents 804141095de5 (current diff) 1fd829110a6d (diff)
children 5fda59132990
files COPYRIGHT ChangeLog
diffstat 3 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/COPYRIGHT	Fri Jun 05 08:23:18 2009 +0000
+++ b/COPYRIGHT	Fri Jun 05 19:06:22 2009 +0000
@@ -452,6 +452,7 @@
 Mark Tiefenbruck
 Andrew Tinney
 Jeffery To
+Krzysztof Tobola (kreez)
 Warren Togami
 Stu Tomlinson
 Bill Tompkins
--- a/ChangeLog	Fri Jun 05 08:23:18 2009 +0000
+++ b/ChangeLog	Fri Jun 05 19:06:22 2009 +0000
@@ -18,6 +18,8 @@
 	  from you on MSN.
 	* DNS servers are re-read when DNS queries fail in case the system has
 	  moved to a new network and the old servers are not accessible.
+	* Gadu-Gadu accounts can specify a server to which to connect.
+	  (Krzysztof "kreez" Tobola)
 
 	XMPP:
 	* Voice & Video support with Jingle (XEP-0166, 0167, 0176, & 0177), voice
@@ -52,6 +54,9 @@
 	  chat to avoid getting too many fetch requests).
 	* Fix an issue with Jabber (pre-XMPP) servers and the user's preference
 	  to require SSL not being respected.
+	* Fix an issue where Cyrus SASL DIGEST MD5 authentication might fail if
+	  the username, password, or realm (the JID domain) contain non-ASCII
+	  characters.
 
 	Yahoo:
 	* P2P file transfers.  (Sulabh Mahajan)
--- a/libpurple/protocols/jabber/auth.c	Fri Jun 05 08:23:18 2009 +0000
+++ b/libpurple/protocols/jabber/auth.c	Fri Jun 05 19:06:22 2009 +0000
@@ -989,7 +989,20 @@
 			response = xmlnode_new("response");
 			xmlnode_set_namespace(response, "urn:ietf:params:xml:ns:xmpp-sasl");
 			if (clen > 0) {
-				enc_out = purple_base64_encode((unsigned char*)c_out, clen);
+				/* Cyrus SASL 2.1.22 appears to contain code to add the charset
+				 * to the response but there is no possibility it will be executed.
+				 * My reading of the digestmd5 plugin indicates the username and
+				 * realm are always encoded in UTF-8 (they seem to be the values
+				 * we pass in), so we need to ensure charset=utf-8 is set.
+				 */
+				if (strstr(c_out, ",charset="))
+					enc_out = purple_base64_encode((unsigned char*)c_out, clen);
+				else {
+					char *tmp = g_strdup_printf("%s,charset=utf-8", c_out);
+					enc_out = purple_base64_encode((unsigned char*)c_out, clen + 14);
+					g_free(tmp);
+				}
+
 				xmlnode_insert_data(response, enc_out, -1);
 				g_free(enc_out);
 			}