mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-19 05:43:14 +03:00
Get hash_alg by mbedtls_psa_translate_md
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
@ -1121,8 +1121,8 @@ static int ssl_tls13_parse_server_pre_shared_key_ext(mbedtls_ssl_context *ssl,
|
|||||||
#endif
|
#endif
|
||||||
if (mbedtls_ssl_conf_has_static_psk(ssl->conf)) {
|
if (mbedtls_ssl_conf_has_static_psk(ssl->conf)) {
|
||||||
ret = ssl_tls13_psk_get_psk(ssl, &hash_alg, &psk, &psk_len);
|
ret = ssl_tls13_psk_get_psk(ssl, &hash_alg, &psk, &psk_len);
|
||||||
if (ssl_tls13_get_ciphersuite_hash_alg(
|
if (mbedtls_psa_translate_md(ssl->handshake->ciphersuite_info->mac)
|
||||||
ssl->session_negotiate->ciphersuite) != hash_alg) {
|
!= hash_alg) {
|
||||||
MBEDTLS_SSL_DEBUG_MSG(
|
MBEDTLS_SSL_DEBUG_MSG(
|
||||||
1, ("Invalid ciphersuite for external psk."));
|
1, ("Invalid ciphersuite for external psk."));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user