From 252304594bc37a9466efd067d41a133fc1ab7001 Mon Sep 17 00:00:00 2001 From: gabor-mezei-arm Date: Tue, 29 Jun 2021 19:06:30 +0200 Subject: [PATCH] Fix minor issues Signed-off-by: gabor-mezei-arm --- library/psa_crypto_cipher.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/library/psa_crypto_cipher.c b/library/psa_crypto_cipher.c index c309cfb18..4dd277209 100644 --- a/library/psa_crypto_cipher.c +++ b/library/psa_crypto_cipher.c @@ -395,7 +395,7 @@ static psa_status_t cipher_update( mbedtls_psa_cipher_operation_t *operation, input_length, output, output_length ) ); if( *output_length > output_size ) - return PSA_ERROR_CORRUPTION_DETECTED; + return( PSA_ERROR_CORRUPTION_DETECTED ); } return( status ); @@ -495,8 +495,7 @@ static psa_status_t cipher_encrypt( const psa_key_attributes_t *attributes, if( status != PSA_SUCCESS ) goto exit; - accumulated_length += olength; - *output_length = accumulated_length; + *output_length = accumulated_length + olength; exit: if( status == PSA_SUCCESS ) @@ -545,8 +544,7 @@ static psa_status_t cipher_decrypt( const psa_key_attributes_t *attributes, if( status != PSA_SUCCESS ) goto exit; - accumulated_length += olength; - *output_length = accumulated_length; + *output_length = accumulated_length + olength; exit: if ( status == PSA_SUCCESS )