From ba4cadef142112f5fcb8d1af940a7874fa909394 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Thu, 3 Feb 2022 10:27:01 -0500 Subject: [PATCH] Test drivers: rename import call source to driver location Signed-off-by: Andrzej Kurek --- tests/include/test/drivers/key_management.h | 4 ++-- tests/src/drivers/test_driver_key_management.c | 4 ++-- tests/suites/test_suite_psa_crypto_driver_wrappers.function | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/include/test/drivers/key_management.h b/tests/include/test/drivers/key_management.h index 50a7407352..1f33da1a52 100644 --- a/tests/include/test/drivers/key_management.h +++ b/tests/include/test/drivers/key_management.h @@ -38,8 +38,8 @@ typedef struct { /* Count the amount of times one of the key management driver functions * is called. */ unsigned long hits; - /* Record the source of the function call. */ - psa_key_location_t source; + /* Location of the last key management driver called to import a key. */ + psa_key_location_t location; } mbedtls_test_driver_key_management_hooks_t; /* The location is initialized to the invalid value 0x800000. Invalid in the diff --git a/tests/src/drivers/test_driver_key_management.c b/tests/src/drivers/test_driver_key_management.c index 3cfd59599e..e5f1193e98 100644 --- a/tests/src/drivers/test_driver_key_management.c +++ b/tests/src/drivers/test_driver_key_management.c @@ -262,7 +262,7 @@ psa_status_t mbedtls_test_transparent_import_key( size_t *bits) { ++mbedtls_test_driver_key_management_hooks.hits; - mbedtls_test_driver_key_management_hooks.source = PSA_KEY_LOCATION_LOCAL_STORAGE; + mbedtls_test_driver_key_management_hooks.location = PSA_KEY_LOCATION_LOCAL_STORAGE; if( mbedtls_test_driver_key_management_hooks.forced_status != PSA_SUCCESS ) return( mbedtls_test_driver_key_management_hooks.forced_status ); @@ -330,7 +330,7 @@ psa_status_t mbedtls_test_opaque_import_key( size_t *bits) { ++mbedtls_test_driver_key_management_hooks.hits; - mbedtls_test_driver_key_management_hooks.source = PSA_CRYPTO_TEST_DRIVER_LOCATION; + mbedtls_test_driver_key_management_hooks.location = PSA_CRYPTO_TEST_DRIVER_LOCATION; if( mbedtls_test_driver_key_management_hooks.forced_status != PSA_SUCCESS ) return( mbedtls_test_driver_key_management_hooks.forced_status ); diff --git a/tests/suites/test_suite_psa_crypto_driver_wrappers.function b/tests/suites/test_suite_psa_crypto_driver_wrappers.function index 1617459934..483f89b238 100644 --- a/tests/suites/test_suite_psa_crypto_driver_wrappers.function +++ b/tests/suites/test_suite_psa_crypto_driver_wrappers.function @@ -348,7 +348,7 @@ void validate_key( int force_status_arg, actual_status = psa_import_key( &attributes, key_input->x, key_input->len, &key ); TEST_EQUAL( mbedtls_test_driver_key_management_hooks.hits, 1 ); TEST_EQUAL( actual_status, expected_status ); - TEST_EQUAL( mbedtls_test_driver_key_management_hooks.source, location ); + TEST_EQUAL( mbedtls_test_driver_key_management_hooks.location, location ); exit: psa_reset_key_attributes( &attributes ); psa_destroy_key( key );