Mercurial > pidgin.yaz
comparison libpurple/protocols/qq/qq_network.c @ 24069:dc112387190f
2008.09.29 - ccpaging <ccpaging(at)gmail.com>
* 'Check Password' function for protocol 2007/2008
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Wed, 22 Oct 2008 14:41:13 +0000 |
parents | 87e61a85f5dd |
children | 619ac2303c46 |
comparison
equal
deleted
inserted
replaced
24068:87e61a85f5dd | 24069:dc112387190f |
---|---|
307 } | 307 } |
308 | 308 |
309 switch (cmd) { | 309 switch (cmd) { |
310 case QQ_CMD_TOKEN: | 310 case QQ_CMD_TOKEN: |
311 case QQ_CMD_GET_SERVER: | 311 case QQ_CMD_GET_SERVER: |
312 case QQ_CMD_TOKEN_EX: | |
313 case QQ_CMD_CHECK_PWD: | |
312 case QQ_CMD_LOGIN: | 314 case QQ_CMD_LOGIN: |
313 ret = qq_proc_login_cmds(gc, cmd, seq, buf + bytes, bytes_not_read, update_class, ship32); | 315 ret = qq_proc_login_cmds(gc, cmd, seq, buf + bytes, bytes_not_read, update_class, ship32); |
314 if (ret != QQ_LOGIN_REPLY_OK) { | 316 if (ret != QQ_LOGIN_REPLY_OK) { |
315 if (ret == QQ_LOGIN_REPLY_REDIRECT) { | 317 if (ret == QQ_LOGIN_REPLY_REDIRECT) { |
316 redirect_server(gc); | 318 redirect_server(gc); |
713 | 715 |
714 /* now generate md5 processed passwd */ | 716 /* now generate md5 processed passwd */ |
715 passwd = purple_account_get_password(purple_connection_get_account(gc)); | 717 passwd = purple_account_get_password(purple_connection_get_account(gc)); |
716 | 718 |
717 /* use twice-md5 of user password as session key since QQ 2003iii */ | 719 /* use twice-md5 of user password as session key since QQ 2003iii */ |
718 dest = qd->ld.pwd_2nd_md5; | 720 dest = qd->ld.pwd_md5; |
719 qq_get_md5(dest, dest_len, (guint8 *)passwd, strlen(passwd)); | 721 qq_get_md5(dest, dest_len, (guint8 *)passwd, strlen(passwd)); |
720 qq_get_md5(dest, dest_len, dest, dest_len); | 722 |
721 | 723 dest = qd->ld.pwd_twice_md5; |
722 dest = qd->ld.pwd_4th_md5; | 724 qq_get_md5(dest, dest_len, qd->ld.pwd_md5, dest_len); |
723 qq_get_md5(dest, dest_len, qd->ld.pwd_2nd_md5, dest_len); | |
724 qq_get_md5(dest, dest_len, dest, dest_len); | |
725 } | 725 } |
726 | 726 |
727 /* the callback function after socket is built | 727 /* the callback function after socket is built |
728 * we setup the qq protocol related configuration here */ | 728 * we setup the qq protocol related configuration here */ |
729 static void connect_cb(gpointer data, gint source, const gchar *error_message) | 729 static void connect_cb(gpointer data, gint source, const gchar *error_message) |
1019 qd->fd = -1; | 1019 qd->fd = -1; |
1020 | 1020 |
1021 qq_trans_remove_all(gc); | 1021 qq_trans_remove_all(gc); |
1022 | 1022 |
1023 memset(qd->ld.random_key, 0, sizeof(qd->ld.random_key)); | 1023 memset(qd->ld.random_key, 0, sizeof(qd->ld.random_key)); |
1024 memset(qd->ld.pwd_2nd_md5, 0, sizeof(qd->ld.pwd_2nd_md5)); | 1024 memset(qd->ld.pwd_md5, 0, sizeof(qd->ld.pwd_md5)); |
1025 memset(qd->ld.pwd_4th_md5, 0, sizeof(qd->ld.pwd_4th_md5)); | 1025 memset(qd->ld.pwd_twice_md5, 0, sizeof(qd->ld.pwd_twice_md5)); |
1026 memset(qd->ld.login_key, 0, sizeof(qd->ld.login_key)); | 1026 memset(qd->ld.login_key, 0, sizeof(qd->ld.login_key)); |
1027 memset(qd->session_key, 0, sizeof(qd->session_key)); | 1027 memset(qd->session_key, 0, sizeof(qd->session_key)); |
1028 memset(qd->session_md5, 0, sizeof(qd->session_md5)); | 1028 memset(qd->session_md5, 0, sizeof(qd->session_md5)); |
1029 | 1029 |
1030 qd->my_local_ip.s_addr = 0; | 1030 qd->my_local_ip.s_addr = 0; |