Attest: Generalize boot satus handling
Introduce wrapper structure to simplify the handling of
boot status data.
Change-Id: I4fecbf2b346e4e773a898b6013c0b351bcf5beeb
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
diff --git a/secure_fw/services/initial_attestation/tfm_attestation.c b/secure_fw/services/initial_attestation/tfm_attestation.c
index 186a58c..4dca76a 100644
--- a/secure_fw/services/initial_attestation/tfm_attestation.c
+++ b/secure_fw/services/initial_attestation/tfm_attestation.c
@@ -42,24 +42,23 @@
}
enum psa_attest_err_t
-attest_get_boot_data(uint8_t major_type, void *ptr, uint32_t len)
+attest_get_boot_data(uint8_t major_type,
+ struct tfm_boot_data *boot_data,
+ uint32_t len)
{
enum psa_attest_err_t attest_res = PSA_ATTEST_ERR_SUCCESS;
#ifndef BL2
- struct shared_data_tlv_header *tlv_header;
-
/* Avoid compiler warning due to unused argument */
(void)len;
(void)major_type;
- tlv_header = (struct shared_data_tlv_header *)ptr;
- tlv_header->tlv_magic = SHARED_DATA_TLV_INFO_MAGIC;
- tlv_header->tlv_tot_len = SHARED_DATA_HEADER_SIZE;
+ boot_data->header.tlv_magic = SHARED_DATA_TLV_INFO_MAGIC;
+ boot_data->header.tlv_tot_len = SHARED_DATA_HEADER_SIZE;
#else
enum tfm_status_e tfm_res;
- tfm_res = tfm_core_get_boot_data(major_type, ptr, len);
+ tfm_res = tfm_core_get_boot_data(major_type, boot_data, len);
if (tfm_res != TFM_SUCCESS) {
attest_res = PSA_ATTEST_ERR_INIT_FAILED;
}