diff 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
line wrap: on
line diff
--- a/src/protocols/oscar/auth.c	Sat Jan 11 08:40:25 2003 +0000
+++ b/src/protocols/oscar/auth.c	Sat Jan 11 09:19:39 2003 +0000
@@ -21,16 +21,16 @@
  * be the first thing you send.
  *
  */
-faim_export int aim_sendcookie(aim_session_t *sess, aim_conn_t *conn, const fu8_t *chipsahoy)
+faim_export int aim_sendcookie(aim_session_t *sess, aim_conn_t *conn, const fu16_t length, const fu8_t *chipsahoy)
 {
 	aim_frame_t *fr;
 	aim_tlvlist_t *tl = NULL;
 
-	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x0001, 4+2+2+AIM_COOKIELEN)))
+	if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x0001, 4+2+2+length)))
 		return -ENOMEM;
 
 	aimbs_put32(&fr->data, 0x00000001);
-	aim_addtlvtochain_raw(&tl, 0x0006, AIM_COOKIELEN, chipsahoy);	
+	aim_addtlvtochain_raw(&tl, 0x0006, length, chipsahoy);
 	aim_writetlvchain(&fr->data, &tl);
 	aim_freetlvchain(&tl);
 
@@ -392,6 +392,7 @@
 
 		tmptlv = aim_gettlv(tlvlist, 0x0006, 1);
 
+		info->cookielen = tmptlv->length;
 		info->cookie = tmptlv->value;
 	}