Test PSA_MAC_FINAL_SIZE in mac_sign exactly

We expect PSA_MAC_FINAL_SIZE to be exact in this implementation, so
check it here.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2020-08-25 23:47:36 +02:00
parent ed19762a22
commit 3d404d677e

View File

@ -3038,7 +3038,8 @@ void mac_sign( int key_type_arg,
memset( actual_mac, '+', sizeof( actual_mac ) );
TEST_ASSERT( mac_buffer_size <= PSA_MAC_MAX_SIZE );
TEST_ASSERT( expected_mac->len <= mac_buffer_size );
/* We expect PSA_MAC_FINAL_SIZE to be exact. */
TEST_ASSERT( expected_mac->len == mac_buffer_size );
PSA_ASSERT( psa_crypto_init( ) );