diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function index 34ebdccb7..f7ef421b5 100644 --- a/tests/suites/test_suite_pk.function +++ b/tests/suites/test_suite_pk.function @@ -7,6 +7,8 @@ #include "mbedtls/ecp.h" #include "mbedtls/rsa.h" +#include "md_internal.h" + #include #include @@ -1316,8 +1318,7 @@ void pk_psa_sign_ext( int pk_type, int parameter, int key_pk_type, int md_alg ) size_t sig_len; unsigned char sig[MBEDTLS_PK_SIGNATURE_MAX_SIZE]; unsigned char hash[MBEDTLS_MD_MAX_SIZE]; - const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type( md_alg ); - size_t hash_len = mbedtls_md_get_size( md_info ); + size_t hash_len = mbedtls_md_internal_get_size( md_alg ); void const *options = NULL; mbedtls_pk_rsassa_pss_options rsassa_pss_options; memset( hash, 0x2a, sizeof( hash ) ); @@ -1338,8 +1339,8 @@ void pk_psa_sign_ext( int pk_type, int parameter, int key_pk_type, int md_alg ) if( key_pk_type == MBEDTLS_PK_RSASSA_PSS ) { rsassa_pss_options.mgf1_hash_id = md_alg; - TEST_ASSERT( md_info != NULL ); - rsassa_pss_options.expected_salt_len = mbedtls_md_get_size( md_info ); + TEST_ASSERT( hash_len != 0 ); + rsassa_pss_options.expected_salt_len = hash_len; options = (const void*) &rsassa_pss_options; } TEST_ASSERT( mbedtls_pk_verify_ext( key_pk_type, options, &pk, md_alg,