mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Remove multipart part from mac_sign test case
Signed-off-by: Przemyslaw Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
@ -1247,60 +1247,8 @@ void mac_sign( int key_type_arg,
|
|||||||
else
|
else
|
||||||
TEST_EQUAL( forced_status, status );
|
TEST_EQUAL( forced_status, status );
|
||||||
|
|
||||||
if( mac_buffer_size > 0 )
|
|
||||||
memset( actual_mac, 0, mac_buffer_size );
|
|
||||||
mbedtls_test_driver_mac_hooks = mbedtls_test_driver_mac_hooks_init();
|
|
||||||
mbedtls_test_driver_mac_hooks.forced_status = forced_status;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Calculate the MAC, multipart case.
|
|
||||||
*/
|
|
||||||
status = psa_mac_sign_setup( &operation, key, alg );
|
|
||||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 1 );
|
|
||||||
|
|
||||||
if( forced_status == PSA_SUCCESS ||
|
|
||||||
forced_status == PSA_ERROR_NOT_SUPPORTED )
|
|
||||||
{
|
|
||||||
PSA_ASSERT( status );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
TEST_EQUAL( forced_status, status );
|
|
||||||
|
|
||||||
status = psa_mac_update( &operation,
|
|
||||||
input->x, input->len );
|
|
||||||
if( forced_status == PSA_SUCCESS )
|
|
||||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 2 );
|
|
||||||
else
|
|
||||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 1 );
|
|
||||||
if( forced_status == PSA_SUCCESS ||
|
|
||||||
forced_status == PSA_ERROR_NOT_SUPPORTED )
|
|
||||||
{
|
|
||||||
PSA_ASSERT( status );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
TEST_EQUAL( PSA_ERROR_BAD_STATE, status );
|
|
||||||
|
|
||||||
status = psa_mac_sign_finish( &operation,
|
|
||||||
actual_mac, mac_buffer_size,
|
|
||||||
&mac_length );
|
|
||||||
if( forced_status == PSA_SUCCESS )
|
|
||||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 4 );
|
|
||||||
else
|
|
||||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 1 );
|
|
||||||
|
|
||||||
if( forced_status == PSA_SUCCESS ||
|
|
||||||
forced_status == PSA_ERROR_NOT_SUPPORTED )
|
|
||||||
{
|
|
||||||
PSA_ASSERT( status );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
TEST_EQUAL( PSA_ERROR_BAD_STATE, status );
|
|
||||||
|
|
||||||
PSA_ASSERT( psa_mac_abort( &operation ) );
|
PSA_ASSERT( psa_mac_abort( &operation ) );
|
||||||
if( forced_status == PSA_SUCCESS )
|
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 1 );
|
||||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 4 );
|
|
||||||
else
|
|
||||||
TEST_EQUAL( mbedtls_test_driver_mac_hooks.hits, 1 );
|
|
||||||
|
|
||||||
if( forced_status == PSA_SUCCESS )
|
if( forced_status == PSA_SUCCESS )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user