summaryrefslogtreecommitdiff
path: root/lib/tpm.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-12-04 09:56:13 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-12-05 08:26:57 +0100
commit49146f057d91fb5cad8bcdcf91a21fe9686f2305 (patch)
tree8dc854ee5f05f25e3cc0bbd83362e8971c1603a5 /lib/tpm.c
parent50e8ed9e742198c0952464b1a7d44a5e8b84aee3 (diff)
downloadgnutls-49146f057d91fb5cad8bcdcf91a21fe9686f2305.tar.gz
In import_tpm_key_cb() fix the wrong password loop
When calling import_tpm_key() once it initializes the key, but a second call fails due to the key being already initialized. Ensure that failure of import_tpm_key() leaves the key on a clear state. Reported by James Bottomley <James.Bottomley@HansenPartnership.com>.
Diffstat (limited to 'lib/tpm.c')
-rw-r--r--lib/tpm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/tpm.c b/lib/tpm.c
index 23e44799a5..aac83186a0 100644
--- a/lib/tpm.c
+++ b/lib/tpm.c
@@ -688,6 +688,7 @@ import_tpm_key(gnutls_privkey_t pkey,
pTspi_Context_CloseObject(s->tpm_ctx, s->tpm_key);
s->tpm_key = 0;
out_session:
+ _gnutls_privkey_cleanup(pkey);
tpm_close_session(s);
out_ctx:
gnutls_free(s);