summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDemi Marie Obenour <demiobenour@gmail.com>2022-12-08 15:24:31 -0500
committerSandrine Bailleux <sandrine.bailleux@arm.com>2023-01-03 17:49:16 +0100
commitca34dbc0cdb1c4e1ab62aa4dd195cf9389b9edb7 (patch)
tree6a283d027f9e857bb7aa87589f30c0ae6bbc530e /drivers
parent8816dbb3819e626d14e1bb9702f6446cb80e26f0 (diff)
downloadarm-trusted-firmware-ca34dbc0cdb1c4e1ab62aa4dd195cf9389b9edb7.tar.gz
fix(auth): reject junk after certificates
Certificates must not allow trailing junk after them. Change-Id: Ie33205fb051fc63af5b72c326822da7f62eec1d1 Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/auth/mbedtls/mbedtls_x509_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/auth/mbedtls/mbedtls_x509_parser.c b/drivers/auth/mbedtls/mbedtls_x509_parser.c
index 87f280c13..d8f201e98 100644
--- a/drivers/auth/mbedtls/mbedtls_x509_parser.c
+++ b/drivers/auth/mbedtls/mbedtls_x509_parser.c
@@ -178,7 +178,7 @@ static int cert_parse(void *img, unsigned int img_len)
return IMG_PARSER_ERR_FORMAT;
}
- if (len > (size_t)(end - p)) {
+ if (len != (size_t)(end - p)) {
return IMG_PARSER_ERR_FORMAT;
}
crt_end = p + len;