mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Define to allow badly formed ASN integers
Define: WOLFSSL_ASN_INT_LEAD_0_ANY Allows positive integers to have a leading 0 byte. DER/BER encoding specifies that leding 0 only on negative numbers (highest bit of first octet set).
This commit is contained in:
@ -460,8 +460,10 @@ static int GetASNInt(const byte* input, word32* inOutIdx, int* len,
|
|||||||
(*inOutIdx)++;
|
(*inOutIdx)++;
|
||||||
(*len)--;
|
(*len)--;
|
||||||
|
|
||||||
|
#ifndef WOLFSSL_ASN_INT_LEAD_0_ANY
|
||||||
if (*len > 0 && (input[*inOutIdx] & 0x80) == 0)
|
if (*len > 0 && (input[*inOutIdx] & 0x80) == 0)
|
||||||
return ASN_PARSE_E;
|
return ASN_PARSE_E;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user