mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-04 03:26:54 +02:00
psa_core: Added a retval in psa_aead_final_checks()
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
This commit is contained in:
@@ -5523,6 +5523,10 @@ exit:
|
||||
|
||||
static psa_status_t psa_aead_final_checks(const psa_aead_operation_t *operation)
|
||||
{
|
||||
if (operation->alg == PSA_ALG_CCM && !operation->lengths_set) {
|
||||
return PSA_ERROR_BAD_STATE;
|
||||
}
|
||||
|
||||
if (operation->id == 0 || !operation->nonce_set) {
|
||||
return PSA_ERROR_BAD_STATE;
|
||||
}
|
||||
|
||||
@@ -6496,7 +6496,7 @@ void aead_multipart_state_test(int key_type_arg, data_t *key_data,
|
||||
&output_part_length,
|
||||
tag_buffer, tag_length,
|
||||
&tag_size),
|
||||
PSA_ERROR_INVALID_ARGUMENT);
|
||||
PSA_ERROR_BAD_STATE);
|
||||
psa_aead_abort(&operation);
|
||||
|
||||
PSA_ASSERT(psa_aead_encrypt_setup(&operation, key, alg));
|
||||
@@ -6617,7 +6617,7 @@ void aead_multipart_state_test(int key_type_arg, data_t *key_data,
|
||||
&output_part_length,
|
||||
tag_buffer, tag_length,
|
||||
&tag_size),
|
||||
PSA_ERROR_INVALID_ARGUMENT);
|
||||
PSA_ERROR_BAD_STATE);
|
||||
psa_aead_abort(&operation);
|
||||
|
||||
PSA_ASSERT(psa_aead_encrypt_setup(&operation, key, alg));
|
||||
|
||||
Reference in New Issue
Block a user