# HG changeset patch # User Daniel Atallah # Date 1154908054 0 # Node ID eb1a7d176149fc3f76d19ac71bf96832b6a2ebc7 # Parent 3cefea0bf4a286d223bae6ffdfe510c97b42ab12 [gaim-migrate @ 16658] It has been too long since I did something productive here. Fix logging into yahoo with a password containing non-ascii characters. This fixes bug #1534796. committer: Tailor Script diff -r 3cefea0bf4a2 -r eb1a7d176149 src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Sun Aug 06 21:03:10 2006 +0000 +++ b/src/protocols/yahoo/yahoo.c Sun Aug 06 23:47:34 2006 +0000 @@ -1241,6 +1241,7 @@ GaimAccount *account = gaim_connection_get_account(gc); const char *name = gaim_normalize(account, gaim_account_get_username(account)); const char *pass = gaim_connection_get_password(gc); + char *enc_pass; struct yahoo_data *yd = gc->proto_data; GaimCipher *md5_cipher; @@ -1472,14 +1473,20 @@ magic_key_char[3] = (updated_key >> 24) & 0xff; } + enc_pass = yahoo_string_encode(gc, pass, NULL); + /* Get password and crypt hashes as per usual. */ gaim_cipher_context_reset(md5_ctx, NULL); - gaim_cipher_context_append(md5_ctx, (const guchar *)pass, strlen(pass)); + gaim_cipher_context_append(md5_ctx, (const guchar *)enc_pass, strlen(enc_pass)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest), md5_digest, NULL); to_y64(password_hash, md5_digest, 16); - crypt_result = yahoo_crypt(pass, "$1$_2S43d5f$"); + crypt_result = yahoo_crypt(enc_pass, "$1$_2S43d5f$"); + + g_free(enc_pass); + enc_pass = NULL; + gaim_cipher_context_reset(md5_ctx, NULL); gaim_cipher_context_append(md5_ctx, (const guchar *)crypt_result, strlen(crypt_result)); gaim_cipher_context_digest(md5_ctx, sizeof(md5_digest),