Reject escaped null hexpairs in DNs

Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
Agathiyan Bragadeesh 2023-08-14 15:38:39 +01:00
parent 01e9392c3f
commit 9caaa6d967

View file

@ -187,6 +187,9 @@ static int parse_attribute_value_string(const char *s,
/* Check for valid escaped characters in RFC 4514 in Section 3*/
if (c + 1 < end && (n = hexpair_to_int(*c, *(c+1))) != -1) {
if(n == 0) {
return MBEDTLS_ERR_X509_INVALID_NAME;
}
hexpair = 1;
*(d++) = n;
c++;