Simplify testing psa_key_derivation_input_*() bad state
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function
index 9516867..531e82b 100644
--- a/tests/suites/test_suite_psa_crypto.function
+++ b/tests/suites/test_suite_psa_crypto.function
@@ -8839,7 +8839,9 @@
psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_DERIVE);
psa_set_key_algorithm(&attributes, alg);
- PSA_ASSERT(psa_key_derivation_setup(&operation, alg));
+ if (alg != 0) {
+ PSA_ASSERT(psa_key_derivation_setup(&operation, alg));
+ }
for (i = 0; i < ARRAY_LENGTH(steps); i++) {
mbedtls_test_set_step(i);
@@ -8893,25 +8895,6 @@
}
TEST_EQUAL(actual_output_status, expected_output_status);
- /* Test calling input functions after operation has been aborted
- result in PSA_ERROR_BAD_STATE error.
- */
- psa_key_derivation_abort(&operation);
- for (i = 0; i < ARRAY_LENGTH(steps); i++) {
- if (key_types[i] == INPUT_INTEGER) {
- TEST_EQUAL(psa_key_derivation_input_integer(
- &operation, steps[i],
- mbedtls_test_parse_binary_string(inputs[i])),
- PSA_ERROR_BAD_STATE);
- break;
- }
- }
-
- TEST_EQUAL(psa_key_derivation_input_bytes(
- &operation, steps[0],
- inputs[0]->x, inputs[0]->len),
- PSA_ERROR_BAD_STATE);
-
exit:
psa_key_derivation_abort(&operation);
for (i = 0; i < ARRAY_LENGTH(keys); i++) {