Prevent leaking plaintext in psa_cipher_finish()
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index e10ca30..e5833ce 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -2463,6 +2463,7 @@
goto error;
}
+ mbedtls_zeroize( temp_output_buffer, sizeof( temp_output_buffer ) );
status = psa_cipher_abort( operation );
return( status );
@@ -2471,6 +2472,7 @@
*output_length = 0;
+ mbedtls_zeroize( temp_output_buffer, sizeof( temp_output_buffer ) );
(void) psa_cipher_abort( operation );
return( status );