]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
allow for NULL and empty passwords in pkcs12 string to key
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 27 Oct 2004 09:40:37 +0000 (09:40 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 27 Oct 2004 09:40:37 +0000 (09:40 +0000)
lib/x509/pkcs12_encr.c

index 5158ec7fdc4fd5b99c2e6bd9308bd2924a24209e..f8fc776229d30050e9645a25e7ad7c737095f8c4 100644 (file)
@@ -70,10 +70,10 @@ _pkcs12_string_to_key(unsigned int id, const opaque * salt,
 
     cur_keylen = 0;
 
-    if (pw==NULL) return GNUTLS_E_INVALID_REQUEST;
+    if (pw==NULL) pwlen = 0;
+    else pwlen = strlen(pw);
 
-    pwlen = strlen(pw);
-    if (pwlen==0 || pwlen > 63 / 2) {
+    if (pwlen > 63 / 2) {
        gnutls_assert();
        return GNUTLS_E_INVALID_REQUEST;
     }