From ca466c89b09e2ad7ae23e47a1142c0f9129c309a Mon Sep 17 00:00:00 2001 From: Nir Sonnenschein Date: Mon, 4 Jun 2018 16:43:12 +0300 Subject: [PATCH] Set output length to safe value --- library/psa_crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index c1c47d231..ba688bccd 100755 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -1422,6 +1422,7 @@ psa_status_t psa_asymmetric_encrypt(psa_key_slot_t key, key_slot_t *slot; (void) salt; (void) salt_length; + *output_length = 0; if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT ) return( PSA_ERROR_INVALID_ARGUMENT ); @@ -1495,6 +1496,7 @@ psa_status_t psa_asymmetric_decrypt(psa_key_slot_t key, key_slot_t *slot; (void) salt; (void) salt_length; + *output_length = 0; if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT ) return( PSA_ERROR_EMPTY_SLOT );