4 Deals with the authorizer.
11 /* this just pushes the passed cookie onto the passed connection -- NO SNAC! */
12 faim_export int aim_auth_sendcookie(struct aim_session_t *sess,
13 struct aim_conn_t *conn,
14 unsigned char *chipsahoy)
16 struct command_tx_struct *newpacket;
19 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0001, conn, 4+2+2+AIM_COOKIELEN)))
24 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0000);
25 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001);
26 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0006);
27 curbyte += aimutil_put16(newpacket->data+curbyte, AIM_COOKIELEN);
28 memcpy(newpacket->data+curbyte, chipsahoy, AIM_COOKIELEN);
30 return aim_tx_enqueue(sess, newpacket);
33 faim_export unsigned long aim_auth_clientready(struct aim_session_t *sess,
34 struct aim_conn_t *conn)
36 struct command_tx_struct *newpacket;
39 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 26)))
44 curbyte += aim_putsnac(newpacket->data+curbyte, 0x0001, 0x0002, 0x0000, sess->snac_nextid);
45 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001);
46 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0002);
47 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001);
48 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0013);
49 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0007);
50 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001);
51 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001);
52 curbyte += aimutil_put16(newpacket->data+curbyte, 0x0001);
54 aim_tx_enqueue(sess, newpacket);
56 aim_cachesnac(sess, 0x0001, 0x0004, 0x0000, NULL, 0);
58 return sess->snac_nextid;
61 faim_export unsigned long aim_auth_changepasswd(struct aim_session_t *sess,
62 struct aim_conn_t *conn,
63 char *new, char *current)
65 struct command_tx_struct *newpacket;
68 if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+4+strlen(current)+4+strlen(new))))
73 i = aim_putsnac(newpacket->data, 0x0007, 0x0004, 0x0000, sess->snac_nextid);
75 /* current password TLV t(0002) */
76 i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(current), current);
78 /* new password TLV t(0012) */
79 i += aim_puttlv_str(newpacket->data+i, 0x0012, strlen(new), new);
81 aim_tx_enqueue(sess, newpacket);
83 aim_cachesnac(sess, 0x0001, 0x0004, 0x0000, NULL, 0);
85 return sess->snac_nextid;