diff options
author | David Hu <david.hu@arm.com> | 2020-03-25 15:48:53 +0800 |
---|---|---|
committer | David Hu <david.hu@arm.com> | 2020-06-22 02:33:00 +0000 |
commit | 6d2bc65f3fbc215eae6116228902c9c4e65e5a43 (patch) | |
tree | 95d60336905dcdb2ed35120ee430c968f701b202 /platform/include | |
parent | aa342d5b4b70703cf9ad5f72752caa757f322ea3 (diff) | |
download | trusted-firmware-m-6d2bc65f3fbc215eae6116228902c9c4e65e5a43.tar.gz |
Attest: Support kid parameter in COSE_Mac0 structure header
Add a HAL API tfm_plat_get_symmetric_iak_id() to fetch kid from
platform.
Implement an example of this HAL API.
Add attest_get_symmetric_iak_id() to pass the kid value to token
generation of symmetric key algorithm based Initial Attestation.
Change-Id: I642f7a03f1738c8fe77f11fc2ae91652fc01df29
Signed-off-by: David Hu <david.hu@arm.com>
Diffstat (limited to 'platform/include')
-rw-r--r-- | platform/include/tfm_plat_crypto_keys.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/include/tfm_plat_crypto_keys.h b/platform/include/tfm_plat_crypto_keys.h index f9934cdff4..035fd38309 100644 --- a/platform/include/tfm_plat_crypto_keys.h +++ b/platform/include/tfm_plat_crypto_keys.h @@ -104,6 +104,25 @@ enum tfm_plat_err_t tfm_plat_get_symmetric_iak(uint8_t *key_buf, size_t buf_len, size_t *key_len, psa_algorithm_t *key_alg); + +#ifdef INCLUDE_COSE_KEY_ID +/** + * \brief Get the key identifier of the symmetric Initial Attestation Key as the + * 'kid' parameter in COSE Header. + * + * \note This `kid` parameter is included in COSE Header. Please don't confuse + * it with that `kid` in COSE_Key structure. + * + * \param[out] kid_buf The buffer to be written with key id + * \param[in] buf_len The length of kid_buf + * \param[out] kid_len The length of key id + * + * \return Returns error code specified in \ref tfm_plat_err_t. + */ +enum tfm_plat_err_t tfm_plat_get_symmetric_iak_id(void *kid_buf, + size_t buf_len, + size_t *kid_len); +#endif #else /* SYMMETRIC_INITIAL_ATTESTATION */ /** * \brief Get the initial attestation key |