mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Initialize output buffer length to 0
Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
@@ -3493,6 +3493,8 @@ psa_status_t psa_cipher_encrypt( mbedtls_svc_key_id_t key,
|
|||||||
psa_key_type_t key_type;
|
psa_key_type_t key_type;
|
||||||
size_t iv_length;
|
size_t iv_length;
|
||||||
|
|
||||||
|
*output_length = 0;
|
||||||
|
|
||||||
if( ! PSA_ALG_IS_CIPHER( alg ) )
|
if( ! PSA_ALG_IS_CIPHER( alg ) )
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
|
|
||||||
@@ -3545,6 +3547,8 @@ psa_status_t psa_cipher_decrypt( mbedtls_svc_key_id_t key,
|
|||||||
psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
psa_key_slot_t *slot;
|
psa_key_slot_t *slot;
|
||||||
|
|
||||||
|
*output_length = 0;
|
||||||
|
|
||||||
if( ! PSA_ALG_IS_CIPHER( alg ) )
|
if( ! PSA_ALG_IS_CIPHER( alg ) )
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user