Add test for calling update when nonce not set

Previously only testing calling update_ad in this state.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
Paul Elliott 2021-09-01 12:08:29 +01:00
parent c6d11d02f5
commit 7f62842247

View file

@ -4224,6 +4224,19 @@ void aead_multipart_state_test( int key_type_arg, data_t *key_data,
psa_aead_abort( &operation );
/* ------------------------------------------------------- */
operation = psa_aead_operation_init( );
PSA_ASSERT( psa_aead_encrypt_setup( &operation, key, alg ) );
TEST_EQUAL( psa_aead_update( &operation, input_data->x,
input_data->len, output_data,
output_size, &output_length ),
PSA_ERROR_BAD_STATE );
psa_aead_abort( &operation );
/* Test for double setting nonce. */
operation = psa_aead_operation_init( );