Changes in storage_xml.c [a7b5925:55078f5]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
ra7b5925 r55078f5 27 27 #include "bitlbee.h" 28 28 #include "base64.h" 29 #include " arc.h"29 #include "rc4.h" 30 30 #include "md5.h" 31 31 … … 132 132 { 133 133 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; 136 135 int pass_len; 137 136 struct prpl *prpl = NULL; … … 152 151 g_set_error( error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT, 153 152 "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 ) ) 156 156 { 157 157 xd->current_account = account_add( irc, prpl, handle, password ); … … 169 169 } 170 170 171 g_free( pass_ cr);171 g_free( pass_rc4 ); 172 172 g_free( password ); 173 173 } … … 410 410 md5_finish( &md5_state, pass_md5 ); 411 411 /* Save the hash in base64-encoded form. */ 412 pass_buf = base64_encode( pass_md5, 21 );412 pass_buf = base64_encode( (char*) pass_md5, 21 ); 413 413 414 414 if( !xml_printf( fd, 0, "<user nick=\"%s\" password=\"%s\" version=\"%d\">\n", irc->nick, pass_buf, XML_FORMAT_VERSION ) ) … … 424 424 for( acc = irc->accounts; acc; acc = acc->next ) 425 425 { 426 unsigned char *pass_cr; 427 char *pass_b64; 426 char *pass_rc4, *pass_b64; 428 427 int pass_len; 429 428 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 ); 433 432 434 433 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.