mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-25 13:43:31 +00:00
Erase secrets in allocated memory before freeing said memory
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
4579a972bf
commit
cd5be32191
@ -349,6 +349,7 @@ psa_status_t psa_save_persistent_key( const psa_core_key_attributes_t *attr,
|
|||||||
status = psa_crypto_storage_store( attr->id,
|
status = psa_crypto_storage_store( attr->id,
|
||||||
storage_data, storage_data_length );
|
storage_data, storage_data_length );
|
||||||
|
|
||||||
|
mbedtls_platform_zeroize( storage_data, storage_data_length );
|
||||||
mbedtls_free( storage_data );
|
mbedtls_free( storage_data );
|
||||||
|
|
||||||
return( status );
|
return( status );
|
||||||
@ -394,6 +395,7 @@ psa_status_t psa_load_persistent_key( psa_core_key_attributes_t *attr,
|
|||||||
status = PSA_ERROR_STORAGE_FAILURE;
|
status = PSA_ERROR_STORAGE_FAILURE;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
mbedtls_platform_zeroize( loaded_data, storage_data_length );
|
||||||
mbedtls_free( loaded_data );
|
mbedtls_free( loaded_data );
|
||||||
return( status );
|
return( status );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user