| 234 snacid = aim_cachesnac(sess, 0x0017, 0x0002, 0x0000, NULL, 0); |
234 snacid = aim_cachesnac(sess, 0x0017, 0x0002, 0x0000, NULL, 0); |
| 235 aim_putsnac(&fr->data, 0x0017, 0x0002, 0x0000, snacid); |
235 aim_putsnac(&fr->data, 0x0017, 0x0002, 0x0000, snacid); |
| 236 |
236 |
| 237 aim_tlvlist_add_raw(&tl, 0x0001, strlen(sn), sn); |
237 aim_tlvlist_add_raw(&tl, 0x0001, strlen(sn), sn); |
| 238 |
238 |
| 239 aim_encode_password_md5(password, key, digest); |
239 /* Truncate ICQ passwords, if necessary */ |
| |
240 if (isdigit(sn[0]) && (strlen(password) > MAXICQPASSLEN)) |
| |
241 { |
| |
242 char truncated[MAXICQPASSLEN + 1]; |
| |
243 strncpy(truncated, password, MAXICQPASSLEN); |
| |
244 truncated[MAXICQPASSLEN] = 0; |
| |
245 aim_encode_password_md5(truncated, key, digest); |
| |
246 } |
| |
247 else |
| |
248 { |
| |
249 aim_encode_password_md5(password, key, digest); |
| |
250 } |
| |
251 |
| 240 aim_tlvlist_add_raw(&tl, 0x0025, 16, digest); |
252 aim_tlvlist_add_raw(&tl, 0x0025, 16, digest); |
| 241 |
253 |
| 242 #ifndef USE_OLD_MD5 |
254 #ifndef USE_OLD_MD5 |
| 243 aim_tlvlist_add_noval(&tl, 0x004c); |
255 aim_tlvlist_add_noval(&tl, 0x004c); |
| 244 #endif |
256 #endif |