Added argument to determine when to store key to memory
diff --git a/include/psa/crypto_accel_driver.h b/include/psa/crypto_accel_driver.h
index f60c2ec..803bb70 100644
--- a/include/psa/crypto_accel_driver.h
+++ b/include/psa/crypto_accel_driver.h
@@ -52,6 +52,7 @@
* It must not contain any key material yet.
* \param[in] data Buffer containing the key material to parse and import.
* \param data_length Size of \p data in bytes.
+ * \param write_to_persistent_memory Specify if the imported key needs to be written to persistent memory.
*
* \retval PSA_SUCCESS
* \retval PSA_ERROR_INVALID_ARGUMENT
@@ -61,7 +62,8 @@
*/
psa_status_t psa_import_key_into_slot_vendor( psa_key_slot_t *slot,
const uint8_t *data,
- size_t data_length );
+ size_t data_length,
+ bool write_to_persistent_memory);
/**
* \brief Generate a vendor defined key or key pair.
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index c812ff4..850a6dc 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1929,7 +1929,7 @@
#if defined (MBEDTLS_PSA_CRYPTO_ACCEL_DRV_C)
if (PSA_KEY_LIFETIME_IS_VENDOR_DEFINED(slot->attr.lifetime))
{
- status = psa_import_key_into_slot_vendor( slot, data, data_length);
+ status = psa_import_key_into_slot_vendor( slot, data, data_length, true);
goto exit;
}
else
diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c
index 7d8f4be..08ba9ea 100644
--- a/library/psa_crypto_slot_management.c
+++ b/library/psa_crypto_slot_management.c
@@ -150,7 +150,7 @@
#if defined (MBEDTLS_PSA_CRYPTO_ACCEL_DRV_C)
if (PSA_KEY_LIFETIME_IS_VENDOR_DEFINED(slot->attr.lifetime))
{
- status = psa_import_key_into_slot_vendor( slot, key_data, key_data_length);
+ status = psa_import_key_into_slot_vendor( slot, key_data, key_data_length, false);
goto exit;
}
else