mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Merge pull request #4499 from SparkiDev/dec_ku_len
KeyUsage dcoding: Ensure data length is 1 or 2
This commit is contained in:
@@ -14986,6 +14986,9 @@ static int DecodeKeyUsage(const byte* input, int sz, DecodedCert* cert)
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
if (length == 0 || length > 2)
|
||||
return ASN_PARSE_E;
|
||||
|
||||
cert->extKeyUsage = (word16)(input[idx]);
|
||||
if (length == 2)
|
||||
cert->extKeyUsage |= (word16)(input[idx+1] << 8);
|
||||
|
Reference in New Issue
Block a user