Add tests for import hooks in the driver wrappers

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek
2022-02-04 07:12:30 -05:00
parent 349a059f5f
commit 96c8f9e89d
4 changed files with 21 additions and 6 deletions

View File

@@ -42,9 +42,13 @@ 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;
} mbedtls_test_driver_key_management_hooks_t;
#define MBEDTLS_TEST_DRIVER_KEY_MANAGEMENT_INIT { NULL, 0, PSA_SUCCESS, 0 }
/* 0x800000 is a vendor-specific location, unused by the PSA, overwritten
* in tests that expect a different value. */
#define MBEDTLS_TEST_DRIVER_KEY_MANAGEMENT_INIT { NULL, 0, PSA_SUCCESS, 0, 0x800000 }
static inline mbedtls_test_driver_key_management_hooks_t
mbedtls_test_driver_key_management_hooks_init( void )
{