mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-07-30 16:26:33 +08:00
Remove unreachable CSR extensionRequest check
It is now unreachable because: - end_set == end_attr_data is enforced at library/x509_csr.c:236. - end_exts == end_set is enforced at library/x509_csr.c:248. - x509_csr_parse_extensions() only returns success if *p == end_exts, enforced at library/x509_csr.c:188. So after a successful x509_csr_parse_extensions() call, *p == end_exts == end_set == end_attr_data. The condition at line 257 cannot be true. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
44b833324b
commit
ef81e71061
@ -253,11 +253,8 @@ static int x509_csr_parse_attributes(mbedtls_x509_csr *csr,
|
||||
if ((ret = x509_csr_parse_extensions(csr, p, end_exts, cb, p_ctx)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (*p != end_attr_data) {
|
||||
return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_X509_INVALID_EXTENSIONS,
|
||||
MBEDTLS_ERR_ASN1_LENGTH_MISMATCH);
|
||||
}
|
||||
/* x509_csr_parse_extensions() guarantees *p == end_exts
|
||||
* on success */
|
||||
}
|
||||
|
||||
*p = end_attr_data;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user