Minor refactoring of generic SSL certificate verif

Rename as there was a name collision with a static function in another
file: ssl_parse_certificate_verify in ssl_tls12_server.c is the function
that parses the CertificateVerify message, which seems appropriate. Here
it meant "the 'verify' step after parsing the Certificate message".
Use a name that focuses on what it does: verify, not parse.

Also, take ciphersuite_info as an argument: when TLS 1.3 calls this
function, it can pass NULL as the ciphersuite has no influence there.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard 2024-08-16 10:01:48 +02:00
parent 843a00dec6
commit 908f57dfba

View File

@ -7939,14 +7939,13 @@ static int ssl_parse_certificate_coordinate(mbedtls_ssl_context *ssl,
} }
MBEDTLS_CHECK_RETURN_CRITICAL MBEDTLS_CHECK_RETURN_CRITICAL
static int ssl_parse_certificate_verify(mbedtls_ssl_context *ssl, static int ssl_verify_certificate(mbedtls_ssl_context *ssl,
int authmode, int authmode,
mbedtls_x509_crt *chain, mbedtls_x509_crt *chain,
void *rs_ctx) const mbedtls_ssl_ciphersuite_t *ciphersuite_info,
void *rs_ctx)
{ {
int ret = 0; int ret = 0;
const mbedtls_ssl_ciphersuite_t *ciphersuite_info =
ssl->handshake->ciphersuite_info;
int have_ca_chain_or_callback = 0; int have_ca_chain_or_callback = 0;
if (authmode == MBEDTLS_SSL_VERIFY_NONE) { if (authmode == MBEDTLS_SSL_VERIFY_NONE) {
@ -8246,8 +8245,8 @@ crt_verify:
} }
#endif #endif
ret = ssl_parse_certificate_verify(ssl, authmode, ret = ssl_verify_certificate(ssl, authmode, chain,
chain, rs_ctx); ssl->handshake->ciphersuite_info, rs_ctx);
if (ret != 0) { if (ret != 0) {
goto exit; goto exit;
} }