summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2015-08-04 20:32:25 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2015-08-04 20:37:05 +0200
commitf1f36d660cefecc2443467aeea813b22cec212e2 (patch)
treeb39939e584e4bff62ffade68d35f69eb85143752
parenta02fe9a1ac73b20c030b6533cbc79c22c7dc87ce (diff)
downloadgnutls-f1f36d660cefecc2443467aeea813b22cec212e2.tar.gz
key decoding: set key to null for consistency
-rw-r--r--lib/x509/privkey.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index a148f569a1..2676bd8811 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -554,8 +554,10 @@ gnutls_x509_privkey_import(gnutls_x509_privkey_t key,
gnutls_x509_privkey_import_pkcs8(key, data, format,
NULL,
GNUTLS_PKCS_PLAIN);
- if (result < 0)
+ if (result < 0) {
gnutls_assert();
+ key->key = NULL;
+ }
} else if (key->pk_algorithm == GNUTLS_PK_RSA) {
key->key =
_gnutls_privkey_decode_pkcs1_rsa_key(&_data, key);