aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--irc.c7
-rw-r--r--lib/rc4.c6
-rw-r--r--storage_xml.c3
3 files changed, 12 insertions, 4 deletions
diff --git a/irc.c b/irc.c
index b5751859..c07a3ea3 100644
--- a/irc.c
+++ b/irc.c
@@ -32,10 +32,11 @@ static gboolean irc_userping( gpointer _irc, int fd, b_input_condition cond );
GSList *irc_connection_list = NULL;
-static char *passchange (irc_t *irc, void *set, char *value)
+static char *passchange( irc_t *irc, void *set, char *value )
{
- irc_setpass (irc, value);
- return (NULL);
+ irc_setpass( irc, value );
+ irc_usermsg( irc, "Password successfully changed" );
+ return NULL;
}
irc_t *irc_new( int fd )
diff --git a/lib/rc4.c b/lib/rc4.c
index 2b732ba2..cbe0e2c0 100644
--- a/lib/rc4.c
+++ b/lib/rc4.c
@@ -157,6 +157,12 @@ int rc4_decode( unsigned char *crypt, int crypt_len, unsigned char **clear, char
key_len = strlen( password ) + RC4_IV_LEN;
clear_len = crypt_len - RC4_IV_LEN;
+ if( clear_len < 0 )
+ {
+ *clear = g_strdup( "" );
+ return 0;
+ }
+
/* Prepare buffers and the key + IV */
*clear = g_malloc( clear_len + 1 );
key = g_malloc( key_len );
diff --git a/storage_xml.c b/storage_xml.c
index 35d74935..0bbcd99a 100644
--- a/storage_xml.c
+++ b/storage_xml.c
@@ -39,6 +39,7 @@ typedef enum
/* This isn't very clean, probably making a separate error class + code for
BitlBee would be a better solution. But this will work for now... */
#define XML_PASS_ERRORMSG "Wrong username or password"
+#define XML_FORMAT_VERSION 1
struct xml_parsedata
{
@@ -409,7 +410,7 @@ static storage_status_t xml_save( irc_t *irc, int overwrite )
/* Save the hash in base64-encoded form. */
pass_buf = base64_encode( (char*) pass_md5, 21 );
- if( !xml_printf( fd, "<user nick=\"%s\" password=\"%s\">\n", irc->nick, pass_buf ) )
+ if( !xml_printf( fd, "<user nick=\"%s\" password=\"%s\" version=\"%d\">\n", irc->nick, pass_buf, XML_FORMAT_VERSION ) )
goto write_error;
g_free( pass_buf );