Skip to content

Commit 57ec1d5

Browse files
author
Cruz Monrreal
authored
Merge pull request #9990 from kfnta/sync_complinace_test_to_latest
Sync PSA compliance test to latest version
2 parents 277c91f + c99f03d commit 57ec1d5

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-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;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "psa-compliance-framework"
3+
}

features/frameworks/TARGET_PSA/pal/pal_mbed_os_intf.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ extern "C" psa_status_t psa_ps_reset();
2626
test_entry_f test_g = NULL;
2727
compliance_test_type type_g = COMPLIANCE_TEST_UNDEFINED;
2828

29+
// randomly generated attestation key used for testing the attestation feature.
30+
// The specific key chosen shouldn't matter to the attestation test
31+
// the test just needs a key to be injected before it is run.
2932
static const uint8_t private_key_data[] = {
3033
0x49, 0xc9, 0xa8, 0xc1, 0x8c, 0x4b, 0x88, 0x56,
3134
0x38, 0xc4, 0x31, 0xcf, 0x1d, 0xf1, 0xc9, 0x94,

features/frameworks/TARGET_PSA/psa_manifest/sid.h

Whitespace-only changes.

0 commit comments

Comments
 (0)