mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-05 06:26:52 +00:00
Initialize output buffer length to 0
Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
parent
01e99083a5
commit
6f4e5bbe37
1 changed files with 4 additions and 0 deletions
|
|
@ -3495,6 +3495,8 @@ psa_status_t psa_cipher_encrypt( mbedtls_svc_key_id_t key,
|
|||
psa_key_type_t key_type;
|
||||
size_t iv_length;
|
||||
|
||||
*output_length = 0;
|
||||
|
||||
if( ! PSA_ALG_IS_CIPHER( alg ) )
|
||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
|
||||
|
|
@ -3547,6 +3549,8 @@ psa_status_t psa_cipher_decrypt( mbedtls_svc_key_id_t key,
|
|||
psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||
psa_key_slot_t *slot;
|
||||
|
||||
*output_length = 0;
|
||||
|
||||
if( ! PSA_ALG_IS_CIPHER( alg ) )
|
||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue