diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index fbd7195ccd..f79d9b3d9e 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -1188,7 +1188,7 @@ static int test_operations_on_invalid_handle( psa_key_handle_t handle ) psa_set_key_algorithm( &attributes, PSA_ALG_CTR ); psa_set_key_type( &attributes, PSA_KEY_TYPE_AES ); TEST_EQUAL( psa_get_key_attributes( handle, &attributes ), - PSA_ERROR_INVALID_HANDLE ); + PSA_ERROR_DOES_NOT_EXIST ); TEST_EQUAL( MBEDTLS_SVC_KEY_ID_GET_KEY_ID( psa_get_key_id( &attributes ) ), 0 ); TEST_EQUAL( @@ -1201,10 +1201,10 @@ static int test_operations_on_invalid_handle( psa_key_handle_t handle ) TEST_EQUAL( psa_export_key( handle, buffer, sizeof( buffer ), &length ), - PSA_ERROR_INVALID_HANDLE ); + PSA_ERROR_DOES_NOT_EXIST ); TEST_EQUAL( psa_export_public_key( handle, buffer, sizeof( buffer ), &length ), - PSA_ERROR_INVALID_HANDLE ); + PSA_ERROR_DOES_NOT_EXIST ); ok = 1; diff --git a/tests/suites/test_suite_psa_crypto_slot_management.data b/tests/suites/test_suite_psa_crypto_slot_management.data index 10521e1d51..2b3087ff94 100644 --- a/tests/suites/test_suite_psa_crypto_slot_management.data +++ b/tests/suites/test_suite_psa_crypto_slot_management.data @@ -156,10 +156,10 @@ invalid handle: 0 invalid_handle:INVALID_HANDLE_0:PSA_SUCCESS:PSA_ERROR_INVALID_HANDLE invalid handle: never opened -invalid_handle:INVALID_HANDLE_UNOPENED:PSA_ERROR_INVALID_HANDLE:PSA_ERROR_INVALID_HANDLE +invalid_handle:INVALID_HANDLE_UNOPENED:PSA_ERROR_DOES_NOT_EXIST:PSA_ERROR_DOES_NOT_EXIST invalid handle: already closed -invalid_handle:INVALID_HANDLE_CLOSED:PSA_ERROR_INVALID_HANDLE:PSA_ERROR_INVALID_HANDLE +invalid_handle:INVALID_HANDLE_CLOSED:PSA_ERROR_DOES_NOT_EXIST:PSA_ERROR_DOES_NOT_EXIST invalid handle: huge invalid_handle:INVALID_HANDLE_HUGE:PSA_ERROR_INVALID_HANDLE:PSA_ERROR_INVALID_HANDLE diff --git a/tests/suites/test_suite_psa_crypto_slot_management.function b/tests/suites/test_suite_psa_crypto_slot_management.function index c688474aa5..fe3e5f9872 100644 --- a/tests/suites/test_suite_psa_crypto_slot_management.function +++ b/tests/suites/test_suite_psa_crypto_slot_management.function @@ -165,8 +165,8 @@ void transient_slot_lifecycle( int usage_arg, int alg_arg, /* Test that the handle is now invalid. */ TEST_EQUAL( psa_get_key_attributes( handle, &attributes ), - PSA_ERROR_INVALID_HANDLE ); - TEST_EQUAL( psa_close_key( handle ), PSA_ERROR_INVALID_HANDLE ); + PSA_ERROR_DOES_NOT_EXIST ); + TEST_EQUAL( psa_close_key( handle ), PSA_ERROR_DOES_NOT_EXIST ); exit: PSA_DONE( ); @@ -253,9 +253,9 @@ void persistent_slot_lifecycle( int lifetime_arg, int owner_id_arg, int id_arg, /* Test that the handle is now invalid. */ TEST_EQUAL( psa_get_key_attributes( handle, &read_attributes ), - PSA_ERROR_INVALID_HANDLE ); + PSA_ERROR_DOES_NOT_EXIST ); psa_reset_key_attributes( &read_attributes ); - TEST_EQUAL( psa_close_key( handle ), PSA_ERROR_INVALID_HANDLE ); + TEST_EQUAL( psa_close_key( handle ), PSA_ERROR_DOES_NOT_EXIST ); /* Try to reopen the key. If we destroyed it, check that it doesn't * exist. Otherwise check that it still exists and has the expected