refactor(measured boot): rename tpm_record_measurement()

tpm_record_measurement() function name suggests that:

 - It only records a measurement but does not compute it.
   This is not the case, the function does both.

 - It stores this measurement into a TPM (discrete chip or fTPM).
   This is not the case either, the measurement is just stored into
   the event log, which is a data structure hold in memory, there is
   no TPM involvement here.

To better convey the intent of the function, rename it into
event_log_measure_and_record().

Change-Id: I0102eeda477d6c6761151ac96759b31b6997e9fb
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
This commit is contained in:
Sandrine Bailleux 2021-07-01 14:13:09 +02:00 committed by Manish V Badarkhe
parent 55eeb7b08f
commit 4a24707f94
3 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Arm Limited. All rights reserved.
* Copyright (c) 2020-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -236,8 +236,8 @@ void event_log_init(void)
* 0 = success
* < 0 = error
*/
int tpm_record_measurement(uintptr_t data_base, uint32_t data_size,
uint32_t data_id)
int event_log_measure_and_record(uintptr_t data_base, uint32_t data_size,
uint32_t data_id)
{
const image_data_t *data_ptr = plat_data_ptr->images_data;
unsigned char hash_data[MBEDTLS_MD_MAX_SIZE];

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Arm Limited. All rights reserved.
* Copyright (c) 2020-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -92,6 +92,6 @@ void event_log_init(void);
int event_log_finalise(uint8_t **log_addr, size_t *log_size);
void dump_event_log(uint8_t *log_addr, size_t log_size);
const measured_boot_data_t *plat_get_measured_boot_data(void);
int tpm_record_measurement(uintptr_t data_base, uint32_t data_size,
uint32_t data_id);
int event_log_measure_and_record(uintptr_t data_base, uint32_t data_size,
uint32_t data_id);
#endif /* EVENT_LOG_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2020, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-2021, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -86,8 +86,8 @@ static int fvp_bl2_plat_handle_post_image_load(unsigned int image_id)
if ((info.h.attr & IMAGE_ATTRIB_SKIP_LOADING) == 0U) {
/* Calculate image hash and record data in Event Log */
err = tpm_record_measurement(info.image_base,
info.image_size, image_id);
err = event_log_measure_and_record(info.image_base,
info.image_size, image_id);
if (err != 0) {
ERROR("%s%s image id %u (%i)\n",
"BL2: Failed to ", "record", image_id, err);