Skip to content

Commit 9fa1d2e

Browse files
Enforce WOLFSSL_MAX_PATH_LEN for ASN original as well.
1 parent bfacbf9 commit 9fa1d2e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

wolfcrypt/src/asn.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20614,7 +20614,12 @@ static int DecodeBasicCaConstraint(const byte* input, int sz, DecodedCert* cert)
2061420614
ret = GetInteger16Bit(input, &idx, (word32)sz);
2061520615
if (ret < 0)
2061620616
return ret;
20617-
cert->pathLength = (byte)ret;
20617+
else if (ret > WOLFSSL_MAX_PATH_LEN) {
20618+
WOLFSSL_ERROR_VERBOSE(ASN_PATHLEN_SIZE_E);
20619+
return ASN_PATHLEN_SIZE_E;
20620+
}
20621+
20622+
cert->pathLength = (word16)ret;
2061820623
cert->pathLengthSet = 1;
2061920624

2062020625
return 0;

0 commit comments

Comments
 (0)