mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-01 22:20:58 +00:00
Fix bug with checking max dn length with hexpairs
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
This commit is contained in:
parent
d34c4262da
commit
c34804dea2
@ -168,13 +168,16 @@ static int parse_attribute_value_string(const char *s,
|
|||||||
}
|
}
|
||||||
*(d++) = n;
|
*(d++) = n;
|
||||||
c++;
|
c++;
|
||||||
continue;
|
} else if (c < end && strchr(" ,=+<>#;\"\\", *c)) {
|
||||||
} else if (c == end || !strchr(" ,=+<>#;\"\\", *c)) {
|
*(d++) = *c;
|
||||||
|
} else {
|
||||||
return MBEDTLS_ERR_X509_INVALID_NAME;
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
*(d++) = *c;
|
*(d++) = *c;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (d - data == MBEDTLS_X509_MAX_DN_NAME_SIZE) {
|
if (d - data == MBEDTLS_X509_MAX_DN_NAME_SIZE) {
|
||||||
return MBEDTLS_ERR_X509_INVALID_NAME;
|
return MBEDTLS_ERR_X509_INVALID_NAME;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user