mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2025-12-06 07:12:32 +01:00
Reject null bytes in DER encoded values in DNs
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
parent
eb55867520
commit
f826d1113e
|
|
@ -239,6 +239,9 @@ static int parse_attribute_value_ber_encoded(const char *s,
|
||||||
if ((c + 1 >= end) || (n = hexpair_to_int(*c, *(c+1))) == -1) {
|
if ((c + 1 >= end) || (n = hexpair_to_int(*c, *(c+1))) == -1) {
|
||||||
return MBEDTLS_ERR_X509_INVALID_NAME;
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
}
|
}
|
||||||
|
if (MBEDTLS_ASN1_IS_STRING_TAG(*tag) && n == 0) {
|
||||||
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
|
}
|
||||||
*(p++) = n;
|
*(p++) = n;
|
||||||
}
|
}
|
||||||
asn1_der_end = p;
|
asn1_der_end = p;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue