Fix for resource leak in crypto compliance test 43

Destroy key after import key in a loop
pull/9312/head
Nir Sonnenschein 2019-03-05 17:10:27 +02:00
parent 95d0c4d38d
commit 172fd650a2
1 changed files with 4 additions and 0 deletions

View File

@ -108,6 +108,10 @@ int32_t psa_key_agreement_test(security_t caller)
/* Abort a generator */
status = val->crypto_function(VAL_CRYPTO_GENERATOR_ABORT, &generator);
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(12));
/* Destroy a key and restore the slot to its default state */
status = val->crypto_function(VAL_CRYPTO_DESTROY_KEY, check1[i].key_handle);
TEST_ASSERT_EQUAL(status, PSA_SUCCESS, TEST_CHECKPOINT_NUM(13));
}
return VAL_STATUS_SUCCESS;