Mercurial > pidgin.yaz
comparison src/protocols/oscar/auth.c @ 4293:79d871c11eb9
[gaim-migrate @ 4546]
This changes to authorization cookie from a fixed length of 0x0100 bytes
to a dynamic length. The cookie AOL sends is always 0x0100 bytes,
but there was a bug report saying,
"I found that Gaim doesn't work with iserverd because it
uses hardcoded authorization cookie length. Why don't
you use TLV length value as auth cookie length ?
ICQ2k+ and winaim works without problems with 64
byte cookies...
AOL can just change cookie len and gaim will became
useless..."
I don't know about useless... but he does have a point.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 11 Jan 2003 09:19:39 +0000 |
parents | 9f729d6d88a6 |
children | 7c9f3d0fe8b2 |
comparison
equal
deleted
inserted
replaced
4292:78a3d2caf84c | 4293:79d871c11eb9 |
---|---|
19 * | 19 * |
20 * Very commonly used, as every connection except auth will require this to | 20 * Very commonly used, as every connection except auth will require this to |
21 * be the first thing you send. | 21 * be the first thing you send. |
22 * | 22 * |
23 */ | 23 */ |
24 faim_export int aim_sendcookie(aim_session_t *sess, aim_conn_t *conn, const fu8_t *chipsahoy) | 24 faim_export int aim_sendcookie(aim_session_t *sess, aim_conn_t *conn, const fu16_t length, const fu8_t *chipsahoy) |
25 { | 25 { |
26 aim_frame_t *fr; | 26 aim_frame_t *fr; |
27 aim_tlvlist_t *tl = NULL; | 27 aim_tlvlist_t *tl = NULL; |
28 | 28 |
29 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x0001, 4+2+2+AIM_COOKIELEN))) | 29 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x0001, 4+2+2+length))) |
30 return -ENOMEM; | 30 return -ENOMEM; |
31 | 31 |
32 aimbs_put32(&fr->data, 0x00000001); | 32 aimbs_put32(&fr->data, 0x00000001); |
33 aim_addtlvtochain_raw(&tl, 0x0006, AIM_COOKIELEN, chipsahoy); | 33 aim_addtlvtochain_raw(&tl, 0x0006, length, chipsahoy); |
34 aim_writetlvchain(&fr->data, &tl); | 34 aim_writetlvchain(&fr->data, &tl); |
35 aim_freetlvchain(&tl); | 35 aim_freetlvchain(&tl); |
36 | 36 |
37 aim_tx_enqueue(sess, fr); | 37 aim_tx_enqueue(sess, fr); |
38 | 38 |
390 if (aim_gettlv(tlvlist, 0x0006, 1)) { | 390 if (aim_gettlv(tlvlist, 0x0006, 1)) { |
391 aim_tlv_t *tmptlv; | 391 aim_tlv_t *tmptlv; |
392 | 392 |
393 tmptlv = aim_gettlv(tlvlist, 0x0006, 1); | 393 tmptlv = aim_gettlv(tlvlist, 0x0006, 1); |
394 | 394 |
395 info->cookielen = tmptlv->length; | |
395 info->cookie = tmptlv->value; | 396 info->cookie = tmptlv->value; |
396 } | 397 } |
397 | 398 |
398 /* | 399 /* |
399 * The email address attached to this account | 400 * The email address attached to this account |