From 4c12c334cfd04b895c3b3059f1ef204de8b3a502 Mon Sep 17 00:00:00 2001 From: Kareem Date: Thu, 9 Mar 2023 16:06:52 -0700 Subject: [PATCH] Allow alternative absolute URI syntax in certificate general name. --- wolfcrypt/src/asn.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 400f91871..d8d79c52f 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -16684,8 +16684,7 @@ static int DecodeGeneralName(const byte* input, word32* inOutIdx, byte tag, /* test if no ':' char was found and test that the next two * chars are "//" to match the pattern "://" */ - if (i >= len - 2 || (input[idx + i + 1] != '/' || - input[idx + i + 2] != '/')) { + if (input[idx + i] != ':' || i == 0 || i == len) { WOLFSSL_MSG("\tAlt Name must be absolute URI"); WOLFSSL_ERROR_VERBOSE(ASN_ALT_NAME_E); return ASN_ALT_NAME_E;