From cb0a7cd142257658c116a10c9d2926ba1b46bab6 Mon Sep 17 00:00:00 2001 From: Mateusz Starzyk Date: Thu, 19 Aug 2021 15:11:50 +0200 Subject: [PATCH] Fix mac_key_policy test function Signed-off-by: Mateusz Starzyk --- tests/suites/test_suite_psa_crypto.function | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 150a3f43e3..3fe512e8e7 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -818,7 +818,7 @@ void mac_key_policy( int policy_usage_arg, mbedtls_test_update_key_usage_flags( policy_usage ) ); status = psa_mac_sign_setup( &operation, key, exercise_alg ); - if( ( policy_usage & PSA_KEY_USAGE_SIGN_HASH ) == 0 ) + if( ( mbedtls_test_update_key_usage_flags(policy_usage) & PSA_KEY_USAGE_SIGN_MESSAGE ) == 0 ) TEST_EQUAL( status, PSA_ERROR_NOT_PERMITTED ); else TEST_EQUAL( status, expected_status ); @@ -827,7 +827,7 @@ void mac_key_policy( int policy_usage_arg, memset( mac, 0, sizeof( mac ) ); status = psa_mac_verify_setup( &operation, key, exercise_alg ); - if( ( policy_usage & PSA_KEY_USAGE_VERIFY_HASH ) == 0 ) + if( ( mbedtls_test_update_key_usage_flags(policy_usage) & PSA_KEY_USAGE_VERIFY_MESSAGE ) == 0 ) TEST_EQUAL( status, PSA_ERROR_NOT_PERMITTED ); else TEST_EQUAL( status, expected_status );