pidgin: 84a23ef5: jabber digest-md5: Only specify the char...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Wed Jun 3 12:45:39 EDT 2009
-----------------------------------------------------------------
Revision: 84a23ef59e6a3bc88834f0948c67516f0a39234b
Ancestor: 5224af5f959aba5adf514bbaaff9f2afebee14f5
Author: darkrain42 at pidgin.im
Date: 2009-06-03T16:41:52
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/84a23ef59e6a3bc88834f0948c67516f0a39234b
Modified files:
ChangeLog libpurple/protocols/jabber/auth.c
ChangeLog:
jabber digest-md5: Only specify the charset as UTF-8 if conversion to ISO-8859-1 was not successful.
Fixes DIGEST-MD5 authentication to Prosody when the password
includes non-ASCII characters that are in ISO-8859-1 (like 'AE').
-------------- next part --------------
============================================================
--- ChangeLog 996520af674f2b26da61e7d6e00c79f7cafee04f
+++ ChangeLog 7833b94f9c7e08df05bc6c66b8f3ea9fe69c02d3
@@ -50,6 +50,8 @@ version 2.6.0 (??/??/2009):
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.
+ * When using non-Cyrus SASL DIGEST-MD5 authentication, only specify the
+ charset as UTF-8 if the username/password weren't converted to ISO-8859-1.
Yahoo:
* P2P file transfers. (Sulabh Mahajan)
============================================================
--- libpurple/protocols/jabber/auth.c 4846e5134fd09bde6ad21cd0b75b64693e90e5ea
+++ libpurple/protocols/jabber/auth.c 11a5988adda821024852c3d4301d6178d2bd7e5a
@@ -784,22 +784,29 @@ generate_response_value(JabberID *jid, c
static char *
generate_response_value(JabberID *jid, const char *passwd, const char *nonce,
- const char *cnonce, const char *a2, const char *realm)
+ const char *cnonce, const char *a2, const char *realm,
+ gboolean *converted)
{
PurpleCipher *cipher;
PurpleCipherContext *context;
guchar result[16];
size_t a1len;
+ gchar *a1, *convnode=NULL, *convpasswd = NULL, *ha1, *ha2, *kd, *x, *z;
- gchar *a1, *convnode=NULL, *convpasswd = NULL, *ha1, *ha2, *kd, *x, *z;
+ if (converted)
+ *converted = TRUE;
if((convnode = g_convert(jid->node, -1, "iso-8859-1", "utf-8",
NULL, NULL, NULL)) == NULL) {
convnode = g_strdup(jid->node);
+ if (converted)
+ *converted = FALSE;
}
if(passwd && ((convpasswd = g_convert(passwd, -1, "iso-8859-1",
"utf-8", NULL, NULL, NULL)) == NULL)) {
convpasswd = g_strdup(passwd);
+ if (converted)
+ *converted = FALSE;
}
cipher = purple_ciphers_find_cipher("md5");
@@ -914,18 +921,19 @@ jabber_auth_handle_challenge(JabberStrea
char *auth_resp;
char *buf;
char *cnonce;
+ gboolean converted_to_iso8859;
cnonce = g_strdup_printf("%x%u%x", g_random_int(), (int)time(NULL),
g_random_int());
a2 = g_strdup_printf("AUTHENTICATE:xmpp/%s", realm);
auth_resp = generate_response_value(js->user,
- purple_connection_get_password(js->gc), nonce, cnonce, a2, realm);
+ purple_connection_get_password(js->gc), nonce, cnonce, a2, realm, &converted_to_iso8859);
g_free(a2);
a2 = g_strdup_printf(":xmpp/%s", realm);
js->expected_rspauth = generate_response_value(js->user,
- purple_connection_get_password(js->gc), nonce, cnonce, a2, realm);
+ purple_connection_get_password(js->gc), nonce, cnonce, a2, realm, &converted_to_iso8859);
g_free(a2);
g_string_append_printf(response, "username=\"%s\"", js->user->node);
@@ -936,7 +944,8 @@ jabber_auth_handle_challenge(JabberStrea
g_string_append_printf(response, ",qop=auth");
g_string_append_printf(response, ",digest-uri=\"xmpp/%s\"", realm);
g_string_append_printf(response, ",response=%s", auth_resp);
- g_string_append_printf(response, ",charset=utf-8");
+ if (!converted_to_iso8859)
+ g_string_append_printf(response, ",charset=utf-8");
g_free(auth_resp);
g_free(cnonce);
More information about the Commits
mailing list