From 4fded1359a9cb4f2d8605b8ae3fbd447cc4043a8 Mon Sep 17 00:00:00 2001 From: Gabor Mezei Date: Tue, 15 Feb 2022 16:35:23 +0100 Subject: [PATCH] Use PSA_INIT() Signed-off-by: Gabor Mezei --- tests/suites/test_suite_ssl.function | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index c35e2433d4..97f25e16ef 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -3816,6 +3816,8 @@ void psa_hkdf_extract( int alg, char *hex_ikm_string, unsigned char *output_prk = NULL; size_t ikm_len, salt_len, prk_len, output_prk_size, output_prk_len; + PSA_INIT( ); + output_prk_size = PSA_HASH_LENGTH( alg ); ASSERT_ALLOC( output_prk, output_prk_size ); @@ -3823,7 +3825,6 @@ void psa_hkdf_extract( int alg, char *hex_ikm_string, salt = mbedtls_test_unhexify_alloc( hex_salt_string, &salt_len ); prk = mbedtls_test_unhexify_alloc( hex_prk_string, &prk_len ); - PSA_ASSERT( psa_crypto_init() ); PSA_ASSERT( mbedtls_psa_hkdf_extract( alg, salt, salt_len, ikm, ikm_len, output_prk, output_prk_size, @@ -3850,12 +3851,13 @@ void psa_hkdf_extract_ret( int alg, int ret ) unsigned char *prk = NULL; size_t salt_len, ikm_len, prk_len; + PSA_INIT( ); + ASSERT_ALLOC( prk, PSA_MAC_MAX_SIZE); salt_len = 0; ikm_len = 0; prk_len = 0; - PSA_ASSERT( psa_crypto_init() ); output_ret = mbedtls_psa_hkdf_extract( alg, salt, salt_len, ikm, ikm_len, prk, PSA_MAC_MAX_SIZE, &prk_len );