forked from wolfSSL/wolfssl
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:
@@ -179,11 +179,7 @@ WOLFSSL_LOCAL int GetLength_ex(const byte* input, word32* inOutIdx, int* len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
b = input[idx++];
|
b = input[idx++];
|
||||||
if (b == ASN_LONG_LENGTH) {
|
if (b >= ASN_LONG_LENGTH) {
|
||||||
WOLFSSL_MSG("GetLength bad length length");
|
|
||||||
return ASN_PARSE_E;
|
|
||||||
}
|
|
||||||
else if (b > ASN_LONG_LENGTH) {
|
|
||||||
word32 bytes = b & 0x7F;
|
word32 bytes = b & 0x7F;
|
||||||
|
|
||||||
if ((idx + bytes) > maxIdx) { /* for reading bytes */
|
if ((idx + bytes) > maxIdx) { /* for reading bytes */
|
||||||
|
Reference in New Issue
Block a user