diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2004-10-27 09:40:37 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2004-10-27 09:40:37 +0000 |
commit | 9085bd7f3cc05e165e431ddf04a2c232aae97eca (patch) | |
tree | 7409372d279f299fe3081d95ac00c8920ee457a9 | |
parent | c6c4ef5871765247da81ba6a869510c5056b834b (diff) | |
download | gnutls-9085bd7f3cc05e165e431ddf04a2c232aae97eca.tar.gz |
allow for NULL and empty passwords in pkcs12 string to key
-rw-r--r-- | lib/x509/pkcs12_encr.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |