| 70 |
70 |
| 71 if (len < 148) { |
71 if (len < 148) { |
| 72 qq_show_packet("Login reply OK, but length < 139", data, len); |
72 qq_show_packet("Login reply OK, but length < 139", data, len); |
| 73 purple_connection_error_reason(gc, |
73 purple_connection_error_reason(gc, |
| 74 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, |
74 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, |
| 75 _("Cannot decrypt server reply")); |
75 _("Unable to decrypt server reply")); |
| 76 return QQ_LOGIN_REPLY_ERR; |
76 return QQ_LOGIN_REPLY_ERR; |
| 77 } |
77 } |
| 78 |
78 |
| 79 bytes = 0; |
79 bytes = 0; |
| 80 bytes += qq_get8(&ret, data + bytes); |
80 bytes += qq_get8(&ret, data + bytes); |
| 158 |
158 |
| 159 |
159 |
| 160 if (len < 11) { |
160 if (len < 11) { |
| 161 purple_connection_error_reason(gc, |
161 purple_connection_error_reason(gc, |
| 162 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, |
162 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, |
| 163 _("Cannot decrypt server reply")); |
163 _("Unable to decrypt server reply")); |
| 164 return QQ_LOGIN_REPLY_ERR; |
164 return QQ_LOGIN_REPLY_ERR; |
| 165 } |
165 } |
| 166 |
166 |
| 167 qd = (qq_data *) gc->proto_data; |
167 qd = (qq_data *) gc->proto_data; |
| 168 bytes = 0; |
168 bytes = 0; |
| 410 break; |
410 break; |
| 411 case 0x05: /* invalid password */ |
411 case 0x05: /* invalid password */ |
| 412 if (!purple_account_get_remember_password(gc->account)) { |
412 if (!purple_account_get_remember_password(gc->account)) { |
| 413 purple_account_set_password(gc->account, NULL); |
413 purple_account_set_password(gc->account, NULL); |
| 414 } |
414 } |
| 415 error = g_strdup( _("Incorrect password.")); |
415 error = g_strdup( _("Incorrect password")); |
| 416 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; |
416 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; |
| 417 break; |
417 break; |
| 418 case 0x06: /* need activation */ |
418 case 0x06: /* need activation */ |
| 419 error = g_strdup( _("Activation required")); |
419 error = g_strdup( _("Activation required")); |
| 420 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; |
420 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; |
| 653 } |
653 } |
| 654 |
654 |
| 655 if (data_len < 15) { |
655 if (data_len < 15) { |
| 656 purple_connection_error_reason(gc, |
656 purple_connection_error_reason(gc, |
| 657 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, |
657 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, |
| 658 _("Could not decrypt server reply")); |
658 _("Unable to decrypt server reply")); |
| 659 return QQ_LOGIN_REPLY_ERR; |
659 return QQ_LOGIN_REPLY_ERR; |
| 660 } |
660 } |
| 661 |
661 |
| 662 qd->redirect_len = data_len; |
662 qd->redirect_len = data_len; |
| 663 qd->redirect = g_realloc(qd->redirect, qd->redirect_len); |
663 qd->redirect = g_realloc(qd->redirect, qd->redirect_len); |
| 1095 { |
1095 { |
| 1096 case 0x34: /* invalid password */ |
1096 case 0x34: /* invalid password */ |
| 1097 if (!purple_account_get_remember_password(gc->account)) { |
1097 if (!purple_account_get_remember_password(gc->account)) { |
| 1098 purple_account_set_password(gc->account, NULL); |
1098 purple_account_set_password(gc->account, NULL); |
| 1099 } |
1099 } |
| 1100 error = g_strdup(_("Incorrect password.")); |
1100 error = g_strdup(_("Incorrect password")); |
| 1101 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; |
1101 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; |
| 1102 break; |
1102 break; |
| 1103 case 0x33: /* need activation */ |
1103 case 0x33: /* need activation */ |
| 1104 case 0x51: /* need activation */ |
1104 case 0x51: /* need activation */ |
| 1105 error = g_strdup(_("Activation required")); |
1105 error = g_strdup(_("Activation required")); |
| 1106 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; |
1106 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; |
| 1107 break; |
1107 break; |
| 1108 case 0xBF: /* uid is not exist */ |
1108 case 0xBF: /* uid is not exist */ |
| 1109 error = g_strdup(_("Invalid username.")); |
1109 error = g_strdup(_("Username does not exist")); |
| 1110 reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME; |
1110 reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME; |
| 1111 break; |
1111 break; |
| 1112 default: |
1112 default: |
| 1113 qq_hex_dump(PURPLE_DEBUG_WARNING, "QQ", data, data_len, |
1113 qq_hex_dump(PURPLE_DEBUG_WARNING, "QQ", data, data_len, |
| 1114 ">>> [default] decrypt and dump"); |
1114 ">>> [default] decrypt and dump"); |