pidgin: 849a753d: Only append ,charset=utf-8 for DIGEST-MD...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Tue Jun 23 02:50:41 EDT 2009


-----------------------------------------------------------------
Revision: 849a753dc5505c801cd053591778ddd340db6337
Ancestor: 27cbb143be6f27d33256636206ac89b3adef8cd6
Author: darkrain42 at pidgin.im
Date: 2009-06-23T06:45:21
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/849a753dc5505c801cd053591778ddd340db6337

Modified files:
        libpurple/protocols/jabber/auth.c

ChangeLog: 

Only append ,charset=utf-8 for DIGEST-MD5. This should fix comment 2 on Adium#12429.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth.c	ee7f720b93187b45c929daa67ae9d0b5325308a6
+++ libpurple/protocols/jabber/auth.c	1aed957f24c5b9f2ba0a9abde6a49c6adbeb94ba
@@ -990,12 +990,16 @@ jabber_auth_handle_challenge(JabberStrea
 			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);


More information about the Commits mailing list