Changeset a8a0b4c for storage_xml.c


Ignore:
Timestamp:
2007-07-14T23:54:18Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
2abfbc5
Parents:
1da00b1 (diff), b9e4ab5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from Jelmer (making GCC4 happy by sanitizing some typecasting mess
around the RC4/B64 code).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    r1da00b1 ra8a0b4c  
    132132        {
    133133                char *protocol, *handle, *server, *password = NULL, *autoconnect;
    134                 char *pass_b64 = NULL, *pass_rc4 = NULL;
     134                char *pass_b64 = NULL;
     135                unsigned char *pass_rc4 = NULL;
    135136                int pass_len;
    136137                struct prpl *prpl = NULL;
     
    152153                                     "Unknown protocol: %s", protocol );
    153154                else if( ( pass_len = base64_decode( pass_b64, (unsigned char**) &pass_rc4 ) ) &&
    154                                 rc4_decode( (unsigned char*) pass_rc4, pass_len,
    155                                             (unsigned char**) &password, xd->given_pass ) )
     155                                         rc4_decode( pass_rc4, pass_len, &password, xd->given_pass ) )
    156156                {
    157157                        xd->current_account = account_add( irc, prpl, handle, password );
     
    410410        md5_finish( &md5_state, pass_md5 );
    411411        /* Save the hash in base64-encoded form. */
    412         pass_buf = base64_encode( (char*) pass_md5, 21 );
     412        pass_buf = base64_encode( pass_md5, 21 );
    413413       
    414414        if( !xml_printf( fd, 0, "<user nick=\"%s\" password=\"%s\" version=\"%d\">\n", irc->nick, pass_buf, XML_FORMAT_VERSION ) )
     
    424424        for( acc = irc->accounts; acc; acc = acc->next )
    425425        {
    426                 char *pass_rc4, *pass_b64;
     426                unsigned char *pass_rc4;
     427                char *pass_b64;
    427428                int pass_len;
    428429               
    429                 pass_len = rc4_encode( (unsigned char*) acc->pass, strlen( acc->pass ), (unsigned char**) &pass_rc4, irc->password );
     430                pass_len = rc4_encode( acc->pass, strlen( acc->pass ), (unsigned char**) &pass_rc4, irc->password );
    430431                pass_b64 = base64_encode( pass_rc4, pass_len );
    431432                g_free( pass_rc4 );
Note: See TracChangeset for help on using the changeset viewer.