1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Remove invalid buffer overflow check

Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
gabor-mezei-arm
2021-06-29 16:39:49 +02:00
parent 9ac4847a5d
commit 6f8d43df20
3 changed files with 1 additions and 33 deletions

View File

@ -3511,13 +3511,6 @@ psa_status_t psa_cipher_encrypt( mbedtls_svc_key_id_t key,
key_type = slot->attr.type;
iv_length = PSA_CIPHER_IV_LENGTH( key_type, alg );
if( output_size < PSA_CIPHER_ENCRYPT_OUTPUT_SIZE( key_type, alg,
input_length ) )
{
status = PSA_ERROR_BUFFER_TOO_SMALL;
goto exit;
}
if( iv_length > 0 )
{
if( output_size < iv_length )
@ -3575,13 +3568,6 @@ psa_status_t psa_cipher_decrypt( mbedtls_svc_key_id_t key,
goto exit;
}
if( output_size < PSA_CIPHER_DECRYPT_OUTPUT_SIZE( slot->attr.type, alg,
input_length ) )
{
status = PSA_ERROR_BUFFER_TOO_SMALL;
goto exit;
}
status = psa_driver_wrapper_cipher_decrypt(
&attributes, slot->key.data, slot->key.bytes,
alg, input, input_length,