Change signature of mbedtls_psa_platform_get_builtin_key
Instead of the full attributes struct, it now only takes/returns what it
actually needs to.
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c
index 68943c1..232e544 100644
--- a/library/psa_crypto_slot_management.c
+++ b/library/psa_crypto_slot_management.c
@@ -281,6 +281,7 @@
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
+ psa_key_lifetime_t lifetime = PSA_KEY_LIFETIME_VOLATILE;
psa_drv_slot_number_t slot_number = 0;
uint8_t *key_buffer = NULL;
size_t key_buffer_size = 0;
@@ -295,10 +296,14 @@
/* Check the platform function to see whether this key actually exists */
psa_set_key_id( &attributes, slot->attr.id );
- status = mbedtls_psa_platform_get_builtin_key( &attributes, &slot_number );
+ status = mbedtls_psa_platform_get_builtin_key(
+ slot->attr.id, &lifetime, &slot_number );
if( status != PSA_SUCCESS )
return( status );
+ /* Set mapped lifetime on the attributes */
+ psa_set_key_lifetime( &attributes, lifetime );
+
/* If the key should exist according to the platform, load it through the
* driver interface. */
status = psa_driver_wrapper_get_key_buffer_size( &attributes,