mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 12:15:41 +01:00
Check the return status of the functions first
Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
parent
42373bdde7
commit
809634d5d9
@ -485,16 +485,17 @@ static psa_status_t cipher_encrypt( const psa_key_attributes_t *attributes,
|
|||||||
output + operation.iv_length,
|
output + operation.iv_length,
|
||||||
output_size - operation.iv_length,
|
output_size - operation.iv_length,
|
||||||
&olength );
|
&olength );
|
||||||
accumulated_length += olength;
|
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
accumulated_length += olength;
|
||||||
|
|
||||||
status = cipher_finish( &operation, output + accumulated_length,
|
status = cipher_finish( &operation, output + accumulated_length,
|
||||||
output_size - accumulated_length, &olength );
|
output_size - accumulated_length, &olength );
|
||||||
accumulated_length += olength;
|
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
accumulated_length += olength;
|
||||||
*output_length = accumulated_length;
|
*output_length = accumulated_length;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
@ -534,17 +535,17 @@ static psa_status_t cipher_decrypt( const psa_key_attributes_t *attributes,
|
|||||||
status = cipher_update( &operation, input + operation.iv_length,
|
status = cipher_update( &operation, input + operation.iv_length,
|
||||||
input_length - operation.iv_length,
|
input_length - operation.iv_length,
|
||||||
output, output_size, &olength );
|
output, output_size, &olength );
|
||||||
accumulated_length = olength;
|
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
accumulated_length = olength;
|
||||||
|
|
||||||
status = cipher_finish( &operation, output + accumulated_length,
|
status = cipher_finish( &operation, output + accumulated_length,
|
||||||
output_size - accumulated_length, &olength );
|
output_size - accumulated_length, &olength );
|
||||||
accumulated_length += olength;
|
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
|
accumulated_length += olength;
|
||||||
*output_length = accumulated_length;
|
*output_length = accumulated_length;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
Loading…
Reference in New Issue
Block a user