Attest: Accept empty shared data area
Introduce the BOOT_DATA_AVAILABLE CMake variable to indicate whether
boot data is available in the shared data area (between the boot loader
and runtime firmware). If it's false the content of the shared data area
will be ignored and thus all the tests will pass for example when TF-M
is used with a boot loader that doesn't provide any boot data or when a
boot loader is not used at all.
Change-Id: Ic6d32cfdc8741018c6668692d64f81236006b593
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/secure_fw/services/initial_attestation/tfm_attestation.c b/secure_fw/services/initial_attestation/tfm_attestation.c
index 1b8757a..7e20b2e 100644
--- a/secure_fw/services/initial_attestation/tfm_attestation.c
+++ b/secure_fw/services/initial_attestation/tfm_attestation.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -57,22 +57,12 @@
uint32_t len)
{
enum psa_attest_err_t attest_res = PSA_ATTEST_ERR_SUCCESS;
-
-#ifndef BL2
- /* Avoid compiler warning due to unused argument */
- (void)len;
- (void)major_type;
-
- boot_data->header.tlv_magic = SHARED_DATA_TLV_INFO_MAGIC;
- boot_data->header.tlv_tot_len = SHARED_DATA_HEADER_SIZE;
-#else
int32_t tfm_res;
tfm_res = tfm_core_get_boot_data(major_type, boot_data, len);
if (tfm_res != (int32_t)TFM_SUCCESS) {
attest_res = PSA_ATTEST_ERR_INIT_FAILED;
}
-#endif /* BL2 */
return attest_res;
}