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 <Maulik.Patel@arm.com>
This commit is contained in:
Maulik Patel 2021-03-17 15:05:13 +00:00
parent f65ad8ccc1
commit 02a1750098

View File

@ -179,7 +179,7 @@ void transient_slot_lifecycle( int owner_id_arg,
/* Test that the key is now invalid. */ /* Test that the key is now invalid. */
TEST_EQUAL( psa_get_key_attributes( key, &attributes ), TEST_EQUAL( psa_get_key_attributes( key, &attributes ),
PSA_ERROR_DOES_NOT_EXIST ); 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: 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 ), TEST_EQUAL( psa_get_key_attributes( handle, &read_attributes ),
PSA_ERROR_DOES_NOT_EXIST ); 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 ), TEST_EQUAL( psa_get_key_attributes( id, &read_attributes ),
PSA_ERROR_DOES_NOT_EXIST ); PSA_ERROR_DOES_NOT_EXIST );
break; break;