Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    ra7b5925 r55078f5  
    2727#include "bitlbee.h"
    2828#include "base64.h"
    29 #include "arc.h"
     29#include "rc4.h"
    3030#include "md5.h"
    3131
     
    132132        {
    133133                char *protocol, *handle, *server, *password = NULL, *autoconnect;
    134                 char *pass_b64 = NULL;
    135                 unsigned char *pass_cr = NULL;
     134                char *pass_b64 = NULL, *pass_rc4 = NULL;
    136135                int pass_len;
    137136                struct prpl *prpl = NULL;
     
    152151                        g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
    153152                                     "Unknown protocol: %s", protocol );
    154                 else if( ( pass_len = base64_decode( pass_b64, (unsigned char**) &pass_cr ) ) &&
    155                                          arc_decode( pass_cr, pass_len, &password, xd->given_pass ) )
     153                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 ) )
    156156                {
    157157                        xd->current_account = account_add( irc, prpl, handle, password );
     
    169169                }
    170170               
    171                 g_free( pass_cr );
     171                g_free( pass_rc4 );
    172172                g_free( password );
    173173        }
     
    410410        md5_finish( &md5_state, pass_md5 );
    411411        /* Save the hash in base64-encoded form. */
    412         pass_buf = base64_encode( pass_md5, 21 );
     412        pass_buf = base64_encode( (char*) 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                 unsigned char *pass_cr;
    427                 char *pass_b64;
     426                char *pass_rc4, *pass_b64;
    428427                int pass_len;
    429428               
    430                 pass_len = arc_encode( acc->pass, strlen( acc->pass ), (unsigned char**) &pass_cr, irc->password );
    431                 pass_b64 = base64_encode( pass_cr, pass_len );
    432                 g_free( pass_cr );
     429                pass_len = rc4_encode( (unsigned char*) acc->pass, strlen( acc->pass ), (unsigned char**) &pass_rc4, irc->password );
     430                pass_b64 = base64_encode( pass_rc4, pass_len );
     431                g_free( pass_rc4 );
    433432               
    434433                if( !xml_printf( fd, 1, "<account protocol=\"%s\" handle=\"%s\" password=\"%s\" autoconnect=\"%d\"", acc->prpl->name, acc->user, pass_b64, acc->auto_connect ) )
Note: See TracChangeset for help on using the changeset viewer.