mirror of https://github.com/ARMmbed/mbed-os.git
Attestation: Add a new define for attestation private key id
parent
0a0bb04dfa
commit
636753b404
|
@ -44,6 +44,8 @@ utest::v1::status_t greentea_test_setup(const size_t number_of_cases)
|
|||
return greentea_test_setup_handler(number_of_cases);
|
||||
}
|
||||
|
||||
#define PSA_ATTESTATION_PRIVATE_KEY_ID 17
|
||||
|
||||
static const uint8_t private_key_data[] = {
|
||||
0x49, 0xc9, 0xa8, 0xc1, 0x8c, 0x4b, 0x88, 0x56,
|
||||
0x38, 0xc4, 0x31, 0xcf, 0x1d, 0xf1, 0xc9, 0x94,
|
||||
|
@ -113,7 +115,7 @@ static void check_initial_attestation_get_token()
|
|||
|
||||
utest::v1::status_t case_teardown_handler(const Case *const source, const size_t passed, const size_t failed, const failure_t reason)
|
||||
{
|
||||
const psa_key_id_t key_id = 17;
|
||||
const psa_key_id_t key_id = PSA_ATTESTATION_PRIVATE_KEY_ID;
|
||||
psa_key_handle_t handle = 0;
|
||||
psa_open_key(PSA_KEY_LIFETIME_PERSISTENT, key_id, &handle);
|
||||
psa_destroy_key(handle);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <string.h>
|
||||
|
||||
static psa_hash_operation_t hash_handle;
|
||||
#define PSA_ATTESTATION_PRIVATE_KEY_ID 17
|
||||
|
||||
enum t_cose_err_t
|
||||
t_cose_crypto_pub_key_sign(int32_t cose_alg_id,
|
||||
|
@ -35,7 +36,7 @@ t_cose_crypto_pub_key_sign(int32_t cose_alg_id,
|
|||
|
||||
(void)key_select;
|
||||
|
||||
const psa_key_id_t key_id = 17;
|
||||
const psa_key_id_t key_id = PSA_ATTESTATION_PRIVATE_KEY_ID;
|
||||
psa_key_handle_t handle = 0;
|
||||
|
||||
crypto_ret = psa_crypto_init();
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
|
||||
#define ONE_BYTE (1u)
|
||||
#define PSA_ATTESTATION_PRIVATE_KEY_ID 17
|
||||
|
||||
/**
|
||||
* \brief Copy the key to the destination buffer
|
||||
|
@ -92,7 +93,7 @@ tfm_plat_get_initial_attest_key(uint8_t *key_buf,
|
|||
uint32_t initial_attestation_public_x_key_size = 0;
|
||||
uint32_t initial_attestation_public_y_key_size = 0;
|
||||
|
||||
const psa_key_id_t key_id = 17;
|
||||
const psa_key_id_t key_id = PSA_ATTESTATION_PRIVATE_KEY_ID;
|
||||
psa_key_handle_t handle = 0;
|
||||
|
||||
crypto_ret = psa_crypto_init();
|
||||
|
|
|
@ -30,11 +30,12 @@
|
|||
extern int32_t g_caller_id;
|
||||
|
||||
#define ATTEST_PUB_KEY_SHA_256_SIZE (32u)
|
||||
#define PSA_ATTESTATION_PRIVATE_KEY_ID 17
|
||||
|
||||
/* Hash of attestation public key */
|
||||
static enum tfm_plat_err_t attest_public_key_sha256(uint32_t *size, uint8_t *buf)
|
||||
{
|
||||
const psa_key_id_t key_id = 17;
|
||||
const psa_key_id_t key_id = PSA_ATTESTATION_PRIVATE_KEY_ID;
|
||||
psa_key_handle_t handle = 0;
|
||||
|
||||
uint8_t *public_key = NULL;
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "psa_inject_attestation_key_impl.h"
|
||||
|
||||
#define ECDSA_P256_KEY_SIZE_IN_BYTES 32
|
||||
#define PSA_ATTESTATION_PRIVATE_KEY_ID 17
|
||||
|
||||
psa_status_t
|
||||
psa_attestation_inject_key_impl(const uint8_t *key_data,
|
||||
|
@ -30,7 +31,7 @@ psa_attestation_inject_key_impl(const uint8_t *key_data,
|
|||
psa_status_t status = PSA_SUCCESS;
|
||||
size_t key_data_bits = 0;
|
||||
psa_key_handle_t handle = 1;
|
||||
psa_key_id_t key_id = 17;
|
||||
psa_key_id_t key_id = PSA_ATTESTATION_PRIVATE_KEY_ID;
|
||||
psa_key_lifetime_t lifetime = PSA_KEY_LIFETIME_PERSISTENT;
|
||||
psa_key_policy_t policy = PSA_KEY_POLICY_INIT;
|
||||
psa_key_usage_t usage = PSA_KEY_USAGE_EXPORT | PSA_KEY_USAGE_SIGN;
|
||||
|
|
Loading…
Reference in New Issue