From: Nikos Mavrogiannopoulos Date: Wed, 27 Oct 2004 09:40:37 +0000 (+0000) Subject: allow for NULL and empty passwords in pkcs12 string to key X-Git-Tag: gnutls_1_1_21~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9085bd7f3cc05e165e431ddf04a2c232aae97eca;p=thirdparty%2Fgnutls.git allow for NULL and empty passwords in pkcs12 string to key --- diff --git a/lib/x509/pkcs12_encr.c b/lib/x509/pkcs12_encr.c index 5158ec7fdc..f8fc776229 100644 --- a/lib/x509/pkcs12_encr.c +++ b/lib/x509/pkcs12_encr.c @@ -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; }