| 1860 GaimConnection *gc = (GaimConnection *)user_data; |
1860 GaimConnection *gc = (GaimConnection *)user_data; |
| 1861 GaimAccount *account = gaim_connection_get_account(gc); |
1861 GaimAccount *account = gaim_connection_get_account(gc); |
| 1862 struct yahoo_data *yd = gc->proto_data; |
1862 struct yahoo_data *yd = gc->proto_data; |
| 1863 const char *sn = gaim_account_get_username(account); |
1863 const char *sn = gaim_account_get_username(account); |
| 1864 const char *pass = gaim_account_get_password(account); |
1864 const char *pass = gaim_account_get_password(account); |
| 1865 |
|
| 1866 GHashTable *hash = yahoo_login_page_hash(buf, len); |
1865 GHashTable *hash = yahoo_login_page_hash(buf, len); |
| 1867 GString *url = g_string_new("GET /config/login?login="); |
1866 GString *url = g_string_new("GET /config/login?login="); |
| 1868 url = g_string_append(url, sn); |
|
| 1869 url = g_string_append(url, "&passwd="); |
|
| 1870 |
|
| 1871 char md5[33], *hashp = md5, *chal; |
1867 char md5[33], *hashp = md5, *chal; |
| 1872 int i; |
1868 int i; |
| 1873 md5_byte_t result[16]; |
1869 md5_byte_t result[16]; |
| 1874 md5_state_t ctx; |
1870 md5_state_t ctx; |
| |
1871 |
| |
1872 url = g_string_append(url, sn); |
| |
1873 url = g_string_append(url, "&passwd="); |
| |
1874 |
| 1875 md5_init(&ctx); |
1875 md5_init(&ctx); |
| 1876 md5_append(&ctx, pass, strlen(pass)); |
1876 md5_append(&ctx, pass, strlen(pass)); |
| 1877 md5_finish(&ctx, result); |
1877 md5_finish(&ctx, result); |
| 1878 for (i = 0; i < 16; ++i) { |
1878 for (i = 0; i < 16; ++i) { |
| 1879 g_snprintf(hashp, 3, "%02x", result[i]); |
1879 g_snprintf(hashp, 3, "%02x", result[i]); |