Ensure operation id gets set even if failure
Although this deviates from the standard "auto-generated" code, the M-AEAD setup functions set the key and thus allocate memory. If the failure occurs after this (invalid tag size for example) then not having the id set to the internal drivers means that abort does not get called, and this causes the allocated data to leak. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
ac3c20013c
commit
72baf65819
1 changed files with 2 additions and 4 deletions
|
@ -1330,8 +1330,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
|
|||
key_buffer, key_buffer_size,
|
||||
alg );
|
||||
|
||||
if( status == PSA_SUCCESS )
|
||||
operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
|
||||
operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
|
||||
|
||||
return( status );
|
||||
|
||||
|
@ -1382,8 +1381,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
|
|||
key_buffer, key_buffer_size,
|
||||
alg );
|
||||
|
||||
if( status == PSA_SUCCESS )
|
||||
operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
|
||||
operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
|
||||
|
||||
return( status );
|
||||
|
||||
|
|
Loading…
Reference in a new issue