Skip to content

Commit 725f22a

Browse files
Bug fix: save the driver's persistent data in destroy_key
1 parent adad813 commit 725f22a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/psa_crypto.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,11 @@ psa_status_t psa_destroy_key( psa_key_handle_t handle )
10071007
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
10081008
if( driver != NULL )
10091009
{
1010-
status = psa_crypto_stop_transaction( );
1010+
psa_status_t status2;
1011+
status = psa_save_se_persistent_data( driver );
1012+
status2 = psa_crypto_stop_transaction( );
1013+
if( status == PSA_SUCCESS )
1014+
status = status2;
10111015
if( status != PSA_SUCCESS )
10121016
{
10131017
/* TOnogrepDO: destroy what can be destroyed anyway */

0 commit comments

Comments
 (0)