Final feedback from @ronald-cron-arm
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 8383eae..931e2e9 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -4088,9 +4088,11 @@
alg );
if( status == PSA_SUCCESS )
+ {
/* Once the driver context is initialised, it needs to be freed using
* psa_cipher_abort. Indicate this through setting alg. */
operation->alg = alg;
+ }
if( status != PSA_ERROR_NOT_SUPPORTED ||
psa_key_lifetime_is_external( slot->attr.lifetime ) )
@@ -4491,10 +4493,7 @@
else if( output_size >= *output_length )
memcpy( output, temp_output_buffer, *output_length );
else
- {
status = PSA_ERROR_BUFFER_TOO_SMALL;
- goto exit;
- }
exit:
if( operation->mbedtls_in_use == 1 )
@@ -4505,8 +4504,6 @@
else
{
*output_length = 0;
-
- mbedtls_platform_zeroize( temp_output_buffer, sizeof( temp_output_buffer ) );
(void) psa_cipher_abort( operation );
return( status );