mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-10 15:40:30 +00:00
Reject escaped null hexpairs in DNs
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
parent
01e9392c3f
commit
9caaa6d967
@ -187,6 +187,9 @@ static int parse_attribute_value_string(const char *s,
|
|||||||
|
|
||||||
/* Check for valid escaped characters in RFC 4514 in Section 3*/
|
/* Check for valid escaped characters in RFC 4514 in Section 3*/
|
||||||
if (c + 1 < end && (n = hexpair_to_int(*c, *(c+1))) != -1) {
|
if (c + 1 < end && (n = hexpair_to_int(*c, *(c+1))) != -1) {
|
||||||
|
if(n == 0) {
|
||||||
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
|
}
|
||||||
hexpair = 1;
|
hexpair = 1;
|
||||||
*(d++) = n;
|
*(d++) = n;
|
||||||
c++;
|
c++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user