Mercurial > pidgin.yaz
comparison src/protocols/oscar/auth.c @ 7282:ad243bc63184
[gaim-migrate @ 7861]
Mostly this is my usual blah clean-up/changes.
I started merging that icq sms patch, but I'm not comfortable
with much of it...
I also made AIM have 6 login steps instead of 2. The first
few go pretty quickly though. I'll probably work on this
more later, but I'm going to sleep now.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 16 Oct 2003 06:12:43 +0000 |
parents | 0ed4d53c46f9 |
children | be7c1468c6a7 |
comparison
equal
deleted
inserted
replaced
7281:0f7dd6715a90 | 7282:ad243bc63184 |
---|---|
8 | 8 |
9 #define FAIM_INTERNAL | 9 #define FAIM_INTERNAL |
10 #include <aim.h> | 10 #include <aim.h> |
11 | 11 |
12 #include "md5.h" | 12 #include "md5.h" |
13 | |
14 #include <ctype.h> | |
13 | 15 |
14 /** | 16 /** |
15 * Encode a password using old XOR method | 17 * Encode a password using old XOR method |
16 * | 18 * |
17 * This takes a const pointer to a (null terminated) string | 19 * This takes a const pointer to a (null terminated) string |
219 aim_snacid_t snacid; | 221 aim_snacid_t snacid; |
220 | 222 |
221 if (!ci || !sn || !password) | 223 if (!ci || !sn || !password) |
222 return -EINVAL; | 224 return -EINVAL; |
223 | 225 |
224 /* | 226 /* If we're signing on an ICQ account then use the older, XOR login method */ |
225 * What the XORLOGIN flag _really_ means is that its an ICQ login, | 227 if (isdigit(sn[0])) |
226 * which is really stupid and painful, so its not done here. | |
227 */ | |
228 if (sess->flags & AIM_SESS_FLAGS_XORLOGIN) | |
229 return goddamnicq2(sess, conn, sn, password, ci); | 228 return goddamnicq2(sess, conn, sn, password, ci); |
230 | 229 |
231 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152))) | 230 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 1152))) |
232 return -ENOMEM; | 231 return -ENOMEM; |
233 | 232 |
441 static int goddamnicq(aim_session_t *sess, aim_conn_t *conn, const char *sn) | 440 static int goddamnicq(aim_session_t *sess, aim_conn_t *conn, const char *sn) |
442 { | 441 { |
443 aim_frame_t fr; | 442 aim_frame_t fr; |
444 aim_rxcallback_t userfunc; | 443 aim_rxcallback_t userfunc; |
445 | 444 |
446 sess->flags &= ~AIM_SESS_FLAGS_SNACLOGIN; | |
447 sess->flags |= AIM_SESS_FLAGS_XORLOGIN; | |
448 | |
449 fr.conn = conn; | 445 fr.conn = conn; |
450 | 446 |
451 if ((userfunc = aim_callhandler(sess, conn, 0x0017, 0x0007))) | 447 if ((userfunc = aim_callhandler(sess, conn, 0x0017, 0x0007))) |
452 userfunc(sess, &fr, ""); | 448 userfunc(sess, &fr, ""); |
453 | 449 |
473 if (!sess || !conn || !sn) | 469 if (!sess || !conn || !sn) |
474 return -EINVAL; | 470 return -EINVAL; |
475 | 471 |
476 if ((sn[0] >= '0') && (sn[0] <= '9')) | 472 if ((sn[0] >= '0') && (sn[0] <= '9')) |
477 return goddamnicq(sess, conn, sn); | 473 return goddamnicq(sess, conn, sn); |
478 | |
479 sess->flags |= AIM_SESS_FLAGS_SNACLOGIN; | |
480 | 474 |
481 aim_sendflapver(sess, conn); | 475 aim_sendflapver(sess, conn); |
482 | 476 |
483 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2+2+strlen(sn) /*+8*/ ))) | 477 if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_FLAP, 0x02, 10+2+2+strlen(sn) /*+8*/ ))) |
484 return -ENOMEM; | 478 return -ENOMEM; |