From 991ee662c0dbebfb75a53d53eed12374b2ee760e Mon Sep 17 00:00:00 2001 From: Carie Pointer Date: Mon, 6 Jan 2020 08:42:37 -0800 Subject: [PATCH] Return 0 in ParseCRL_Extensions if there are no CRL extensions to parse --- wolfcrypt/src/asn.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index e50527f87..0595482e6 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -16036,8 +16036,11 @@ static int ParseCRL_Extensions(DecodedCRL* dcrl, const byte* buf, if (GetASNTag(buf, &idx, &tag, sz) < 0) return ASN_PARSE_E; - if (tag != (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 0)) - return ASN_PARSE_E; + if (tag != (ASN_CONSTRUCTED | ASN_CONTEXT_SPECIFIC | 0)) { + /* Return without error if no extensions are found */ + WOLFSSL_MSG("No CRL Extensions found"); + return 0; + } if (GetLength(buf, &idx, &length, sz) < 0) return ASN_PARSE_E;