Skip to content

Commit

Permalink
Final feedback from @ronald-cron-arm
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Cooreman <[email protected]>
  • Loading branch information
stevew817 committed Sep 14, 2020
1 parent ef8575e commit 6d81f7e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions library/psa_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -4088,9 +4088,11 @@ static psa_status_t psa_cipher_setup( psa_cipher_operation_t *operation,
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 ) )
Expand Down Expand Up @@ -4491,10 +4493,7 @@ psa_status_t psa_cipher_finish( psa_cipher_operation_t *operation,
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 )
Expand All @@ -4505,8 +4504,6 @@ psa_status_t psa_cipher_finish( psa_cipher_operation_t *operation,
else
{
*output_length = 0;

mbedtls_platform_zeroize( temp_output_buffer, sizeof( temp_output_buffer ) );
(void) psa_cipher_abort( operation );

return( status );
Expand Down

0 comments on commit 6d81f7e

Please sign in to comment.