From 154b4093c4c4a7c074f0fa86a576c9546912841f Mon Sep 17 00:00:00 2001 From: mid Date: Fri, 23 Mar 2001 01:52:38 +0000 Subject: [PATCH] - Fri Mar 23 01:45:28 UTC 2001 - Add AIM_CLIENTINFO_KNOWNGOOD - Fix a few details in aim_send_login (thanks temas) - Prevent aim_rxhandlers from being called recursively - This is something that has been in my PENDING_AIM mailbox for over a year now. I figured it was trivial enough to throw in. EveryBuddy wanted it, but I don't remember why. It should never happen anyway. - Use AIM_CLIENTINFO_KNOWNGOOD - This lets faimtest log in after today's round of AOL being mean. --- CHANGES | 10 ++++++++++ include/aim.h | 12 ++++++++++++ src/login.c | 21 ++++++++++++++++----- src/rxhandlers.c | 14 ++++++++------ utils/faimtest/faimtest.c | 2 +- 5 files changed, 47 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index e58e4ac..a0ab8aa 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,16 @@ No release numbers ------------------ + - Fri Mar 23 01:45:28 UTC 2001 + - Add AIM_CLIENTINFO_KNOWNGOOD + - Fix a few details in aim_send_login (thanks temas) + - Prevent aim_rxhandlers from being called recursively + - This is something that has been in my PENDING_AIM mailbox for over + a year now. I figured it was trivial enough to throw in. EveryBuddy + wanted it, but I don't remember why. It should never happen anyway. + - Use AIM_CLIENTINFO_KNOWNGOOD + - This lets faimtest log in after today's round of AOL being mean. + - Fri Mar 16 23:12:58 UTC 2001 - Remove one level from aim_rxdispatch() diff --git a/include/aim.h b/include/aim.h index 3cf4f13..bad2b54 100644 --- a/include/aim.h +++ b/include/aim.h @@ -169,6 +169,18 @@ struct client_info_s { long unknown; }; +#define AIM_CLIENTINFO_KNOWNGOOD { \ + "AOL Instant Messenger (SM), version 3.5.1670/WIN32", \ + 0x0003, \ + 0x0005, \ + 0x0686, \ + "us", \ + "en", \ + 0x0004, \ + 0x0000, \ + 0x0000002a, \ +} + #ifndef TRUE #define TRUE 1 #define FALSE 0 diff --git a/src/login.c b/src/login.c index 392efe7..6b06863 100644 --- a/src/login.c +++ b/src/login.c @@ -137,6 +137,16 @@ faim_export int aim_request_login(struct aim_session_t *sess, * lang = "en" * country = "us" * unknown4a = 0x01 + * + * Latest WinAIM that libfaim can emulate without server-side buddylists: + * clientstring = "AOL Instant Messenger (SM), version 3.5.1670/WIN32" + * major2 = 0x0004 + * major = 0x0003 + * minor = 0x0005 + * minor2 = 0x0000 + * build = 0x0686 + * unknown =0x0000002a + * */ faim_export int aim_send_login (struct aim_session_t *sess, struct aim_conn_t *conn, @@ -185,6 +195,7 @@ faim_export int aim_send_login (struct aim_session_t *sess, curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x0003, strlen(clientinfo->clientstring), clientinfo->clientstring); if (sess->flags & AIM_SESS_FLAGS_SNACLOGIN) { + curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0016, (unsigned short)clientinfo->major2); curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0017, (unsigned short)clientinfo->major); curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0018, (unsigned short)clientinfo->minor); @@ -193,7 +204,7 @@ faim_export int aim_send_login (struct aim_session_t *sess, curbyte += aim_puttlv_32(newpacket->data+curbyte, 0x0014, clientinfo->unknown); curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0009, 0x0015); - curbyte += aim_puttlv_8(newpacket->data+curbyte, 0x004a, 0x00); + } else { /* Use very specific version numbers, to further indicate the hack. */ curbyte += aim_puttlv_16(newpacket->data+curbyte, 0x0016, 0x010a); @@ -205,14 +216,14 @@ faim_export int aim_send_login (struct aim_session_t *sess, } if (strlen(clientinfo->country)) - curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x000e, strlen(clientinfo->country), clientinfo->country); + curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x000f, strlen(clientinfo->country), clientinfo->country); else - curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x000e, 2, "us"); + curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x000f, 2, "us"); if (strlen(clientinfo->lang)) - curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x000f, strlen(clientinfo->lang), clientinfo->lang); + curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x000e, strlen(clientinfo->lang), clientinfo->lang); else - curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x000f, 2, "en"); + curbyte += aim_puttlv_str(newpacket->data+curbyte, 0x000e, 2, "en"); newpacket->commandlen = curbyte; diff --git a/src/rxhandlers.c b/src/rxhandlers.c index c0f0956..2241f71 100644 --- a/src/rxhandlers.c +++ b/src/rxhandlers.c @@ -308,10 +308,15 @@ faim_export int aim_rxdispatch(struct aim_session_t *sess) { int i = 0; struct command_rx_struct *workingPtr = NULL; + static int critical = 0; + if (critical) + return 0; /* don't call recursively! */ + + critical = 1; + if (sess->queue_incoming == NULL) { faimdprintf(sess, 1, "parse_generic: incoming packet queue empty.\n"); - return 0; } else { workingPtr = sess->queue_incoming; for (i = 0; workingPtr != NULL; workingPtr = workingPtr->next, i++) { @@ -507,11 +512,6 @@ faim_export int aim_rxdispatch(struct aim_session_t *sess) workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr); } - - /* Try it raw and see if we can get it to happen... */ - if (!workingPtr->handled) /* XXX this is probably bad. */ - workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, family, subtype, workingPtr); - } } @@ -522,6 +522,8 @@ faim_export int aim_rxdispatch(struct aim_session_t *sess) * you'll have :) */ aim_purge_rxqueue(sess); + + critical = 0; return 0; } diff --git a/utils/faimtest/faimtest.c b/utils/faimtest/faimtest.c index b43cb23..bccad2b 100644 --- a/utils/faimtest/faimtest.c +++ b/utils/faimtest/faimtest.c @@ -1570,7 +1570,7 @@ int faimtest_parse_misses(struct aim_session_t *sess, struct command_rx_struct * int faimtest_parse_login(struct aim_session_t *sess, struct command_rx_struct *command, ...) { - struct client_info_s info = {"faimtest (with SNAC login)", 4, 1, 2010, "us", "en", 0x0004, 0x0000, 0x0000004b}; /* 4.1.2010 */ + struct client_info_s info = AIM_CLIENTINFO_KNOWNGOOD; char *key; va_list ap; -- 2.45.1