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