]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Do not crash if password is null and GNUTLS_PKCS_PLAIN is not specified.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 31 May 2012 07:16:16 +0000 (09:16 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 31 May 2012 07:16:16 +0000 (09:16 +0200)
lib/x509/privkey_pkcs8.c

index dc0be3857e830987e2410c40286cab6da3c3b8f7..b4429568ee81a718b5aa450ddf3d16bcaa18a95c 100644 (file)
@@ -1228,7 +1228,7 @@ gnutls_x509_privkey_import_pkcs8 (gnutls_x509_privkey_t key,
       need_free = 1;
     }
 
-  if (flags & GNUTLS_PKCS_PLAIN)
+  if (password == NULL || (flags & GNUTLS_PKCS_PLAIN))
     {
       result = decode_private_key_info (&_data, key);
     }