Wed, 03 Jul 2013 22:18:55 +0530
Renamed PurpleBlistNode to PurpleBListNode
| 13235 | 1 | /* |
| 15884 | 2 | * Purple's oscar protocol plugin |
| 13235 | 3 | * This file is the legal property of its developers. |
| 4 | * Please see the AUTHORS file distributed alongside this file. | |
| 5 | * | |
| 6 | * This library is free software; you can redistribute it and/or | |
| 7 | * modify it under the terms of the GNU Lesser General Public | |
| 8 | * License as published by the Free Software Foundation; either | |
| 9 | * version 2 of the License, or (at your option) any later version. | |
| 10 | * | |
| 11 | * This library is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | * Lesser General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU Lesser General Public | |
| 17 | * License along with this library; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19820
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 13235 | 19 | */ |
| 20 | ||
| 21 | /* | |
| 22 | * Family 0x0017 - Authentication. | |
| 23 | * | |
| 24 | * Deals with the authorizer for SNAC-based login, and also old-style | |
| 25 | * non-SNAC login. | |
| 26 | * | |
| 27 | */ | |
| 28 | ||
|
29106
51c7b2177e42
Fix all the remaining files for which internal.h doesn't end up being the first include.
Paul Aurich <darkrain42@pidgin.im>
parents:
28520
diff
changeset
|
29 | #include "oscar.h" |
|
32978
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
30 | #include "oscarcommon.h" |
|
29106
51c7b2177e42
Fix all the remaining files for which internal.h doesn't end up being the first include.
Paul Aurich <darkrain42@pidgin.im>
parents:
28520
diff
changeset
|
31 | |
|
27381
e2a0ae2ee7f0
Shuffle this order around for no real reason other than that I prefer it this way
Mark Doliner <markdoliner@pidgin.im>
parents:
27325
diff
changeset
|
32 | #include <ctype.h> |
| 13235 | 33 | |
|
34567
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
34 | #include "ciphers/md5hash.h" |
| 13235 | 35 | |
|
24670
84014b07aa10
Patch from 'db42' to enable MD5 auth on ICQ. Refs #4449. Before I merge
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
23526
diff
changeset
|
36 | /* #define USE_XOR_FOR_ICQ */ |
| 13235 | 37 | |
| 38 | #ifdef USE_XOR_FOR_ICQ | |
| 39 | /** | |
| 40 | * Encode a password using old XOR method | |
| 41 | * | |
| 42 | * This takes a const pointer to a (null terminated) string | |
| 43 | * containing the unencoded password. It also gets passed | |
| 44 | * an already allocated buffer to store the encoded password. | |
| 45 | * This buffer should be the exact length of the password without | |
| 46 | * the null. The encoded password buffer /is not %NULL terminated/. | |
| 47 | * | |
| 48 | * The encoding_table seems to be a fixed set of values. We'll | |
| 49 | * hope it doesn't change over time! | |
| 50 | * | |
| 51 | * This is only used for the XOR method, not the better MD5 method. | |
| 52 | * | |
| 53 | * @param password Incoming password. | |
| 54 | * @param encoded Buffer to put encoded password. | |
| 55 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
56 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
57 | aim_encode_password(const char *password, guint8 *encoded) |
| 13235 | 58 | { |
| 59 | guint8 encoding_table[] = { | |
| 60 | 0xf3, 0x26, 0x81, 0xc4, | |
| 61 | 0x39, 0x86, 0xdb, 0x92, | |
| 62 | 0x71, 0xa3, 0xb9, 0xe6, | |
| 63 | 0x53, 0x7a, 0x95, 0x7c | |
| 64 | }; | |
| 65 | unsigned int i; | |
| 66 | ||
| 67 | for (i = 0; i < strlen(password); i++) | |
| 68 | encoded[i] = (password[i] ^ encoding_table[i]); | |
| 69 | ||
| 70 | return 0; | |
| 71 | } | |
| 72 | #endif | |
| 73 | ||
| 74 | #ifdef USE_OLD_MD5 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
75 | static int |
|
17279
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
76 | aim_encode_password_md5(const char *password, size_t password_len, const char *key, guint8 *digest) |
| 13235 | 77 | { |
|
34567
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
78 | PurpleHash *hash; |
| 13235 | 79 | |
|
34567
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
80 | hash = purple_md5_hash_new(); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
81 | purple_hash_append(hash, (const guchar *)key, strlen(key)); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
82 | purple_hash_append(hash, (const guchar *)password, password_len); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
83 | purple_hash_append(hash, (const guchar *)AIM_MD5_STRING, strlen(AIM_MD5_STRING)); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
84 | purple_hash_digest(hash, 16, digest, NULL); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
85 | g_object_unref(hash); |
| 13235 | 86 | |
| 87 | return 0; | |
| 88 | } | |
| 89 | #else | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
90 | static int |
|
17279
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
91 | aim_encode_password_md5(const char *password, size_t password_len, const char *key, guint8 *digest) |
| 13235 | 92 | { |
|
34567
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
93 | PurpleHash *hash; |
| 13235 | 94 | guchar passdigest[16]; |
| 95 | ||
|
34567
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
96 | hash = purple_md5_hash_new(); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
97 | purple_hash_append(hash, (const guchar *)password, password_len); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
98 | purple_hash_digest(hash, passdigest, sizeof(passdigest)); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
99 | purple_hash_reset(hash); |
| 13235 | 100 | |
|
34567
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
101 | purple_hash_append(hash, (const guchar *)key, strlen(key)); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
102 | purple_hash_append(hash, passdigest, 16); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
103 | purple_hash_append(hash, (const guchar *)AIM_MD5_STRING, strlen(AIM_MD5_STRING)); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
104 | purple_hash_digest(hash, digest, 16); |
|
ea5103f66b0e
Refactor the codebase to use PurpleHash
Ankit Vani <a@nevitus.org>
parents:
34557
diff
changeset
|
105 | g_object_unref(hash); |
| 13235 | 106 | |
| 107 | return 0; | |
| 108 | } | |
| 109 | #endif | |
| 110 | ||
| 111 | #ifdef USE_XOR_FOR_ICQ | |
| 112 | /* | |
| 113 | * Part two of the ICQ hack. Note the ignoring of the key. | |
| 114 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
115 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
116 | goddamnicq2(OscarData *od, FlapConnection *conn, const char *sn, const char *password, ClientInfo *ci) |
| 13235 | 117 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
118 | FlapFrame *frame; |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
119 | GSList *tlvlist = NULL; |
| 13235 | 120 | int passwdlen; |
| 121 | guint8 *password_encoded; | |
|
27325
efe14a748826
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <markdoliner@pidgin.im>
parents:
25889
diff
changeset
|
122 | guint32 distrib; |
| 13235 | 123 | |
| 124 | passwdlen = strlen(password); | |
|
17280
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
125 | password_encoded = (guint8 *)g_malloc(passwdlen+1); |
| 13235 | 126 | if (passwdlen > MAXICQPASSLEN) |
| 127 | passwdlen = MAXICQPASSLEN; | |
| 128 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
129 | frame = flap_frame_new(od, 0x01, 1152); |
| 13235 | 130 | |
| 131 | aim_encode_password(password, password_encoded); | |
| 132 | ||
|
27687
f46b6b5c25e1
Use the ui_info hash table instead of prefs when passing the clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27381
diff
changeset
|
133 | distrib = oscar_get_ui_info_int( |
|
f46b6b5c25e1
Use the ui_info hash table instead of prefs when passing the clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27381
diff
changeset
|
134 | od->icq ? "prpl-icq-distid" : "prpl-aim-distid", |
|
f46b6b5c25e1
Use the ui_info hash table instead of prefs when passing the clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27381
diff
changeset
|
135 | ci->distrib); |
|
27325
efe14a748826
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <markdoliner@pidgin.im>
parents:
25889
diff
changeset
|
136 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
137 | byte_stream_put32(&frame->data, 0x00000001); /* FLAP Version */ |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
138 | aim_tlvlist_add_str(&tlvlist, 0x0001, sn); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
139 | aim_tlvlist_add_raw(&tlvlist, 0x0002, passwdlen, password_encoded); |
| 13235 | 140 | |
|
27688
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
141 | if (ci->clientstring != NULL) |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
142 | aim_tlvlist_add_str(&tlvlist, 0x0003, ci->clientstring); |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
143 | else { |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
144 | gchar *clientstring = oscar_get_clientstring(); |
|
27325
efe14a748826
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <markdoliner@pidgin.im>
parents:
25889
diff
changeset
|
145 | aim_tlvlist_add_str(&tlvlist, 0x0003, clientstring); |
|
27688
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
146 | g_free(clientstring); |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
147 | } |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
148 | aim_tlvlist_add_16(&tlvlist, 0x0016, (guint16)ci->clientid); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
149 | aim_tlvlist_add_16(&tlvlist, 0x0017, (guint16)ci->major); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
150 | aim_tlvlist_add_16(&tlvlist, 0x0018, (guint16)ci->minor); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
151 | aim_tlvlist_add_16(&tlvlist, 0x0019, (guint16)ci->point); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
152 | aim_tlvlist_add_16(&tlvlist, 0x001a, (guint16)ci->build); |
|
27325
efe14a748826
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <markdoliner@pidgin.im>
parents:
25889
diff
changeset
|
153 | aim_tlvlist_add_32(&tlvlist, 0x0014, distrib); /* distribution chan */ |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
154 | aim_tlvlist_add_str(&tlvlist, 0x000f, ci->lang); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
155 | aim_tlvlist_add_str(&tlvlist, 0x000e, ci->country); |
| 13235 | 156 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
157 | aim_tlvlist_write(&frame->data, &tlvlist); |
| 13235 | 158 | |
|
17280
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
159 | g_free(password_encoded); |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
160 | aim_tlvlist_free(tlvlist); |
| 13235 | 161 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
162 | flap_connection_send(conn, frame); |
| 13235 | 163 | |
| 164 | return 0; | |
| 165 | } | |
| 166 | #endif | |
| 167 | ||
| 168 | /* | |
| 169 | * Subtype 0x0002 | |
| 170 | * | |
| 171 | * This is the initial login request packet. | |
| 172 | * | |
| 173 | * NOTE!! If you want/need to make use of the aim_sendmemblock() function, | |
| 174 | * then the client information you send here must exactly match the | |
| 175 | * executable that you're pulling the data from. | |
| 176 | * | |
| 177 | * Java AIM 1.1.19: | |
| 178 | * clientstring = "AOL Instant Messenger (TM) version 1.1.19 for Java built 03/24/98, freeMem 215871 totalMem 1048567, i686, Linus, #2 SMP Sun Feb 11 03:41:17 UTC 2001 2.4.1-ac9, IBM Corporation, 1.1.8, 45.3, Tue Mar 27 12:09:17 PST 2001" | |
| 179 | * clientid = 0x0001 | |
| 180 | * major = 0x0001 | |
| 181 | * minor = 0x0001 | |
| 182 | * point = (not sent) | |
| 183 | * build = 0x0013 | |
| 184 | * unknown= (not sent) | |
|
13240
db5187cc40d1
[gaim-migrate @ 15605]
Mark Doliner <markdoliner@pidgin.im>
parents:
13235
diff
changeset
|
185 | * |
| 13235 | 186 | * AIM for Linux 1.1.112: |
| 187 | * clientstring = "AOL Instant Messenger (SM)" | |
| 188 | * clientid = 0x1d09 | |
| 189 | * major = 0x0001 | |
| 190 | * minor = 0x0001 | |
| 191 | * point = 0x0001 | |
| 192 | * build = 0x0070 | |
| 193 | * unknown= 0x0000008b | |
| 194 | * serverstore = 0x01 | |
| 195 | * | |
|
22127
307a72c99f1c
Minor comment changes
Mark Doliner <markdoliner@pidgin.im>
parents:
20140
diff
changeset
|
196 | * @param truncate_pass Truncate the password to 8 characters. This |
|
307a72c99f1c
Minor comment changes
Mark Doliner <markdoliner@pidgin.im>
parents:
20140
diff
changeset
|
197 | * usually happens for AOL accounts. We are told that we |
|
307a72c99f1c
Minor comment changes
Mark Doliner <markdoliner@pidgin.im>
parents:
20140
diff
changeset
|
198 | * should truncate it if the 0x0017/0x0007 SNAC contains |
|
307a72c99f1c
Minor comment changes
Mark Doliner <markdoliner@pidgin.im>
parents:
20140
diff
changeset
|
199 | * a TLV of type 0x0026 with data 0x0000. |
|
23454
d8721c84f49c
Added paramater to aim_send_login() to allow control over whether we want
Evan Schoenberg <evands@pidgin.im>
parents:
22127
diff
changeset
|
200 | * @param allow_multiple_logins Allow multiple logins? If TRUE, the AIM |
|
d8721c84f49c
Added paramater to aim_send_login() to allow control over whether we want
Evan Schoenberg <evands@pidgin.im>
parents:
22127
diff
changeset
|
201 | * server will prompt the user when multiple logins occur. If |
|
d8721c84f49c
Added paramater to aim_send_login() to allow control over whether we want
Evan Schoenberg <evands@pidgin.im>
parents:
22127
diff
changeset
|
202 | * FALSE, existing connections (on other clients) will be |
|
d8721c84f49c
Added paramater to aim_send_login() to allow control over whether we want
Evan Schoenberg <evands@pidgin.im>
parents:
22127
diff
changeset
|
203 | * disconnected automatically as we connect. |
| 13235 | 204 | */ |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
205 | int |
|
23454
d8721c84f49c
Added paramater to aim_send_login() to allow control over whether we want
Evan Schoenberg <evands@pidgin.im>
parents:
22127
diff
changeset
|
206 | aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key, gboolean allow_multiple_logins) |
| 13235 | 207 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
208 | FlapFrame *frame; |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
209 | GSList *tlvlist = NULL; |
| 13235 | 210 | guint8 digest[16]; |
| 211 | aim_snacid_t snacid; | |
|
17279
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
212 | size_t password_len; |
|
27325
efe14a748826
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <markdoliner@pidgin.im>
parents:
25889
diff
changeset
|
213 | guint32 distrib; |
| 13235 | 214 | |
| 215 | if (!ci || !sn || !password) | |
| 216 | return -EINVAL; | |
| 217 | ||
| 218 | #ifdef USE_XOR_FOR_ICQ | |
| 219 | /* If we're signing on an ICQ account then use the older, XOR login method */ | |
|
19820
0f82885da3d8
A little function name shuffling.
Mark Doliner <markdoliner@pidgin.im>
parents:
18341
diff
changeset
|
220 | if (aim_snvalid_icq(sn)) |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
221 | return goddamnicq2(od, conn, sn, password, ci); |
| 13235 | 222 | #endif |
| 223 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
224 | frame = flap_frame_new(od, 0x02, 1152); |
| 13235 | 225 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23454
diff
changeset
|
226 | snacid = aim_cachesnac(od, SNAC_FAMILY_AUTH, 0x0002, 0x0000, NULL, 0); |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30665
diff
changeset
|
227 | aim_putsnac(&frame->data, SNAC_FAMILY_AUTH, 0x0002, snacid); |
| 13235 | 228 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
229 | aim_tlvlist_add_str(&tlvlist, 0x0001, sn); |
| 13235 | 230 | |
|
17279
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
231 | /* Truncate ICQ and AOL passwords, if necessary */ |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
232 | password_len = strlen(password); |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25152
diff
changeset
|
233 | if (oscar_util_valid_name_icq(sn) && (password_len > MAXICQPASSLEN)) |
|
17279
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
234 | password_len = MAXICQPASSLEN; |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
235 | else if (truncate_pass && password_len > 8) |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
236 | password_len = 8; |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
237 | |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
238 | aim_encode_password_md5(password, password_len, key, digest); |
| 13235 | 239 | |
|
27687
f46b6b5c25e1
Use the ui_info hash table instead of prefs when passing the clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27381
diff
changeset
|
240 | distrib = oscar_get_ui_info_int( |
|
f46b6b5c25e1
Use the ui_info hash table instead of prefs when passing the clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27381
diff
changeset
|
241 | od->icq ? "prpl-icq-distid" : "prpl-aim-distid", |
|
f46b6b5c25e1
Use the ui_info hash table instead of prefs when passing the clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27381
diff
changeset
|
242 | ci->distrib); |
|
27325
efe14a748826
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <markdoliner@pidgin.im>
parents:
25889
diff
changeset
|
243 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
244 | aim_tlvlist_add_raw(&tlvlist, 0x0025, 16, digest); |
| 13235 | 245 | |
| 246 | #ifndef USE_OLD_MD5 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
247 | aim_tlvlist_add_noval(&tlvlist, 0x004c); |
| 13235 | 248 | #endif |
| 249 | ||
|
27688
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
250 | if (ci->clientstring != NULL) |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
251 | aim_tlvlist_add_str(&tlvlist, 0x0003, ci->clientstring); |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
252 | else { |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
253 | gchar *clientstring = oscar_get_clientstring(); |
|
27325
efe14a748826
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <markdoliner@pidgin.im>
parents:
25889
diff
changeset
|
254 | aim_tlvlist_add_str(&tlvlist, 0x0003, clientstring); |
|
27688
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
255 | g_free(clientstring); |
|
8c89470bfe9d
Oh, we don't need a special ui_info field for the AIM clientstring
Mark Doliner <markdoliner@pidgin.im>
parents:
27687
diff
changeset
|
256 | } |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
257 | aim_tlvlist_add_16(&tlvlist, 0x0016, (guint16)ci->clientid); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
258 | aim_tlvlist_add_16(&tlvlist, 0x0017, (guint16)ci->major); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
259 | aim_tlvlist_add_16(&tlvlist, 0x0018, (guint16)ci->minor); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
260 | aim_tlvlist_add_16(&tlvlist, 0x0019, (guint16)ci->point); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
261 | aim_tlvlist_add_16(&tlvlist, 0x001a, (guint16)ci->build); |
|
27325
efe14a748826
Check in a change requested by Gregory Cypes from AOL. They want clients
Mark Doliner <markdoliner@pidgin.im>
parents:
25889
diff
changeset
|
262 | aim_tlvlist_add_32(&tlvlist, 0x0014, distrib); |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
263 | aim_tlvlist_add_str(&tlvlist, 0x000f, ci->lang); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
264 | aim_tlvlist_add_str(&tlvlist, 0x000e, ci->country); |
| 13235 | 265 | |
| 266 | /* | |
| 267 | * If set, old-fashioned buddy lists will not work. You will need | |
| 268 | * to use SSI. | |
| 269 | */ | |
|
28520
d8964d76432a
These should actually be 0x03, I think. I think it's a bitmask where
Mark Doliner <markdoliner@pidgin.im>
parents:
27688
diff
changeset
|
270 | aim_tlvlist_add_8(&tlvlist, 0x004a, (allow_multiple_logins ? 0x01 : 0x03)); |
| 13235 | 271 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
272 | aim_tlvlist_write(&frame->data, &tlvlist); |
| 13235 | 273 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
274 | aim_tlvlist_free(tlvlist); |
| 13235 | 275 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
276 | flap_connection_send(conn, frame); |
| 13235 | 277 | |
| 278 | return 0; | |
| 279 | } | |
| 280 | ||
| 281 | /* | |
| 282 | * This is sent back as a general response to the login command. | |
| 283 | * It can be either an error or a success, depending on the | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
284 | * presence of certain TLVs. |
| 13235 | 285 | * |
| 286 | * The client should check the value passed as errorcode. If | |
| 287 | * its nonzero, there was an error. | |
| 288 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
289 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
290 | parse(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 291 | { |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
292 | GSList *tlvlist; |
| 13235 | 293 | aim_rxcallback_t userfunc; |
| 294 | struct aim_authresp_info *info; | |
| 295 | int ret = 0; | |
| 296 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
297 | info = g_new0(struct aim_authresp_info, 1); |
| 13235 | 298 | |
| 299 | /* | |
| 300 | * Read block of TLVs. All further data is derived | |
| 301 | * from what is parsed here. | |
| 302 | */ | |
| 303 | tlvlist = aim_tlvlist_read(bs); | |
| 304 | ||
| 305 | /* | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25152
diff
changeset
|
306 | * No matter what, we should have a username. |
| 13235 | 307 | */ |
| 308 | if (aim_tlv_gettlv(tlvlist, 0x0001, 1)) { | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25152
diff
changeset
|
309 | info->bn = aim_tlv_getstr(tlvlist, 0x0001, 1); |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25152
diff
changeset
|
310 | purple_connection_set_display_name(od->gc, info->bn); |
| 13235 | 311 | } |
| 312 | ||
| 313 | /* | |
| 314 | * Check for an error code. If so, we should also | |
| 315 | * have an error url. | |
| 316 | */ | |
| 317 | if (aim_tlv_gettlv(tlvlist, 0x0008, 1)) | |
| 318 | info->errorcode = aim_tlv_get16(tlvlist, 0x0008, 1); | |
| 319 | if (aim_tlv_gettlv(tlvlist, 0x0004, 1)) | |
| 320 | info->errorurl = aim_tlv_getstr(tlvlist, 0x0004, 1); | |
| 321 | ||
| 322 | /* | |
| 323 | * BOS server address. | |
| 324 | */ | |
| 325 | if (aim_tlv_gettlv(tlvlist, 0x0005, 1)) | |
| 326 | info->bosip = aim_tlv_getstr(tlvlist, 0x0005, 1); | |
| 327 | ||
| 328 | /* | |
| 329 | * Authorization cookie. | |
| 330 | */ | |
| 331 | if (aim_tlv_gettlv(tlvlist, 0x0006, 1)) { | |
| 332 | aim_tlv_t *tmptlv; | |
| 333 | ||
| 334 | tmptlv = aim_tlv_gettlv(tlvlist, 0x0006, 1); | |
|
13653
fab80366d565
[gaim-migrate @ 16053]
Mark Doliner <markdoliner@pidgin.im>
parents:
13593
diff
changeset
|
335 | if (tmptlv != NULL) |
|
fab80366d565
[gaim-migrate @ 16053]
Mark Doliner <markdoliner@pidgin.im>
parents:
13593
diff
changeset
|
336 | { |
|
fab80366d565
[gaim-migrate @ 16053]
Mark Doliner <markdoliner@pidgin.im>
parents:
13593
diff
changeset
|
337 | info->cookielen = tmptlv->length; |
|
fab80366d565
[gaim-migrate @ 16053]
Mark Doliner <markdoliner@pidgin.im>
parents:
13593
diff
changeset
|
338 | info->cookie = tmptlv->value; |
|
fab80366d565
[gaim-migrate @ 16053]
Mark Doliner <markdoliner@pidgin.im>
parents:
13593
diff
changeset
|
339 | } |
| 13235 | 340 | } |
| 341 | ||
| 342 | /* | |
| 343 | * The email address attached to this account | |
| 344 | * Not available for ICQ or @mac.com logins. | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
345 | * If you receive this TLV, then you are allowed to use |
| 13235 | 346 | * family 0x0018 to check the status of your email. |
| 347 | * XXX - Not really true! | |
| 348 | */ | |
| 349 | if (aim_tlv_gettlv(tlvlist, 0x0011, 1)) | |
| 350 | info->email = aim_tlv_getstr(tlvlist, 0x0011, 1); | |
| 351 | ||
| 352 | /* | |
| 353 | * The registration status. (Not real sure what it means.) | |
| 354 | * Not available for ICQ or @mac.com logins. | |
| 355 | * | |
| 356 | * 1 = No disclosure | |
| 357 | * 2 = Limited disclosure | |
| 358 | * 3 = Full disclosure | |
| 359 | * | |
| 360 | * This has to do with whether your email address is available | |
| 361 | * to other users or not. AFAIK, this feature is no longer used. | |
| 362 | * | |
| 363 | * Means you can use the admin family? (0x0007) | |
| 364 | * | |
| 365 | */ | |
| 366 | if (aim_tlv_gettlv(tlvlist, 0x0013, 1)) | |
| 367 | info->regstatus = aim_tlv_get16(tlvlist, 0x0013, 1); | |
| 368 | ||
| 369 | if (aim_tlv_gettlv(tlvlist, 0x0040, 1)) | |
| 370 | info->latestbeta.build = aim_tlv_get32(tlvlist, 0x0040, 1); | |
| 371 | if (aim_tlv_gettlv(tlvlist, 0x0041, 1)) | |
| 372 | info->latestbeta.url = aim_tlv_getstr(tlvlist, 0x0041, 1); | |
| 373 | if (aim_tlv_gettlv(tlvlist, 0x0042, 1)) | |
| 374 | info->latestbeta.info = aim_tlv_getstr(tlvlist, 0x0042, 1); | |
| 375 | if (aim_tlv_gettlv(tlvlist, 0x0043, 1)) | |
| 376 | info->latestbeta.name = aim_tlv_getstr(tlvlist, 0x0043, 1); | |
| 377 | ||
| 378 | if (aim_tlv_gettlv(tlvlist, 0x0044, 1)) | |
| 379 | info->latestrelease.build = aim_tlv_get32(tlvlist, 0x0044, 1); | |
| 380 | if (aim_tlv_gettlv(tlvlist, 0x0045, 1)) | |
| 381 | info->latestrelease.url = aim_tlv_getstr(tlvlist, 0x0045, 1); | |
| 382 | if (aim_tlv_gettlv(tlvlist, 0x0046, 1)) | |
| 383 | info->latestrelease.info = aim_tlv_getstr(tlvlist, 0x0046, 1); | |
| 384 | if (aim_tlv_gettlv(tlvlist, 0x0047, 1)) | |
| 385 | info->latestrelease.name = aim_tlv_getstr(tlvlist, 0x0047, 1); | |
| 386 | ||
| 387 | /* | |
| 388 | * URL to change password. | |
| 389 | */ | |
| 390 | if (aim_tlv_gettlv(tlvlist, 0x0054, 1)) | |
| 391 | info->chpassurl = aim_tlv_getstr(tlvlist, 0x0054, 1); | |
| 392 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
393 | od->authinfo = info; |
| 13235 | 394 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23454
diff
changeset
|
395 | if ((userfunc = aim_callhandler(od, snac ? snac->family : SNAC_FAMILY_AUTH, snac ? snac->subtype : 0x0003))) |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
396 | ret = userfunc(od, conn, frame, info); |
| 13235 | 397 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
398 | aim_tlvlist_free(tlvlist); |
| 13235 | 399 | |
| 400 | return ret; | |
| 401 | } | |
| 402 | ||
| 403 | #ifdef USE_XOR_FOR_ICQ | |
| 404 | /* | |
| 405 | * Subtype 0x0007 (kind of) - Send a fake type 0x0007 SNAC to the client | |
| 406 | * | |
| 407 | * This is a bit confusing. | |
| 408 | * | |
| 409 | * Normal SNAC login goes like this: | |
| 410 | * - connect | |
| 411 | * - server sends flap version | |
| 412 | * - client sends flap version | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25152
diff
changeset
|
413 | * - client sends username (17/6) |
| 13235 | 414 | * - server sends hash key (17/7) |
| 415 | * - client sends auth request (17/2 -- aim_send_login) | |
| 416 | * - server yells | |
| 417 | * | |
| 418 | * XOR login (for ICQ) goes like this: | |
| 419 | * - connect | |
| 420 | * - server sends flap version | |
| 421 | * - client sends auth request which contains flap version (aim_send_login) | |
| 422 | * - server yells | |
| 423 | * | |
| 424 | * For the client API, we make them implement the most complicated version, | |
| 425 | * and for the simpler version, we fake it and make it look like the more | |
| 426 | * complicated process. | |
| 427 | * | |
| 428 | * This is done by giving the client a faked key, just so we can convince | |
| 429 | * them to call aim_send_login right away, which will detect the session | |
| 430 | * flag that says this is XOR login and ignore the key, sending an ICQ | |
| 431 | * login request instead of the normal SNAC one. | |
| 432 | * | |
| 433 | * As soon as AOL makes ICQ log in the same way as AIM, this is /gone/. | |
| 434 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
435 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
436 | goddamnicq(OscarData *od, FlapConnection *conn, const char *sn) |
| 13235 | 437 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
438 | FlapFrame frame; |
| 13235 | 439 | aim_rxcallback_t userfunc; |
| 440 | ||
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23454
diff
changeset
|
441 | if ((userfunc = aim_callhandler(od, SNAC_FAMILY_AUTH, 0x0007))) |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
442 | userfunc(od, conn, &frame, ""); |
| 13235 | 443 | |
| 444 | return 0; | |
| 445 | } | |
| 446 | #endif | |
| 447 | ||
| 448 | /* | |
| 449 | * Subtype 0x0006 | |
| 450 | * | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
451 | * In AIM 3.5 protocol, the first stage of login is to request login from the |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25152
diff
changeset
|
452 | * Authorizer, passing it the username for verification. If the name is |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
453 | * invalid, a 0017/0003 is spit back, with the standard error contents. If |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
454 | * valid, a 0017/0007 comes back, which is the signal to send it the main |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
455 | * login command (0017/0002). |
| 13235 | 456 | * |
| 457 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
458 | int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
459 | aim_request_login(OscarData *od, FlapConnection *conn, const char *sn) |
| 13235 | 460 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
461 | FlapFrame *frame; |
| 13235 | 462 | aim_snacid_t snacid; |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
463 | GSList *tlvlist = NULL; |
| 13235 | 464 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
465 | if (!od || !conn || !sn) |
| 13235 | 466 | return -EINVAL; |
| 467 | ||
| 468 | #ifdef USE_XOR_FOR_ICQ | |
|
19820
0f82885da3d8
A little function name shuffling.
Mark Doliner <markdoliner@pidgin.im>
parents:
18341
diff
changeset
|
469 | if (aim_snvalid_icq(sn)) |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
470 | return goddamnicq(od, conn, sn); |
| 13235 | 471 | #endif |
| 472 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
473 | frame = flap_frame_new(od, 0x02, 10+2+2+strlen(sn)+8); |
| 13235 | 474 | |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23454
diff
changeset
|
475 | snacid = aim_cachesnac(od, SNAC_FAMILY_AUTH, 0x0006, 0x0000, NULL, 0); |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30665
diff
changeset
|
476 | aim_putsnac(&frame->data, SNAC_FAMILY_AUTH, 0x0006, snacid); |
| 13235 | 477 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
478 | aim_tlvlist_add_str(&tlvlist, 0x0001, sn); |
| 13235 | 479 | |
| 480 | /* Tell the server we support SecurID logins. */ | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
481 | aim_tlvlist_add_noval(&tlvlist, 0x004b); |
| 13235 | 482 | |
| 483 | /* Unknown. Sent in recent WinAIM clients.*/ | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
484 | aim_tlvlist_add_noval(&tlvlist, 0x005a); |
| 13235 | 485 | |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
486 | aim_tlvlist_write(&frame->data, &tlvlist); |
|
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
487 | aim_tlvlist_free(tlvlist); |
| 13235 | 488 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
489 | flap_connection_send(conn, frame); |
| 13235 | 490 | |
| 491 | return 0; | |
| 492 | } | |
| 493 | ||
| 494 | /* | |
| 495 | * Subtype 0x0007 | |
| 496 | * | |
| 497 | * Middle handler for 0017/0007 SNACs. Contains the auth key prefixed | |
| 498 | * by only its length in a two byte word. | |
| 499 | * | |
| 500 | * Calls the client, which should then use the value to call aim_send_login. | |
| 501 | * | |
| 502 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
503 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
504 | keyparse(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 505 | { |
|
32978
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
506 | int keylen; |
| 13235 | 507 | char *keystr; |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
508 | GSList *tlvlist; |
|
17279
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
509 | gboolean truncate_pass; |
|
32978
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
510 | PurpleConnection *gc; |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
511 | PurpleAccount *account; |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
512 | ClientInfo aiminfo = CLIENTINFO_PURPLE_AIM; |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
513 | ClientInfo icqinfo = CLIENTINFO_PURPLE_ICQ; |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
514 | |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
515 | gc = od->gc; |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
516 | account = purple_connection_get_account(gc); |
| 13235 | 517 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
518 | keylen = byte_stream_get16(bs); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
519 | keystr = byte_stream_getstr(bs, keylen); |
|
32978
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
520 | if (!g_utf8_validate(keystr, -1, NULL)) { |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
521 | purple_debug_warning("oscar", "Received SNAC %04hx/%04hx with " |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
522 | "invalid UTF-8 keystr.\n", snac->family, snac->subtype); |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
523 | purple_connection_error(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR, |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
524 | _("Received unexpected response from server")); |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
525 | g_free(keystr); |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
526 | return 1; |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
527 | } |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
528 | |
|
17279
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
529 | tlvlist = aim_tlvlist_read(bs); |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
530 | |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
531 | /* |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
532 | * If the truncate_pass TLV exists then we should truncate the |
|
22127
307a72c99f1c
Minor comment changes
Mark Doliner <markdoliner@pidgin.im>
parents:
20140
diff
changeset
|
533 | * user's password to 8 characters. This flag is sent to us |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25152
diff
changeset
|
534 | * when logging in with an AOL user's username. |
|
17279
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
535 | */ |
|
2a86b738c7a8
Fix signing on to AIM with an AOL screen name with a password of more
Mark Doliner <markdoliner@pidgin.im>
parents:
15884
diff
changeset
|
536 | truncate_pass = aim_tlv_gettlv(tlvlist, 0x0026, 1) != NULL; |
| 13235 | 537 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
538 | /* XXX - When GiantGrayPanda signed on AIM I got a thing asking me to register |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
539 | * for the netscape network. This SNAC had a type 0x0058 TLV with length 10. |
| 13235 | 540 | * Data is 0x0007 0004 3e19 ae1e 0006 0004 0000 0005 */ |
| 541 | ||
|
32978
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
542 | aim_send_login(od, conn, purple_account_get_username(account), |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
543 | purple_connection_get_password(gc), truncate_pass, |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
544 | od->icq ? &icqinfo : &aiminfo, keystr, |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
545 | purple_account_get_bool(account, "allow_multiple_logins", OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS)); |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
546 | |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
547 | purple_connection_update_progress(gc, |
|
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
548 | _("Password sent"), 2, OSCAR_CONNECT_STEPS); |
| 13235 | 549 | |
|
17280
7c0472208173
Make all the oscar memory allocations and frees use the glib functions to avoid problems when mixing C runtimes.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
550 | g_free(keystr); |
|
17443
bae8548d98b3
Cleanup and simplification of some tlvlist stuff in the oscar protocol.
Mark Doliner <markdoliner@pidgin.im>
parents:
17294
diff
changeset
|
551 | aim_tlvlist_free(tlvlist); |
| 13235 | 552 | |
|
32978
15ee0ec69dfa
Validate utf8 for a few random strings that we read, in case AOL or ICQ
Mark Doliner <markdoliner@pidgin.im>
parents:
30678
diff
changeset
|
553 | return 1; |
| 13235 | 554 | } |
| 555 | ||
| 556 | /** | |
| 557 | * Subtype 0x000a | |
| 558 | * | |
| 559 | * Receive SecurID request. | |
| 560 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
561 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
562 | got_securid_request(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 563 | { |
| 564 | int ret = 0; | |
| 565 | aim_rxcallback_t userfunc; | |
| 566 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
567 | if ((userfunc = aim_callhandler(od, snac->family, snac->subtype))) |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
568 | ret = userfunc(od, conn, frame); |
| 13235 | 569 | |
| 570 | return ret; | |
| 571 | } | |
| 572 | ||
| 573 | /** | |
| 574 | * Subtype 0x000b | |
| 575 | * | |
| 576 | * Send SecurID response. | |
| 577 | */ | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
578 | int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
579 | aim_auth_securid_send(OscarData *od, const char *securid) |
| 13235 | 580 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
581 | FlapConnection *conn; |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
582 | FlapFrame *frame; |
| 13235 | 583 | int len; |
| 584 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
585 | if (!od || !(conn = flap_connection_getbytype_all(od, SNAC_FAMILY_AUTH)) || !securid) |
| 13235 | 586 | return -EINVAL; |
| 587 | ||
| 588 | len = strlen(securid); | |
| 589 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
590 | frame = flap_frame_new(od, 0x02, 10+2+len); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
591 | |
|
33892
ef97228bc5f0
Fix most of warnings for gtk2 and linux
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32978
diff
changeset
|
592 | /* aim_snacid_t snacid = */aim_cachesnac(od, SNAC_FAMILY_AUTH, SNAC_SUBTYPE_AUTH_SECURID_RESPONSE, 0x0000, NULL, 0); |
|
30678
78aacd015725
Removed unused "flags" parameter.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
30665
diff
changeset
|
593 | aim_putsnac(&frame->data, SNAC_FAMILY_AUTH, SNAC_SUBTYPE_AUTH_SECURID_RESPONSE, 0); |
| 13235 | 594 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
595 | byte_stream_put16(&frame->data, len); |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
596 | byte_stream_putstr(&frame->data, securid); |
| 13235 | 597 | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
598 | flap_connection_send(conn, frame); |
| 13235 | 599 | |
| 600 | return 0; | |
| 601 | } | |
| 602 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
603 | static void |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
604 | auth_shutdown(OscarData *od, aim_module_t *mod) |
| 13235 | 605 | { |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
606 | if (od->authinfo != NULL) |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
607 | { |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25152
diff
changeset
|
608 | g_free(od->authinfo->bn); |
|
25152
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
609 | g_free(od->authinfo->bosip); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
610 | g_free(od->authinfo->errorurl); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
611 | g_free(od->authinfo->email); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
612 | g_free(od->authinfo->chpassurl); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
613 | g_free(od->authinfo->latestrelease.name); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
614 | g_free(od->authinfo->latestrelease.url); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
615 | g_free(od->authinfo->latestrelease.info); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
616 | g_free(od->authinfo->latestbeta.name); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
617 | g_free(od->authinfo->latestbeta.url); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
618 | g_free(od->authinfo->latestbeta.info); |
|
128b99dfb286
Fix warnings where size_t/gsize was used for printf with the wrong format
Paul Aurich <darkrain42@pidgin.im>
parents:
25086
diff
changeset
|
619 | g_free(od->authinfo); |
| 13235 | 620 | } |
| 621 | } | |
| 622 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
623 | static int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
624 | snachandler(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs) |
| 13235 | 625 | { |
| 626 | if (snac->subtype == 0x0003) | |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
627 | return parse(od, conn, mod, frame, snac, bs); |
| 13235 | 628 | else if (snac->subtype == 0x0007) |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
629 | return keyparse(od, conn, mod, frame, snac, bs); |
| 13235 | 630 | else if (snac->subtype == 0x000a) |
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
631 | return got_securid_request(od, conn, mod, frame, snac, bs); |
| 13235 | 632 | |
| 633 | return 0; | |
| 634 | } | |
| 635 | ||
|
13593
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
636 | int |
|
3450a7cede99
[gaim-migrate @ 15978]
Mark Doliner <markdoliner@pidgin.im>
parents:
13254
diff
changeset
|
637 | auth_modfirst(OscarData *od, aim_module_t *mod) |
| 13235 | 638 | { |
|
23456
66ab07770438
Replaced family_*'s magic numbers of FLAP families with the constants
Evan Schoenberg <evands@pidgin.im>
parents:
23454
diff
changeset
|
639 | mod->family = SNAC_FAMILY_AUTH; |
| 13235 | 640 | mod->version = 0x0000; |
| 641 | mod->flags = 0; | |
| 642 | strncpy(mod->name, "auth", sizeof(mod->name)); | |
| 643 | mod->snachandler = snachandler; | |
| 644 | mod->shutdown = auth_shutdown; | |
| 645 | ||
| 646 | return 0; | |
| 647 | } |