mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-16 04:20:49 +00:00
Fix state logic and return codes
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
83f09ef056
commit
40ef3a9454
@ -3555,8 +3555,8 @@ psa_status_t psa_aead_generate_nonce( psa_aead_operation_t *operation,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if( operation->nonce_set || operation->lengths_set ||
|
||||
operation->ad_started || operation->body_started )
|
||||
if( operation->nonce_set || operation->ad_started ||
|
||||
operation->body_started )
|
||||
{
|
||||
status = PSA_ERROR_BAD_STATE;
|
||||
goto exit;
|
||||
@ -3845,7 +3845,7 @@ psa_status_t psa_aead_verify( psa_aead_operation_t *operation,
|
||||
if( operation->lengths_set && (operation->ad_remaining != 0 ||
|
||||
operation->body_remaining != 0 ) )
|
||||
{
|
||||
status = PSA_ERROR_BAD_STATE;
|
||||
status = PSA_ERROR_INVALID_ARGUMENT;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user