From 467b3cb561d6b78477b603075f0f88b2c1e9946b Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Thu, 6 Jun 2024 16:24:48 -0600 Subject: [PATCH] add parsing 0 serial numbers for certs with python --- tests/api.c | 2 +- wolfcrypt/src/asn.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api.c b/tests/api.c index e749ce8fa..2c983a732 100644 --- a/tests/api.c +++ b/tests/api.c @@ -53815,7 +53815,7 @@ static int test_MakeCertWith0Ser(void) wc_InitDecodedCert(&decodedCert, der, (word32)derSize, NULL); -#ifndef WOLFSSL_NO_ASN_STRICT +#if !defined(WOLFSSL_NO_ASN_STRICT) && !defined(WOLFSSL_PYTHON) ExpectIntEQ(wc_ParseCert(&decodedCert, CERT_TYPE, NO_VERIFY, NULL), ASN_PARSE_E); #else diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index c31fa2a43..6a8038e0e 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -21876,7 +21876,7 @@ static int DecodeCertInternal(DecodedCert* cert, int verify, int* criticalExt, cert->version = version; cert->serialSz = (int)serialSz; - #ifndef WOLFSSL_NO_ASN_STRICT + #if !defined(WOLFSSL_NO_ASN_STRICT) && !defined(WOLFSSL_PYTHON) /* RFC 5280 section 4.1.2.2 states that non-conforming CAs may issue * a negative or zero serial number and should be handled gracefully. * Since it is a non-conforming CA that issues a serial of 0 then we