From 8a6c6ebfd529c3970de2016c3f420fe162036468 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Wed, 28 Feb 2024 13:48:58 +0700 Subject: [PATCH] add guard around public key validation on import --- wolfcrypt/src/pkcs7.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index 4f7bbc4b1..159ca4086 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -1021,9 +1021,11 @@ static int wc_PKCS7_CheckPublicKeyDer(PKCS7* pkcs7, int keyOID, /* Try to decode public key and check with wc_ecc_check_key() */ ret = wc_EccPublicKeyDecode(key, &scratch, ecc, keySz); + #if defined(WOLFSSL_VALIDATE_ECC_IMPORT) if (ret == 0) { ret = wc_ecc_check_key(ecc); } + #endif wc_ecc_free(ecc); break;