Skip to content

Commit 172fd65

Browse files
author
Nir Sonnenschein
committed
Fix for resource leak in crypto compliance test 43
Destroy key after import key in a loop
1 parent 95d0c4d commit 172fd65

File tree

1 file changed

+4
-0
lines changed
  • components/TARGET_PSA/TESTS/compliance_crypto/test_c043

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ int32_t psa_key_agreement_test(security_t caller)
108108
/* Abort a generator */
109109
status = val->crypto_function(VAL_CRYPTO_GENERATOR_ABORT, &generator);
110110
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(12));
111+
112+
/* Destroy a key and restore the slot to its default state */
113+
status = val->crypto_function(VAL_CRYPTO_DESTROY_KEY, check1[i].key_handle);
114+
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(13));
111115
}
112116

113117
return VAL_STATUS_SUCCESS;

0 commit comments

Comments
 (0)