Changeset a8a0b4c
- Timestamp:
- 2007-07-14T23:54:18Z (17 years ago)
- 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. - Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/base64.c
r1da00b1 ra8a0b4c 31 31 char *tobase64(const char *text) 32 32 { 33 return base64_encode( text, strlen(text));33 return base64_encode((const unsigned char *)text, strlen(text)); 34 34 } 35 35 36 char *base64_encode(const char *in, int len)36 char *base64_encode(const unsigned char *in, int len) 37 37 { 38 38 char *out; -
lib/base64.h
r1da00b1 ra8a0b4c 27 27 28 28 G_MODULE_EXPORT char *tobase64( const char *text ); 29 G_MODULE_EXPORT char *base64_encode( const char *in, int len );29 G_MODULE_EXPORT char *base64_encode( const unsigned char *in, int len ); 30 30 G_MODULE_EXPORT int base64_encode_real( const unsigned char *in, int inlen, unsigned char *out, const char *b64digits ); 31 31 G_MODULE_EXPORT char *frombase64( const char *in ); -
lib/rc4.c
r1da00b1 ra8a0b4c 122 122 */ 123 123 124 int rc4_encode( unsignedchar *clear, int clear_len, unsigned char **crypt, char *password )124 int rc4_encode( char *clear, int clear_len, unsigned char **crypt, char *password ) 125 125 { 126 126 struct rc4_state *st; … … 130 130 key_len = strlen( password ) + RC4_IV_LEN; 131 131 if( clear_len <= 0 ) 132 clear_len = strlen( (char*)clear );132 clear_len = strlen( clear ); 133 133 134 134 /* Prepare buffers and the key + IV */ … … 154 154 } 155 155 156 int rc4_decode( unsigned char *crypt, int crypt_len, unsignedchar **clear, char *password )156 int rc4_decode( unsigned char *crypt, int crypt_len, char **clear, char *password ) 157 157 { 158 158 struct rc4_state *st; … … 165 165 if( clear_len < 0 ) 166 166 { 167 *clear = (unsigned char*)g_strdup( "" );167 *clear = g_strdup( "" ); 168 168 return 0; 169 169 } -
lib/rc4.h
r1da00b1 ra8a0b4c 33 33 struct rc4_state *rc4_keymaker( unsigned char *key, int kl, int cycles ); 34 34 unsigned char rc4_getbyte( struct rc4_state *st ); 35 int rc4_encode( unsignedchar *clear, int clear_len, unsigned char **crypt, char *password );36 int rc4_decode( unsigned char *crypt, int crypt_len, unsignedchar **clear, char *password );35 int rc4_encode( char *clear, int clear_len, unsigned char **crypt, char *password ); 36 int rc4_decode( unsigned char *crypt, int crypt_len, char **clear, char *password ); -
lib/ssl_bogus.c
r1da00b1 ra8a0b4c 52 52 } 53 53 54 void *ssl_starttls( int fd, ssl_input_function func, gpointer data ) 55 { 56 return NULL; 57 } 58 54 59 b_input_condition ssl_getdirection( void *conn ) 55 60 { -
protocols/jabber/sasl.c
r1da00b1 ra8a0b4c 89 89 strcpy( s + 1, jd->username ); 90 90 strcpy( s + 2 + strlen( jd->username ), ic->acc->pass ); 91 reply->text = base64_encode( s, len );91 reply->text = base64_encode( (unsigned char *)s, len ); 92 92 reply->text_len = strlen( reply->text ); 93 93 g_free( s ); … … 185 185 struct jabber_data *jd = ic->proto_data; 186 186 struct xt_node *reply = NULL; 187 char *nonce = NULL, *realm = NULL, *cnonce = NULL, cnonce_bin[30]; 187 char *nonce = NULL, *realm = NULL, *cnonce = NULL; 188 unsigned char cnonce_bin[30]; 188 189 char *digest_uri = NULL; 189 190 char *dec = NULL; … … 216 217 realm = g_strdup( jd->server ); 217 218 218 random_bytes( (unsigned char *)cnonce_bin, sizeof( cnonce_bin ) );219 random_bytes( cnonce_bin, sizeof( cnonce_bin ) ); 219 220 cnonce = base64_encode( cnonce_bin, sizeof( cnonce_bin ) ); 220 221 digest_uri = g_strdup_printf( "%s/%s", "xmpp", jd->server ); -
storage_xml.c
r1da00b1 ra8a0b4c 132 132 { 133 133 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; 135 136 int pass_len; 136 137 struct prpl *prpl = NULL; … … 152 153 "Unknown protocol: %s", protocol ); 153 154 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 ) ) 156 156 { 157 157 xd->current_account = account_add( irc, prpl, handle, password ); … … 410 410 md5_finish( &md5_state, pass_md5 ); 411 411 /* Save the hash in base64-encoded form. */ 412 pass_buf = base64_encode( (char*)pass_md5, 21 );412 pass_buf = base64_encode( 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 char *pass_rc4, *pass_b64; 426 unsigned char *pass_rc4; 427 char *pass_b64; 427 428 int pass_len; 428 429 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 ); 430 431 pass_b64 = base64_encode( pass_rc4, pass_len ); 431 432 g_free( pass_rc4 );
Note: See TracChangeset
for help on using the changeset viewer.