changeset 27151:4ea129edc62c

Only append ,charset=utf-8 for DIGEST-MD5. This should fix comment 2 on Adium#12429.
author Paul Aurich <paul@darkrain42.org>
date Tue, 23 Jun 2009 06:45:21 +0000
parents 3b2a2469ffbf
children ad87bc575586
files libpurple/protocols/jabber/auth.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth.c	Mon Jun 22 23:39:56 2009 +0000
+++ b/libpurple/protocols/jabber/auth.c	Tue Jun 23 06:45:21 2009 +0000
@@ -990,12 +990,16 @@
 			xmlnode_set_namespace(response, "urn:ietf:params:xml:ns:xmpp-sasl");
 			if (clen > 0) {
 				/* 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.
+				 * to the response for DIGEST-MD5 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="))
+				if (!js->current_mech || !g_str_equal(js->current_mech, "DIGEST-MD5") ||
+						strstr(c_out, ",charset="))
+					/* If we're not using DIGEST-MD5 or Cyrus SASL is fixed */
 					enc_out = purple_base64_encode((unsigned char*)c_out, clen);
 				else {
 					char *tmp = g_strdup_printf("%s,charset=utf-8", c_out);