Mercurial > pidgin.yaz
annotate libfaim/aim_auth.c @ 1256:b2f63d1a989b
[gaim-migrate @ 1266]
dont --enable-debug! hehe j/k
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 14 Dec 2000 01:54:16 +0000 |
parents | 920c86b753d7 |
children |
rev | line source |
---|---|
2 | 1 /* |
2 aim_auth.c | |
3 | |
4 Deals with the authorizer. | |
5 | |
6 */ | |
7 | |
283
0f14e6d8a51b
[gaim-migrate @ 293]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
237
diff
changeset
|
8 #include <faim/aim.h> |
2 | 9 |
10 /* this just pushes the passed cookie onto the passed connection -- NO SNAC! */ | |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
11 faim_export int aim_auth_sendcookie(struct aim_session_t *sess, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
12 struct aim_conn_t *conn, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
13 unsigned char *chipsahoy) |
2 | 14 { |
237 | 15 struct command_tx_struct *newpacket; |
2 | 16 int curbyte=0; |
17 | |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
18 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0001, conn, 4+2+2+AIM_COOKIELEN))) |
237 | 19 return -1; |
2 | 20 |
237 | 21 newpacket->lock = 1; |
2 | 22 |
237 | 23 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0000); |
24 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001); | |
25 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0006); | |
26 curbyte += aimutil_put16(newpacket->data+curbyte, AIM_COOKIELEN); | |
27 memcpy(newpacket->data+curbyte, chipsahoy, AIM_COOKIELEN); | |
2 | 28 |
237 | 29 return aim_tx_enqueue(sess, newpacket); |
2 | 30 } |
31 | |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
32 faim_export unsigned long aim_auth_clientready(struct aim_session_t *sess, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
33 struct aim_conn_t *conn) |
2 | 34 { |
237 | 35 struct command_tx_struct *newpacket; |
2 | 36 int curbyte = 0; |
37 | |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
38 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 26))) |
237 | 39 return -1; |
2 | 40 |
237 | 41 newpacket->lock = 1; |
2 | 42 |
237 | 43 curbyte += aim_putsnac(newpacket->data+curbyte, 0x0001, 0x0002, 0x0000, sess->snac_nextid); |
44 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001); | |
45 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0002); | |
46 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001); | |
47 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0013); | |
48 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0007); | |
49 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001); | |
50 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001); | |
51 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001); | |
2 | 52 |
237 | 53 aim_tx_enqueue(sess, newpacket); |
2 | 54 |
1248
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
55 aim_cachesnac(sess, 0x0001, 0x0004, 0x0000, NULL, 0); |
2 | 56 |
1248
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
57 return sess->snac_nextid; |
2 | 58 } |
59 | |
840
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
60 faim_export unsigned long aim_auth_changepasswd(struct aim_session_t *sess, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
61 struct aim_conn_t *conn, |
595ac7759563
[gaim-migrate @ 850]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
445
diff
changeset
|
62 char *new, char *current) |
2 | 63 { |
237 | 64 struct command_tx_struct *newpacket; |
2 | 65 int i; |
66 | |
445
e4c34ca88d9b
[gaim-migrate @ 455]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
283
diff
changeset
|
67 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+4+strlen(current)+4+strlen(new)))) |
237 | 68 return -1; |
2 | 69 |
237 | 70 newpacket->lock = 1; |
2 | 71 |
237 | 72 i = aim_putsnac(newpacket->data, 0x0007, 0x0004, 0x0000, sess->snac_nextid); |
2 | 73 |
74 /* current password TLV t(0002) */ | |
237 | 75 i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(current), current); |
2 | 76 |
77 /* new password TLV t(0012) */ | |
237 | 78 i += aim_puttlv_str(newpacket->data+i, 0x0012, strlen(new), new); |
2 | 79 |
237 | 80 aim_tx_enqueue(sess, newpacket); |
2 | 81 |
1248
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
82 aim_cachesnac(sess, 0x0001, 0x0004, 0x0000, NULL, 0); |
2 | 83 |
1248
920c86b753d7
[gaim-migrate @ 1258]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
840
diff
changeset
|
84 return sess->snac_nextid; |
2 | 85 } |