From b34879b61a89ee0ec5ed0124deabac6fa669f281 Mon Sep 17 00:00:00 2001 From: Moran Peker Date: Tue, 29 May 2018 16:45:14 +0300 Subject: [PATCH] fix import_export_public_key test to use policy --- tests/suites/test_suite_psa_crypto.function | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 6458aa382..65b4739cb 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -545,6 +545,7 @@ void import_export_public_key( char *hex, size_t exported_length; psa_key_type_t got_type; size_t got_bits; + psa_key_policy_t policy = {0}; data = unhexify_alloc( hex, &data_size ); TEST_ASSERT( data != NULL ); @@ -554,6 +555,13 @@ void import_export_public_key( char *hex, TEST_ASSERT( psa_crypto_init( ) == PSA_SUCCESS ); + psa_key_policy_init( &policy ); + + psa_key_policy_set_usage( &policy, PSA_KEY_USAGE_EXPORT, + PSA_ALG_VENDOR_FLAG ); + + TEST_ASSERT( psa_set_key_policy( slot, &policy ) == PSA_SUCCESS ); + /* Import the key */ TEST_ASSERT( psa_import_key( slot, type, data, data_size ) == PSA_SUCCESS );