]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
corrected bug in verify
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 1 Jun 2001 14:46:36 +0000 (14:46 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 1 Jun 2001 14:46:36 +0000 (14:46 +0000)
lib/crypt_bcrypt.c
lib/crypt_srpsha1.c

index f24c60533021e3bbc946409bf52f7150e9366f70..d7d93042e42b82d364f26ed253a1ebbc1ca2d028 100644 (file)
@@ -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;
        }
index 98cdd7139f73a598dcda7cace4d1f4c32a1eadb6..ff41d9ec39cb65ce76a2e10a2af8d4cd5b12092f 100644 (file)
@@ -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;