From f0064796457d105029f150ee6a69e6489a9e6d03 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 11 Feb 2021 08:04:58 -0800 Subject: [PATCH] Fix another PKCS11 case where the ECC key type is not set and causes failures. Broke in PR #3687. --- wolfcrypt/src/wc_pkcs11.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wolfcrypt/src/wc_pkcs11.c b/wolfcrypt/src/wc_pkcs11.c index a8a55aae5..ef4974b5e 100644 --- a/wolfcrypt/src/wc_pkcs11.c +++ b/wolfcrypt/src/wc_pkcs11.c @@ -2068,6 +2068,10 @@ static int Pkcs11GetEccPublicKey(ecc_key* key, Pkcs11Session* session, ret = wc_ecc_import_point_der(point + i, pointSz - i, curveIdx, &key->pubkey); } + /* make sure the ecc_key type has been set */ + if (ret == 0 && key->type == 0) { + key->type = ECC_PUBLICKEY; + } if (point != NULL) XFREE(point, key->heap, DYNAMIC_TYPE_ECC);