mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-05-02 20:36:20 +00:00
remove superfluous calls to hash_abort
The PSA Core is already calling psa_hash_abort, so the driver doesn't have to do that explicitly. Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
5e4c18f6d9
commit
61bb8fc693
|
@ -422,8 +422,6 @@ static psa_status_t hash_update(
|
||||||
return( PSA_ERROR_BAD_STATE );
|
return( PSA_ERROR_BAD_STATE );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ret != 0 )
|
|
||||||
hash_abort( operation );
|
|
||||||
return( mbedtls_to_psa_error( ret ) );
|
return( mbedtls_to_psa_error( ret ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,15 +505,8 @@ static psa_status_t hash_finish(
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if( status == PSA_SUCCESS )
|
if( status == PSA_SUCCESS )
|
||||||
{
|
|
||||||
*hash_length = actual_hash_length;
|
*hash_length = actual_hash_length;
|
||||||
return( hash_abort( operation ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
hash_abort( operation );
|
|
||||||
return( status );
|
return( status );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static psa_status_t hash_compute(
|
static psa_status_t hash_compute(
|
||||||
|
@ -528,6 +519,7 @@ static psa_status_t hash_compute(
|
||||||
{
|
{
|
||||||
mbedtls_psa_hash_operation_t operation = MBEDTLS_PSA_HASH_OPERATION_INIT;
|
mbedtls_psa_hash_operation_t operation = MBEDTLS_PSA_HASH_OPERATION_INIT;
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
psa_status_t abort_status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
*hash_length = hash_size;
|
*hash_length = hash_size;
|
||||||
status = hash_setup( &operation, alg );
|
status = hash_setup( &operation, alg );
|
||||||
|
@ -541,11 +533,12 @@ static psa_status_t hash_compute(
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
abort_status = hash_abort( &operation );
|
||||||
if( status == PSA_SUCCESS )
|
if( status == PSA_SUCCESS )
|
||||||
status = hash_abort( &operation );
|
return( abort_status );
|
||||||
else
|
else
|
||||||
hash_abort( &operation );
|
|
||||||
return( status );
|
return( status );
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif /* INCLUDE_HASH_CORE */
|
#endif /* INCLUDE_HASH_CORE */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue