Skip to content

Commit d473f6d

Browse files
author
Nir Sonnenschein
committed
synchronize latest fix to tests
synchronize latest fix to test_c043
1 parent 4edb6da commit d473f6d

File tree

1 file changed

+10
-7
lines changed
  • components/TARGET_PSA/TESTS/compliance_crypto/test_c043

1 file changed

+10
-7
lines changed

components/TARGET_PSA/TESTS/compliance_crypto/test_c043/test_c043.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,32 +86,35 @@ int32_t psa_key_agreement_test(security_t caller)
8686
/* Abort a generator */
8787
status = val->crypto_function(VAL_CRYPTO_GENERATOR_ABORT, &generator);
8888
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(7));
89+
/* Destroy a key and restore the slot to its default state */
90+
status = val->crypto_function(VAL_CRYPTO_DESTROY_KEY, check1[i].key_handle);
91+
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(8));
8992
continue;
9093
}
9194

9295
/* Retrieve the current capacity of a generator */
9396
status = val->crypto_function(VAL_CRYPTO_GET_GENERATOR_CAPACITY, &generator, &capacity);
94-
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(8));
97+
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(9));
9598

9699
/* Check if the generator capacity matches with the expected capacity */
97-
TEST_ASSERT_EQUAL(capacity, check1[i].expected_capacity, TEST_CHECKPOINT_NUM(9));
100+
TEST_ASSERT_EQUAL(capacity, check1[i].expected_capacity, TEST_CHECKPOINT_NUM(10));
98101

99102
/* Read some data from a generator */
100103
status = val->crypto_function(VAL_CRYPTO_GENERATOR_READ, &generator, output,
101104
check1[i].expected_output_length);
102-
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(10));
105+
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(11));
103106

104107
/* Check if the output matches with the expected data */
105108
TEST_ASSERT_MEMCMP(output, check1[i].expected_output, check1[i].expected_output_length,
106-
TEST_CHECKPOINT_NUM(11));
109+
TEST_CHECKPOINT_NUM(12));
107110

108111
/* Abort a generator */
109112
status = val->crypto_function(VAL_CRYPTO_GENERATOR_ABORT, &generator);
110-
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(12));
111-
113+
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(13));
114+
112115
/* Destroy a key and restore the slot to its default state */
113116
status = val->crypto_function(VAL_CRYPTO_DESTROY_KEY, check1[i].key_handle);
114-
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(13));
117+
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(14));
115118
}
116119

117120
return VAL_STATUS_SUCCESS;

0 commit comments

Comments
 (0)