diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2019-01-12 14:23:46 -0800 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2019-01-12 14:23:46 -0800 |
commit | 95dea1d7efea2a3eee473158c824275f9e07915e (patch) | |
tree | 245cb009ebfd759624f83df3385559dca3685511 | |
parent | 51107451ca10c6b8206fcabfa695928d0d8ca9d3 (diff) | |
download | openssl_tpm2_engine-95dea1d7efea2a3eee473158c824275f9e07915e.tar.gz |
e_tpm2: fix intermittent segfault with importable keys
The written parameter on the import unmarshal isn't set meaning it
contains a bogus value. Occasionally this value causes a segfault, so
fix by setting the value to 0.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | e_tpm2.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -517,6 +517,7 @@ static int tpm2_engine_load_key_core(ENGINE *e, EVP_PKEY **ppkey, } buf = priv_2b.t.buffer; size = sizeof(priv_2b.t.buffer); + written = 0; TSS_TPM2B_PRIVATE_Marshal(&iout.outPrivate, &written, &buf, &size); app_data->priv = OPENSSL_malloc(written); |