From: Nikos Mavrogiannopoulos Date: Thu, 31 May 2012 07:16:16 +0000 (+0200) Subject: Do not crash if password is null and GNUTLS_PKCS_PLAIN is not specified. X-Git-Tag: gnutls_3_0_21~94 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca40a6fe02654c519cf03d8ab3cbb1cf4b429b98;p=thirdparty%2Fgnutls.git Do not crash if password is null and GNUTLS_PKCS_PLAIN is not specified. --- diff --git a/lib/x509/privkey_pkcs8.c b/lib/x509/privkey_pkcs8.c index dc0be3857e..b4429568ee 100644 --- a/lib/x509/privkey_pkcs8.c +++ b/lib/x509/privkey_pkcs8.c @@ -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); }