mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-06-25 12:41:56 +03:00
set output length to zero to cover output length in error case
This commit is contained in:
@ -1491,6 +1491,7 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key,
|
|||||||
size_t key_bits;
|
size_t key_bits;
|
||||||
unsigned char tag[16];
|
unsigned char tag[16];
|
||||||
mbedtls_cipher_id_t cipher_id;
|
mbedtls_cipher_id_t cipher_id;
|
||||||
|
*ciphertext_length = 0;
|
||||||
|
|
||||||
if( ciphertext_size < ( plaintext_length + sizeof( tag ) ) )
|
if( ciphertext_size < ( plaintext_length + sizeof( tag ) ) )
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
|
Reference in New Issue
Block a user