1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +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 95aad8378c
commit 3f860e4c18
3 changed files with 1 additions and 33 deletions

View File

@ -3513,13 +3513,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 )
@ -3577,13 +3570,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,