# HG changeset patch # User Paul Aurich # Date 1272693230 0 # Node ID 552616f49f94240e2d14b630e33196802d884cae # Parent 702ea988070c393390d7600968bca2e9830c32b0 jabber: Use the auth_mech_data JabberStream member for what it's for. diff -r 702ea988070c -r 552616f49f94 libpurple/protocols/jabber/auth_digest_md5.c --- a/libpurple/protocols/jabber/auth_digest_md5.c Sat May 01 02:36:27 2010 +0000 +++ b/libpurple/protocols/jabber/auth_digest_md5.c Sat May 01 05:53:50 2010 +0000 @@ -188,16 +188,17 @@ if (g_hash_table_lookup(parts, "rspauth")) { char *rspauth = g_hash_table_lookup(parts, "rspauth"); + char *expected_rspauth = js->auth_mech_data; - if (rspauth && purple_strequal(rspauth, js->expected_rspauth)) { + if (rspauth && purple_strequal(rspauth, expected_rspauth)) { reply = xmlnode_new("response"); xmlnode_set_namespace(reply, NS_XMPP_SASL); } else { *msg = g_strdup(_("Invalid challenge from server")); state = JABBER_SASL_STATE_FAIL; } - g_free(js->expected_rspauth); - js->expected_rspauth = NULL; + g_free(js->auth_mech_data); + js->auth_mech_data = NULL; } else { /* assemble a response, and send it */ /* see RFC 2831 */ @@ -235,7 +236,7 @@ g_free(a2); a2 = g_strdup_printf(":xmpp/%s", realm); - js->expected_rspauth = generate_response_value(js->user, + js->auth_mech_data = generate_response_value(js->user, purple_connection_get_password(js->gc), nonce, cnonce, a2, realm); g_free(a2); @@ -276,6 +277,12 @@ return state; } +static void +digest_md5_dispose(JabberStream *js) +{ + g_free(js->auth_mech_data); +} + static JabberSaslMech digest_md5_mech = { 10, /* priority */ "DIGEST-MD5", /* name */ @@ -283,7 +290,7 @@ digest_md5_handle_challenge, NULL, /* handle_success */ NULL, /* handle_failure */ - NULL /* handle_dispose */ + digest_md5_dispose, }; JabberSaslMech *jabber_auth_get_digest_md5_mech(void) diff -r 702ea988070c -r 552616f49f94 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Sat May 01 02:36:27 2010 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sat May 01 05:53:50 2010 +0000 @@ -1584,7 +1584,6 @@ g_free(js->old_source); g_free(js->old_uri); g_free(js->old_track); - g_free(js->expected_rspauth); if (js->vcard_timer != 0) purple_timeout_remove(js->vcard_timer); diff -r 702ea988070c -r 552616f49f94 libpurple/protocols/jabber/jabber.h --- a/libpurple/protocols/jabber/jabber.h Sat May 01 02:36:27 2010 +0000 +++ b/libpurple/protocols/jabber/jabber.h Sat May 01 05:53:50 2010 +0000 @@ -112,7 +112,7 @@ JabberSaslMech *auth_mech; gpointer auth_mech_data; - + /** * The header from the opening tag. This being NULL is treated * as a special condition in the parsing code (signifying the next @@ -122,9 +122,6 @@ char *stream_id; JabberStreamState state; - /* SASL authentication */ - char *expected_rspauth; - GHashTable *buddies; /*