From 1ac0b1fc0be035acb6b0b6a8bec4b93641913f17 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 25 Nov 2019 15:09:08 -0800 Subject: [PATCH] Maintenance: ASN.1 1. Undo an earlier change with respect to parsing a long length with length zero. If BerToDer is disabled, this will be treated as a zero length. With BerToDer enabled, the conversion will do the right thing. --- wolfcrypt/src/asn.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 60e789008..a5c2ccac6 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -179,11 +179,7 @@ WOLFSSL_LOCAL int GetLength_ex(const byte* input, word32* inOutIdx, int* len, } b = input[idx++]; - if (b == ASN_LONG_LENGTH) { - WOLFSSL_MSG("GetLength bad length length"); - return ASN_PARSE_E; - } - else if (b > ASN_LONG_LENGTH) { + if (b >= ASN_LONG_LENGTH) { word32 bytes = b & 0x7F; if ((idx + bytes) > maxIdx) { /* for reading bytes */