annotate libfaim/auth.c @ 1578:5e60cfb67ab6

[gaim-migrate @ 1588] whoops. this should be good for a few fixes. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 15 Mar 2001 15:17:22 +0000
parents 1e2cc8c8bf3c
children 3fe5799b7823
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1535
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 aim_auth.c
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 Deals with the authorizer.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 #define FAIM_INTERNAL
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 #include <aim.h>
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11 /* this just pushes the passed cookie onto the passed connection -- NO SNAC! */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 faim_export int aim_auth_sendcookie(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13 struct aim_conn_t *conn,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 unsigned char *chipsahoy)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 struct command_tx_struct *newpacket;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 int curbyte=0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0001, 4+2+2+AIM_COOKIELEN)))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 return -1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 newpacket->lock = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0000);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0006);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 curbyte += aimutil_put16(newpacket->data+curbyte, AIM_COOKIELEN);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 memcpy(newpacket->data+curbyte, chipsahoy, AIM_COOKIELEN);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30 return aim_tx_enqueue(sess, newpacket);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33 faim_export unsigned long aim_auth_clientready(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 struct aim_conn_t *conn)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 struct aim_tool_version tools[] = {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37 {0x0001, 0x0003, AIM_TOOL_NEWWIN, 0x0361},
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 {0x0007, 0x0001, AIM_TOOL_NEWWIN, 0x0361},
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 };
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 int i,j;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41 struct command_tx_struct *newpacket;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 int toolcount = sizeof(tools)/sizeof(struct aim_tool_version);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 1152)))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 return -1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 newpacket->lock = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 i = aim_putsnac(newpacket->data, 0x0001, 0x0002, 0x0000, sess->snac_nextid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52 for (j = 0; j < toolcount; j++) {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 i += aimutil_put16(newpacket->data+i, tools[j].group);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 i += aimutil_put16(newpacket->data+i, tools[j].version);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 i += aimutil_put16(newpacket->data+i, tools[j].tool);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 i += aimutil_put16(newpacket->data+i, tools[j].toolversion);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 newpacket->commandlen = i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 newpacket->lock = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 aim_tx_enqueue(sess, newpacket);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 return sess->snac_nextid;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 faim_export unsigned long aim_auth_changepasswd(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68 struct aim_conn_t *conn,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 char *new, char *current)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 struct command_tx_struct *newpacket;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72 int i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 10+4+strlen(current)+4+strlen(new))))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 return -1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 newpacket->lock = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 i = aim_putsnac(newpacket->data, 0x0007, 0x0004, 0x0000, sess->snac_nextid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 aim_cachesnac(sess, 0x0007, 0x0004, 0x0000, NULL, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 /* new password TLV t(0002) */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(new), new);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 /* current password TLV t(0012) */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 i += aim_puttlv_str(newpacket->data+i, 0x0012, strlen(current), current);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88 aim_tx_enqueue(sess, newpacket);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 return sess->snac_nextid;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 faim_export unsigned long aim_auth_setversions(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94 struct aim_conn_t *conn)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
96 struct command_tx_struct *newpacket;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
97 int i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 10 + (4*2))))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100 return -1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102 newpacket->lock = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 i = aim_putsnac(newpacket->data, 0x0001, 0x0017, 0x0000, sess->snac_nextid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
105 aim_cachesnac(sess, 0x0001, 0x0017, 0x0000, NULL, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
106
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107 i += aimutil_put16(newpacket->data+i, 0x0001);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 i += aimutil_put16(newpacket->data+i, 0x0003);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110 i += aimutil_put16(newpacket->data+i, 0x0007);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
111 i += aimutil_put16(newpacket->data+i, 0x0001);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
112
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
113 newpacket->commandlen = i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114 newpacket->lock = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115 aim_tx_enqueue(sess, newpacket);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117 return sess->snac_nextid;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
118 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 * Request account confirmation.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123 * This will cause an email to be sent to the address associated with
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
124 * the account. By following the instructions in the mail, you can
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
125 * get the TRIAL flag removed from your account.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
126 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
127 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
128 faim_export unsigned long aim_auth_reqconfirm(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
129 struct aim_conn_t *conn)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131 return aim_genericreq_n(sess, conn, 0x0007, 0x0006);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
132 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
133
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 /*
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135 * Request a bit of account info.
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137 * The only known valid tag is 0x0011 (email address).
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138 *
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139 */
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
140 faim_export unsigned long aim_auth_getinfo(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141 struct aim_conn_t *conn,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142 unsigned short info)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 struct command_tx_struct *newpacket;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145 int i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
146
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 10 + 4)))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148 return -1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
149
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
150 newpacket->lock = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
151
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
152 i = aim_putsnac(newpacket->data, 0x0007, 0x0002, 0x0000, sess->snac_nextid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
153 aim_cachesnac(sess, 0x0002, 0x0002, 0x0000, NULL, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155 i += aimutil_put16(newpacket->data+i, info);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 i += aimutil_put16(newpacket->data+i, 0x0000);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
157
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
158 newpacket->commandlen = i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
159 newpacket->lock = 0;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
160 aim_tx_enqueue(sess, newpacket);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
161
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
162 return sess->snac_nextid;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 }
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
165 faim_export unsigned long aim_auth_setemail(struct aim_session_t *sess,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
166 struct aim_conn_t *conn,
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167 char *newemail)
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
168 {
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
169 struct command_tx_struct *newpacket;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
170 int i;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
171
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
172 if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 10+2+2+strlen(newemail))))
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
173 return -1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
174
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
175 newpacket->lock = 1;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
176
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
177 i = aim_putsnac(newpacket->data, 0x0007, 0x0004, 0x0000, sess->snac_nextid);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
178 aim_cachesnac(sess, 0x0007, 0x0004, 0x0000, NULL, 0);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
179
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
180 i += aim_puttlv_str(newpacket->data+i, 0x0011, strlen(newemail), newemail);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
181
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
182 aim_tx_enqueue(sess, newpacket);
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
183
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
184 return sess->snac_nextid;
1e2cc8c8bf3c [gaim-migrate @ 1545]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
185 }