mirror of https://github.com/ARMmbed/mbed-os.git
Attestation: astyle fixs
Runing astyle over attestation file to pass CIpull/9668/head
parent
a994499bf3
commit
8fc9c8fdab
|
@ -84,8 +84,8 @@ static void check_initial_attestation_get_token()
|
||||||
const psa_key_id_t key_id = 17;
|
const psa_key_id_t key_id = 17;
|
||||||
psa_key_handle_t handle = 0;
|
psa_key_handle_t handle = 0;
|
||||||
status = psa_crypto_init();
|
status = psa_crypto_init();
|
||||||
status =psa_open_key( PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle );
|
status = psa_open_key(PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle);
|
||||||
status =psa_destroy_key( handle );
|
status = psa_destroy_key(handle);
|
||||||
status = psa_attestation_inject_key(private_key_data,
|
status = psa_attestation_inject_key(private_key_data,
|
||||||
sizeof(private_key_data),
|
sizeof(private_key_data),
|
||||||
PSA_KEY_TYPE_ECC_KEYPAIR(PSA_ECC_CURVE_SECP256R1),
|
PSA_KEY_TYPE_ECC_KEYPAIR(PSA_ECC_CURVE_SECP256R1),
|
||||||
|
@ -94,8 +94,8 @@ static void check_initial_attestation_get_token()
|
||||||
&exported_length);
|
&exported_length);
|
||||||
|
|
||||||
TEST_ASSERT_EQUAL(status, PSA_SUCCESS);
|
TEST_ASSERT_EQUAL(status, PSA_SUCCESS);
|
||||||
TEST_ASSERT_EQUAL(sizeof( public_key_data ), exported_length);
|
TEST_ASSERT_EQUAL(sizeof(public_key_data), exported_length);
|
||||||
TEST_ASSERT_EQUAL(memcmp( public_key_data, exported, exported_length), 0);
|
TEST_ASSERT_EQUAL(memcmp(public_key_data, exported, exported_length), 0);
|
||||||
|
|
||||||
attest_err = psa_initial_attest_get_token_size(TEST_CHALLENGE_OBJ_SIZE,
|
attest_err = psa_initial_attest_get_token_size(TEST_CHALLENGE_OBJ_SIZE,
|
||||||
&token_size);
|
&token_size);
|
||||||
|
@ -115,8 +115,8 @@ utest::v1::status_t case_teardown_handler(const Case *const source, const size_t
|
||||||
{
|
{
|
||||||
const psa_key_id_t key_id = 17;
|
const psa_key_id_t key_id = 17;
|
||||||
psa_key_handle_t handle = 0;
|
psa_key_handle_t handle = 0;
|
||||||
psa_open_key( PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle );
|
psa_open_key(PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle);
|
||||||
psa_destroy_key( handle );
|
psa_destroy_key(handle);
|
||||||
// mbedtls_psa_cr/ypto_free();
|
// mbedtls_psa_cr/ypto_free();
|
||||||
return greentea_case_teardown_handler(source, passed, failed, reason);
|
return greentea_case_teardown_handler(source, passed, failed, reason);
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,7 @@ Case cases[] = {
|
||||||
Case("PSA attestation get token", check_initial_attestation_get_token, case_teardown_handler),
|
Case("PSA attestation get token", check_initial_attestation_get_token, case_teardown_handler),
|
||||||
};
|
};
|
||||||
|
|
||||||
Specification specification( greentea_test_setup, cases);
|
Specification specification(greentea_test_setup, cases);
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -148,11 +148,9 @@ t_cose_crypto_hash_start(struct t_cose_crypto_hash *hash_ctx,
|
||||||
void t_cose_crypto_hash_update(struct t_cose_crypto_hash *hash_ctx,
|
void t_cose_crypto_hash_update(struct t_cose_crypto_hash *hash_ctx,
|
||||||
struct useful_buf_c data_to_hash)
|
struct useful_buf_c data_to_hash)
|
||||||
{
|
{
|
||||||
if (data_to_hash.ptr != NULL)
|
if (data_to_hash.ptr != NULL) {
|
||||||
{
|
|
||||||
psa_hash_update(&hash_handle, data_to_hash.ptr, data_to_hash.len);
|
psa_hash_update(&hash_handle, data_to_hash.ptr, data_to_hash.len);
|
||||||
} else
|
} else {
|
||||||
{
|
|
||||||
/* Intentionally do nothing, just computing the size of the token */
|
/* Intentionally do nothing, just computing the size of the token */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue