mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Refactor opaque key handling in the test driver
Builtin key support for the test driver is always compiled in, and no longer guarded by MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS. Parsing the key slot from the buffer by cast and assign instead of memcmp. For exporting keys, the test driver no longer reaches into the key identifier in order to check whether a key is builtin, but rather assumes so based on the key buffer length. It's the driver's responsibility to be able to detect the key material it returned as part of the get_builtin_key operation. Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
@ -29,14 +29,9 @@
|
||||
#if defined(PSA_CRYPTO_DRIVER_TEST)
|
||||
#include <psa/crypto_driver_common.h>
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS)
|
||||
#define PSA_CRYPTO_TEST_DRIVER_BUILTIN_AES_KEY_SLOT 0
|
||||
#define PSA_CRYPTO_TEST_DRIVER_BUILTIN_ECDSA_KEY_SLOT 1
|
||||
|
||||
extern const uint8_t test_driver_aes_key[16];
|
||||
extern const uint8_t test_driver_ecdsa_key[32];
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
/* If non-null, on success, copy this to the output. */
|
||||
void *forced_output;
|
||||
|
Reference in New Issue
Block a user