diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index c83e63c0f..a112f6c2e 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -15,6 +15,7 @@ #include "psa/crypto.h" #endif #include +#include "hash_info.h" #include #include @@ -1444,16 +1445,12 @@ static int build_transforms( mbedtls_ssl_transform *t_in, if( cipher_info->mode == MBEDTLS_MODE_CBC || cipher_info->mode == MBEDTLS_MODE_STREAM ) { -#if defined(MBEDTLS_USE_PSA_CRYPTO) - maclen = mbedtls_hash_info_get_size( hash_id ); -#else - mbedtls_md_info_t const *md_info; - - /* Pick hash */ - md_info = mbedtls_md_info_from_type( hash_id ); +#if !defined(MBEDTLS_USE_PSA_CRYPTO) + mbedtls_md_info_t const *md_info = mbedtls_md_info_from_type( hash_id ); CHK( md_info != NULL ); - maclen = mbedtls_md_get_size( md_info ); -#endif /* MBEDTLS_USE_PSA_CRYPTO */ +#endif + maclen = mbedtls_hash_info_get_size( hash_id ); + CHK( maclen != 0 ); /* Pick hash keys */ CHK( ( md0 = mbedtls_calloc( 1, maclen ) ) != NULL ); CHK( ( md1 = mbedtls_calloc( 1, maclen ) ) != NULL );