diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-06-01 14:46:36 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2001-06-01 14:46:36 +0000 |
commit | 6208151d0f987929d19ac04bfdaeaceca821bd66 (patch) | |
tree | 4f6928c7bf158ae2910fa04fcac83d5b86f5aff8 /lib | |
parent | 5bd5c57cf4a88c6218322a2c27d782009b2bb483 (diff) | |
download | gnutls-6208151d0f987929d19ac04bfdaeaceca821bd66.tar.gz |
corrected bug in verify
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crypt_bcrypt.c | 2 | ||||
-rw-r--r-- | lib/crypt_srpsha1.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/crypt_bcrypt.c b/lib/crypt_bcrypt.c index f24c605330..d7d93042e4 100644 --- a/lib/crypt_bcrypt.c +++ b/lib/crypt_bcrypt.c @@ -615,7 +615,7 @@ char *crypt_bcrypt(const char *passwd, const char *salt, MPI g, MPI n) } sp++; - if (_gnutls_sbase64_decode(sp, strlen(sp), &csalt) < 0) { + if (_gnutls_sbase64_decode(sp, (int)rindex(sp, ':') - (int)sp, &csalt) < 0) { gnutls_assert(); return NULL; } diff --git a/lib/crypt_srpsha1.c b/lib/crypt_srpsha1.c index 98cdd7139f..ff41d9ec39 100644 --- a/lib/crypt_srpsha1.c +++ b/lib/crypt_srpsha1.c @@ -41,7 +41,7 @@ char *crypt_srpsha1(const char *username, const char *passwd, int vsize, hash_len = gnutls_hash_get_algo_len(GNUTLS_MAC_SHA); opaque *tmp; uint8 *rtext, *csalt; - int rsalt_size; + int rsalt_size, len; passwd_len = strlen(passwd); /* we do not want the null */ @@ -61,8 +61,10 @@ char *crypt_srpsha1(const char *username, const char *passwd, return NULL; } sp++; - - rsalt_size = _gnutls_sbase64_decode(sp, strlen(sp), &csalt); + + len = (int)rindex(sp, ':') - (int)sp; + + rsalt_size = _gnutls_sbase64_decode(sp, len, &csalt); if (rsalt_size < 0) { gnutls_assert(); return NULL; |