Changeset 862371b for libfaim/auth.c


Ignore:
Timestamp:
Jun 29, 2003, 1:47:04 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e016fc2
Parents:
03ad7b2
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfaim/auth.c

    r5e53c4a r862371b  
    11/*
    2  * Deals with the authorizer (group 0x0017=23, and old-style non-SNAC login).
     2 * Family 0x0017 - Authentication.
     3 *
     4 * Deals with the authorizer for SNAC-based login, and also old-style
     5 * non-SNAC login.
    36 *
    47 */
     
    148151
    149152/*
    150  * Part two of the ICQ hack.  Note the ignoring of the key and clientinfo.
    151  */
    152 static int goddamnicq2(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *password)
    153 {
    154         static const char clientstr[] = {"ICQ Inc. - Product of ICQ (TM) 2000b.4.65.1.3281.85"};
    155         static const char lang[] = {"en"};
    156         static const char country[] = {"us"};
     153 * Part two of the ICQ hack.  Note the ignoring of the key.
     154 */
     155static int goddamnicq2(aim_session_t *sess, aim_conn_t *conn, const char *sn, const char *password, struct client_info_s *ci)
     156{
    157157        aim_frame_t *fr;
    158158        aim_tlvlist_t *tl = NULL;
     
    169169        aim_encode_password(password, password_encoded);
    170170
    171         aimbs_put32(&fr->data, 0x00000001);
     171        aimbs_put32(&fr->data, 0x00000001); /* FLAP Version */
    172172        aim_addtlvtochain_raw(&tl, 0x0001, strlen(sn), sn);
    173173        aim_addtlvtochain_raw(&tl, 0x0002, strlen(password), password_encoded);
    174         aim_addtlvtochain_raw(&tl, 0x0003, strlen(clientstr), clientstr);
    175         aim_addtlvtochain16(&tl, 0x0016, 0x010a); /* cliend ID */
    176         aim_addtlvtochain16(&tl, 0x0017, 0x0004); /* major version */
    177         aim_addtlvtochain16(&tl, 0x0018, 0x0041); /* minor version */
    178         aim_addtlvtochain16(&tl, 0x0019, 0x0001); /* point version */
    179         aim_addtlvtochain16(&tl, 0x001a, 0x0cd1); /* build */
     174
     175        if (ci->clientstring)
     176                aim_addtlvtochain_raw(&tl, 0x0003, strlen(ci->clientstring), ci->clientstring);
     177        aim_addtlvtochain16(&tl, 0x0016, (fu16_t)ci->clientid);
     178        aim_addtlvtochain16(&tl, 0x0017, (fu16_t)ci->major);
     179        aim_addtlvtochain16(&tl, 0x0018, (fu16_t)ci->minor);
     180        aim_addtlvtochain16(&tl, 0x0019, (fu16_t)ci->point);
     181        aim_addtlvtochain16(&tl, 0x001a, (fu16_t)ci->build);
    180182        aim_addtlvtochain32(&tl, 0x0014, 0x00000055); /* distribution chan */
    181         aim_addtlvtochain_raw(&tl, 0x000f, strlen(lang), lang);
    182         aim_addtlvtochain_raw(&tl, 0x000e, strlen(country), country);
     183        aim_addtlvtochain_raw(&tl, 0x000f, strlen(ci->lang), ci->lang);
     184        aim_addtlvtochain_raw(&tl, 0x000e, strlen(ci->country), ci->country);
    183185
    184186        aim_writetlvchain(&fr->data, &tl);
     
    277279         */
    278280        if (sess->flags & AIM_SESS_FLAGS_XORLOGIN)
    279                 return goddamnicq2(sess, conn, sn, password);
     281                return goddamnicq2(sess, conn, sn, password, ci);
    280282
    281283
     
    290292        aim_encode_password_md5(password, key, digest);
    291293        aim_addtlvtochain_raw(&tl, 0x0025, 16, digest);
     294
     295        /*
     296         * Newer versions of winaim have an empty type x004c TLV here.
     297         */
    292298
    293299        if (ci->clientstring)
     
    305311         * to use SSI.
    306312         */
    307         if (0)
    308                 aim_addtlvtochain8(&tl, 0x004a, 0x01);
     313        aim_addtlvtochain8(&tl, 0x004a, 0x01);
    309314
    310315        aim_writetlvchain(&fr->data, &tl);
     
    473478                ; /* no idea what this is */
    474479
     480        /*
     481         * URL to change password.
     482         */
     483        if (aim_gettlv(tlvlist, 0x0054, 1))
     484                info.chpassurl = aim_gettlv_str(tlvlist, 0x0054, 1);
    475485
    476486        if ((userfunc = aim_callhandler(sess, rx->conn, snac ? snac->family : 0x0017, snac ? snac->subtype : 0x0003)))
     
    481491        free(info.errorurl);
    482492        free(info.email);
     493        free(info.chpassurl);
    483494        free(info.latestrelease.name);
    484495        free(info.latestrelease.url);
     
    539550        return 0;
    540551}
    541 
Note: See TracChangeset for help on using the changeset viewer.