diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-07 19:16:43 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-07 19:16:43 +0100 |
commit | 3cc421081ea8440c533d69eedcb32ad79c30a6bb (patch) | |
tree | 5b764da22a3455f2b106814a7fff47c243034090 | |
parent | 544f581c13ffeffd6f10b499df65a0f8b97f2e4e (diff) | |
download | gnutls-3cc421081ea8440c533d69eedcb32ad79c30a6bb.tar.gz |
fixed issue in gnutls_x509_privkey_import2()
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | lib/x509/privkey.c | 9 |
2 files changed, 14 insertions, 4 deletions
@@ -2,6 +2,15 @@ GnuTLS NEWS -- History of user-visible changes. -*- outline -*- Copyright (C) 2000-2012 Free Software Foundation, Inc. See the end for copying conditions. +* Version 3.1.8 (unreleased) + +** Fixed issue in gnutls_x509_privkey_import2() which didn't return +GNUTLS_E_DECRYPTION_FAILED in all cases. + +** API and ABI modifications: +No changes since last version. + + * Version 3.1.7 (released 2012-02-04) ** certtool: Added option "dn" which allows to directly set the DN diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c index 7b31821b61..9c0863d32a 100644 --- a/lib/x509/privkey.c +++ b/lib/x509/privkey.c @@ -644,14 +644,15 @@ gnutls_x509_privkey_import2 (gnutls_x509_privkey_t key, ret = gnutls_x509_privkey_import_pkcs8(key, data, format, password, flags); if (ret < 0) { + if (ret == GNUTLS_E_DECRYPTION_FAILED) goto cleanup; ret = import_pkcs12_privkey(key, data, format, password, flags); if (ret < 0 && format == GNUTLS_X509_FMT_PEM) { - int err; - err = gnutls_x509_privkey_import_openssl(key, data, password); - if (err < 0) + if (ret == GNUTLS_E_DECRYPTION_FAILED) goto cleanup; + + ret = gnutls_x509_privkey_import_openssl(key, data, password); + if (ret < 0) { - if (err == GNUTLS_E_DECRYPTION_FAILED) ret = err; gnutls_assert(); goto cleanup; } |