mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-24 22:56:55 +00:00
Fix incorrect length check in multipart cipher tests
The output length can be equal to the input length. This wasn't noticed at runtime because we happened to only test with CBC with the first chunk being a partial block.
This commit is contained in:
parent
ee46fe7b9b
commit
3b7e084077
|
@ -2475,7 +2475,7 @@ void cipher_encrypt_multipart( int alg_arg, int key_type_arg,
|
|||
PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) );
|
||||
ASSERT_ALLOC( output, output_buffer_size );
|
||||
|
||||
TEST_ASSERT( (unsigned int) first_part_size < input->len );
|
||||
TEST_ASSERT( (unsigned int) first_part_size <= input->len );
|
||||
PSA_ASSERT( psa_cipher_update( &operation, input->x, first_part_size,
|
||||
output, output_buffer_size,
|
||||
&function_output_length ) );
|
||||
|
@ -2546,7 +2546,7 @@ void cipher_decrypt_multipart( int alg_arg, int key_type_arg,
|
|||
PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) );
|
||||
ASSERT_ALLOC( output, output_buffer_size );
|
||||
|
||||
TEST_ASSERT( (unsigned int) first_part_size < input->len );
|
||||
TEST_ASSERT( (unsigned int) first_part_size <= input->len );
|
||||
PSA_ASSERT( psa_cipher_update( &operation,
|
||||
input->x, first_part_size,
|
||||
output, output_buffer_size,
|
||||
|
@ -2772,7 +2772,7 @@ void cipher_verify_output_multipart( int alg_arg,
|
|||
PSA_BLOCK_CIPHER_BLOCK_SIZE( key_type ) );
|
||||
ASSERT_ALLOC( output1, output1_buffer_size );
|
||||
|
||||
TEST_ASSERT( (unsigned int) first_part_size < input->len );
|
||||
TEST_ASSERT( (unsigned int) first_part_size <= input->len );
|
||||
|
||||
PSA_ASSERT( psa_cipher_update( &operation1, input->x, first_part_size,
|
||||
output1, output1_buffer_size,
|
||||
|
|
Loading…
Reference in a new issue