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.
This commit is contained in:
John Safranek
2019-11-25 15:09:08 -08:00
parent 5e0ca866df
commit 1ac0b1fc0b

View File

@@ -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 */