Safely erase key material upon abort
Some key derivation operation contexts (like
psa_tls12_prf_key_derivation_t) directly contain buffers with parts of
the derived key. Erase them safely as part of the abort.
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index bf425df..924b291 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -3902,7 +3902,7 @@
{
status = PSA_ERROR_BAD_STATE;
}
- memset( operation, 0, sizeof( *operation ) );
+ mbedtls_platform_zeroize( operation, sizeof( *operation ) );
return( status );
}