Note about destroying a key with other open handles
https://github.com/ARMmbed/mbed-crypto/issues/214
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 4fee3cd..66c5151 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1052,8 +1052,11 @@
#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C)
if( slot->attr.lifetime != PSA_KEY_LIFETIME_VOLATILE )
{
- storage_status =
- psa_destroy_persistent_key( slot->attr.id );
+ storage_status = psa_destroy_persistent_key( slot->attr.id );
+ /* TODO: other slots may have a copy of the same key. We should
+ * invalidate them.
+ * https://github.com/ARMmbed/mbed-crypto/issues/214
+ */
}
#endif /* defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) */