Skip to content

Commit 95abc10

Browse files
authored
Merge pull request #7278 from JacobBarthelmeh/pkcs7-validate
add guard around public key validation on import
2 parents 7bc73d3 + 8a6c6eb commit 95abc10

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

wolfcrypt/src/pkcs7.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,9 +1041,11 @@ static int wc_PKCS7_CheckPublicKeyDer(PKCS7* pkcs7, int keyOID,
10411041

10421042
/* Try to decode public key and check with wc_ecc_check_key() */
10431043
ret = wc_EccPublicKeyDecode(key, &scratch, ecc, keySz);
1044+
#if defined(WOLFSSL_VALIDATE_ECC_IMPORT)
10441045
if (ret == 0) {
10451046
ret = wc_ecc_check_key(ecc);
10461047
}
1048+
#endif
10471049
wc_ecc_free(ecc);
10481050

10491051
break;

0 commit comments

Comments
 (0)