From 983616afa0466ebefb2ff0a78685339f5462c77d Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 2 Apr 2024 16:46:47 -0600 Subject: [PATCH] check for critical policy extension when not supported --- wolfcrypt/src/asn.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 3d80e8708..e3d3321a2 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -21072,7 +21072,13 @@ static int DecodeExtensionType(const byte* input, word32 length, word32 oid, ret = ASN_PARSE_E; } #else - WOLFSSL_MSG("Certificate Policy extension not supported yet."); + WOLFSSL_MSG("Certificate Policy extension not supported."); + #ifndef WOLFSSL_NO_ASN_STRICT + if (critical) { + WOLFSSL_ERROR_VERBOSE(ASN_CRIT_EXT_E); + ret = ASN_CRIT_EXT_E; + } + #endif #endif break;