mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-29 22:20:30 +00:00
tests fix + max_output_size
This commit is contained in:
parent
9e3aa62c13
commit
a9c3a658be
@ -319,8 +319,6 @@ void cipher_test_encrypt( int alg_arg, int key_type_arg,
|
|||||||
if( expected_status == PSA_SUCCESS )
|
if( expected_status == PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
TEST_ASSERT( psa_cipher_abort( &operation ) == PSA_SUCCESS );
|
TEST_ASSERT( psa_cipher_abort( &operation ) == PSA_SUCCESS );
|
||||||
|
|
||||||
TEST_ASSERT( input_size == output_size );
|
|
||||||
TEST_ASSERT( memcmp( expected_output, output, output_size ) == 0 );
|
TEST_ASSERT( memcmp( expected_output, output, output_size ) == 0 );
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
@ -443,7 +441,7 @@ void cipher_test_decrypt_multipart( int alg_arg, int key_type_arg,
|
|||||||
TEST_ASSERT( psa_encrypt_set_iv( &operation,
|
TEST_ASSERT( psa_encrypt_set_iv( &operation,
|
||||||
iv, sizeof( iv ) ) == PSA_SUCCESS );
|
iv, sizeof( iv ) ) == PSA_SUCCESS );
|
||||||
|
|
||||||
output_simax_output_sizeze_1 = input_size + operation.block_size;
|
max_output_size = input_size + operation.block_size;
|
||||||
output = mbedtls_calloc( 1, max_output_size );
|
output = mbedtls_calloc( 1, max_output_size );
|
||||||
|
|
||||||
TEST_ASSERT( (unsigned int) first_part_size < input_size );
|
TEST_ASSERT( (unsigned int) first_part_size < input_size );
|
||||||
@ -515,7 +513,7 @@ void cipher_test_decrypt( int alg_arg, int key_type_arg,
|
|||||||
iv, sizeof( iv ) ) == PSA_SUCCESS );
|
iv, sizeof( iv ) ) == PSA_SUCCESS );
|
||||||
|
|
||||||
max_output_size = input_size + operation.block_size;
|
max_output_size = input_size + operation.block_size;
|
||||||
output = mbedtls_calloc( 1, output_size );
|
output = mbedtls_calloc( 1, max_output_size );
|
||||||
|
|
||||||
TEST_ASSERT( psa_cipher_update( &operation, input, input_size,
|
TEST_ASSERT( psa_cipher_update( &operation, input, input_size,
|
||||||
output, max_output_size,
|
output, max_output_size,
|
||||||
@ -527,8 +525,6 @@ void cipher_test_decrypt( int alg_arg, int key_type_arg,
|
|||||||
if( expected_status == PSA_SUCCESS )
|
if( expected_status == PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
TEST_ASSERT( psa_cipher_abort( &operation ) == PSA_SUCCESS );
|
TEST_ASSERT( psa_cipher_abort( &operation ) == PSA_SUCCESS );
|
||||||
|
|
||||||
TEST_ASSERT( input_size == output_size );
|
|
||||||
TEST_ASSERT( memcmp( expected_output, output, output_size ) == 0 );
|
TEST_ASSERT( memcmp( expected_output, output, output_size ) == 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user