From 02a175009818da6a60bbf71892f311f6cf6d3d3f Mon Sep 17 00:00:00 2001 From: Maulik Patel Date: Wed, 17 Mar 2021 15:05:13 +0000 Subject: [PATCH] Update tests for psa_close_key for invalid key. Update expected return values of psa_close_key() to PSA_ERROR_INVALID_HANDLE for invalid key handle operations. Signed-off-by: Maulik Patel --- tests/suites/test_suite_psa_crypto_slot_management.function | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/suites/test_suite_psa_crypto_slot_management.function b/tests/suites/test_suite_psa_crypto_slot_management.function index bafb7d8bf..9b07c8cfd 100644 --- a/tests/suites/test_suite_psa_crypto_slot_management.function +++ b/tests/suites/test_suite_psa_crypto_slot_management.function @@ -179,7 +179,7 @@ void transient_slot_lifecycle( int owner_id_arg, /* Test that the key is now invalid. */ TEST_EQUAL( psa_get_key_attributes( key, &attributes ), PSA_ERROR_DOES_NOT_EXIST ); - TEST_EQUAL( psa_close_key( key ), PSA_ERROR_DOES_NOT_EXIST ); + TEST_EQUAL( psa_close_key( key ), PSA_ERROR_INVALID_HANDLE ); exit: /* @@ -327,7 +327,7 @@ void persistent_slot_lifecycle( int lifetime_arg, int owner_id_arg, int id_arg, */ TEST_EQUAL( psa_get_key_attributes( handle, &read_attributes ), PSA_ERROR_DOES_NOT_EXIST ); - TEST_EQUAL( psa_close_key( handle ), PSA_ERROR_DOES_NOT_EXIST ); + TEST_EQUAL( psa_close_key( handle ), PSA_ERROR_INVALID_HANDLE ); TEST_EQUAL( psa_get_key_attributes( id, &read_attributes ), PSA_ERROR_DOES_NOT_EXIST ); break;