mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-26 01:15:37 +00:00
Use more standard label name
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
parent
54f7351d12
commit
478ab5443b
|
@ -2486,13 +2486,13 @@ psa_status_t psa_mac_sign_finish( psa_mac_operation_t *operation,
|
||||||
if( operation->id == 0 )
|
if( operation->id == 0 )
|
||||||
{
|
{
|
||||||
status = PSA_ERROR_BAD_STATE;
|
status = PSA_ERROR_BAD_STATE;
|
||||||
goto cleanup;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! operation->is_sign )
|
if( ! operation->is_sign )
|
||||||
{
|
{
|
||||||
status = PSA_ERROR_BAD_STATE;
|
status = PSA_ERROR_BAD_STATE;
|
||||||
goto cleanup;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sanity check. This will guarantee that mac_size != 0 (and so mac != NULL)
|
/* Sanity check. This will guarantee that mac_size != 0 (and so mac != NULL)
|
||||||
|
@ -2500,20 +2500,20 @@ psa_status_t psa_mac_sign_finish( psa_mac_operation_t *operation,
|
||||||
if( operation->mac_size == 0 )
|
if( operation->mac_size == 0 )
|
||||||
{
|
{
|
||||||
status = PSA_ERROR_BAD_STATE;
|
status = PSA_ERROR_BAD_STATE;
|
||||||
goto cleanup;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( mac_size < operation->mac_size )
|
if( mac_size < operation->mac_size )
|
||||||
{
|
{
|
||||||
status = PSA_ERROR_BUFFER_TOO_SMALL;
|
status = PSA_ERROR_BUFFER_TOO_SMALL;
|
||||||
goto cleanup;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = psa_driver_wrapper_mac_sign_finish( operation,
|
status = psa_driver_wrapper_mac_sign_finish( operation,
|
||||||
mac, operation->mac_size,
|
mac, operation->mac_size,
|
||||||
mac_length );
|
mac_length );
|
||||||
|
|
||||||
cleanup:
|
exit:
|
||||||
/* In case of success, set the potential excess room in the output buffer
|
/* In case of success, set the potential excess room in the output buffer
|
||||||
* to an invalid value, to avoid potentially leaking a longer MAC.
|
* to an invalid value, to avoid potentially leaking a longer MAC.
|
||||||
* In case of error, set the output length and content to a safe default,
|
* In case of error, set the output length and content to a safe default,
|
||||||
|
@ -2545,25 +2545,25 @@ psa_status_t psa_mac_verify_finish( psa_mac_operation_t *operation,
|
||||||
if( operation->id == 0 )
|
if( operation->id == 0 )
|
||||||
{
|
{
|
||||||
status = PSA_ERROR_BAD_STATE;
|
status = PSA_ERROR_BAD_STATE;
|
||||||
goto cleanup;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( operation->is_sign )
|
if( operation->is_sign )
|
||||||
{
|
{
|
||||||
status = PSA_ERROR_BAD_STATE;
|
status = PSA_ERROR_BAD_STATE;
|
||||||
goto cleanup;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( operation->mac_size != mac_length )
|
if( operation->mac_size != mac_length )
|
||||||
{
|
{
|
||||||
status = PSA_ERROR_INVALID_SIGNATURE;
|
status = PSA_ERROR_INVALID_SIGNATURE;
|
||||||
goto cleanup;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = psa_driver_wrapper_mac_verify_finish( operation,
|
status = psa_driver_wrapper_mac_verify_finish( operation,
|
||||||
mac, mac_length );
|
mac, mac_length );
|
||||||
|
|
||||||
cleanup:
|
exit:
|
||||||
abort_status = psa_mac_abort( operation );
|
abort_status = psa_mac_abort( operation );
|
||||||
|
|
||||||
return( status == PSA_SUCCESS ? abort_status : status );
|
return( status == PSA_SUCCESS ? abort_status : status );
|
||||||
|
|
Loading…
Reference in a new issue