1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Merge pull request #7546 from mpg/align-psa-md-identifiers

Align psa md identifiers
This commit is contained in:
Manuel Pégourié-Gonnard
2023-07-20 11:34:28 +02:00
committed by GitHub
8 changed files with 82 additions and 91 deletions

View File

@ -8807,11 +8807,17 @@ unsigned int mbedtls_ssl_tls12_get_preferred_hash_for_sig_alg(
MBEDTLS_SSL_TLS12_SIG_ALG_FROM_SIG_AND_HASH_ALG(
received_sig_algs[i]);
mbedtls_md_type_t md_alg =
mbedtls_ssl_md_alg_from_hash((unsigned char) hash_alg_received);
if (md_alg == MBEDTLS_MD_NONE) {
continue;
}
if (sig_alg == sig_alg_received) {
#if defined(MBEDTLS_USE_PSA_CRYPTO)
if (ssl->handshake->key_cert && ssl->handshake->key_cert->key) {
psa_algorithm_t psa_hash_alg =
mbedtls_md_psa_alg_from_type(hash_alg_received);
mbedtls_md_psa_alg_from_type(md_alg);
if (sig_alg_received == MBEDTLS_SSL_SIG_ECDSA &&
!mbedtls_pk_can_do_ext(ssl->handshake->key_cert->key,