From 7f6284224799746a0c93a31fc46afc49249acbbd Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Wed, 1 Sep 2021 12:08:29 +0100 Subject: [PATCH] Add test for calling update when nonce not set Previously only testing calling update_ad in this state. Signed-off-by: Paul Elliott --- tests/suites/test_suite_psa_crypto.function | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index e01c49588..0c009811c 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -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( );