diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2019-01-04 09:28:31 -0800 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2019-01-04 09:28:31 -0800 |
commit | 51107451ca10c6b8206fcabfa695928d0d8ca9d3 (patch) | |
tree | 5d4a9823742d23df7130b02298156df50981d43f | |
parent | 56b3f7f77c588a6d0520a6b7457d9f03115f31ba (diff) | |
download | openssl_tpm2_engine-51107451ca10c6b8206fcabfa695928d0d8ca9d3.tar.gz |
e_tpm2: fix spurious error on successful operation
When the engine successfully performs an operation with an older key,
we still end up with an apparent error (which can be displayed to the
user) about a failed load. This comes from the initial failed attempt
to load the new key format and can be fixed by clearing all openssl
errors if the old key format load succeeds.
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | e_tpm2.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -373,6 +373,8 @@ static int tpm2_engine_load_key_core(ENGINE *e, EVP_PKEY **ppkey, BIO_seek(bf, 0); tssl = PEM_read_bio_TSSLOADABLE(bf, NULL, NULL, NULL); if (tssl) { + /* have error from failed TSSPRIVKEY load */ + ERR_clear_error(); type = tssl->type; empty_auth = tssl->emptyAuth; parent = tssl->parent; |