diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-06-25 19:23:27 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-06-25 19:23:27 +0200 |
commit | 88086dbd9002123be39d00c53460f1ec9f2b719a (patch) | |
tree | 2370e9c8b59040b16217e120f203d24ff34f9270 /lib/rc4.c | |
parent | 6e1fed7057ee26f21b0e59a5aeb292d4f3f0e8ae (diff) |
Added versioning information to the XML-file (convenient for later format
changes), got rid of confusing "Password successfully changed" message
when the user uses the identify-command and protected rc4_decode() against
short inputs.
Diffstat (limited to 'lib/rc4.c')
-rw-r--r-- | lib/rc4.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 ); |