Pārlūkot izejas kodu

Merge pull request #7278 from JacobBarthelmeh/pkcs7-validate

add guard around public key validation on import
Chris Conlon 1 mēnesi atpakaļ
vecāks
revīzija
95abc1074b
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      wolfcrypt/src/pkcs7.c

+ 2 - 0
wolfcrypt/src/pkcs7.c

@@ -1041,9 +1041,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;