mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-28 18:32:56 +00:00
psa_aead_setup: validate tag length before calling driver setup
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
86679c7bd8
commit
6ab50762e0
@ -3787,6 +3787,9 @@ static psa_status_t psa_aead_setup( psa_aead_operation_t *operation,
|
||||
.core = slot->attr
|
||||
};
|
||||
|
||||
if( ( status = psa_validate_tag_length( alg ) ) != PSA_SUCCESS )
|
||||
goto exit;
|
||||
|
||||
if( is_encrypt )
|
||||
status = psa_driver_wrapper_aead_encrypt_setup( operation,
|
||||
&attributes,
|
||||
@ -3802,9 +3805,6 @@ static psa_status_t psa_aead_setup( psa_aead_operation_t *operation,
|
||||
if( status != PSA_SUCCESS )
|
||||
goto exit;
|
||||
|
||||
if( ( status = psa_validate_tag_length( alg ) ) != PSA_SUCCESS )
|
||||
goto exit;
|
||||
|
||||
operation->key_type = psa_get_key_type( &attributes );
|
||||
|
||||
exit:
|
||||
|
Loading…
x
Reference in New Issue
Block a user