Set output length to safe value
This commit is contained in:
parent
c460291714
commit
ca466c89b0
1 changed files with 2 additions and 0 deletions
|
@ -1422,6 +1422,7 @@ psa_status_t psa_asymmetric_encrypt(psa_key_slot_t key,
|
||||||
key_slot_t *slot;
|
key_slot_t *slot;
|
||||||
(void) salt;
|
(void) salt;
|
||||||
(void) salt_length;
|
(void) salt_length;
|
||||||
|
*output_length = 0;
|
||||||
|
|
||||||
if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT )
|
if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT )
|
||||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||||
|
@ -1495,6 +1496,7 @@ psa_status_t psa_asymmetric_decrypt(psa_key_slot_t key,
|
||||||
key_slot_t *slot;
|
key_slot_t *slot;
|
||||||
(void) salt;
|
(void) salt;
|
||||||
(void) salt_length;
|
(void) salt_length;
|
||||||
|
*output_length = 0;
|
||||||
|
|
||||||
if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT )
|
if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT )
|
||||||
return( PSA_ERROR_EMPTY_SLOT );
|
return( PSA_ERROR_EMPTY_SLOT );
|
||||||
|
|
Loading…
Reference in a new issue