Mercurial > pidgin
changeset 27020:a0e3e4f37702
disapproval of revision '84a23ef59e6a3bc88834f0948c67516f0a39234b'
Conversation in devel@c.p.i leads to deryni saying:
Ok, if we send charset=utf-8 then we need to have sent a utf8 username and realm in digest-response but need to have used iso8859-1 versions of them when calculating response-value (if they are valid iso8859-1). I think.
which is what the code was doing before.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Wed, 03 Jun 2009 19:34:26 +0000 |
parents | e696a0740a85 |
children | 2f297ab00e9d |
files | ChangeLog libpurple/protocols/jabber/auth.c |
diffstat | 2 files changed, 5 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Jun 03 16:41:52 2009 +0000 +++ b/ChangeLog Wed Jun 03 19:34:26 2009 +0000 @@ -50,8 +50,6 @@ 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)
--- a/libpurple/protocols/jabber/auth.c Wed Jun 03 16:41:52 2009 +0000 +++ b/libpurple/protocols/jabber/auth.c Wed Jun 03 19:34:26 2009 +0000 @@ -784,29 +784,22 @@ static char * generate_response_value(JabberID *jid, const char *passwd, const char *nonce, - const char *cnonce, const char *a2, const char *realm, - gboolean *converted) + const char *cnonce, const char *a2, const char *realm) { PurpleCipher *cipher; PurpleCipherContext *context; guchar result[16]; size_t a1len; + 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"); @@ -921,19 +914,18 @@ 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, &converted_to_iso8859); + purple_connection_get_password(js->gc), nonce, cnonce, a2, realm); 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, &converted_to_iso8859); + purple_connection_get_password(js->gc), nonce, cnonce, a2, realm); g_free(a2); g_string_append_printf(response, "username=\"%s\"", js->user->node); @@ -944,8 +936,7 @@ 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); - if (!converted_to_iso8859) - g_string_append_printf(response, ",charset=utf-8"); + g_string_append_printf(response, ",charset=utf-8"); g_free(auth_resp); g_free(cnonce);