mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-27 15:24:54 +00:00
refactor(measured boot): revisit error handling (3/3)
- In tpm_record_measurement(): The platform layer is responsible for providing an exhaustive list of images to measure. If it doesn't then this should be treated as a programming error, as documented in [1]. Thus, turn the error test into an assertion. [1] https://trustedfirmware-a.readthedocs.io/en/latest/process/coding-guidelines.html#using-assert-to-check-for-programming-errors Change-Id: I002309c2ebdf2d348a7d12a8f7f9e82465046b8e Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
This commit is contained in:
parent
0c83207a55
commit
51018a0558
1 changed files with 4 additions and 7 deletions
|
@ -243,14 +243,11 @@ int tpm_record_measurement(uintptr_t data_base, uint32_t data_size,
|
||||||
unsigned char hash_data[MBEDTLS_MD_MAX_SIZE];
|
unsigned char hash_data[MBEDTLS_MD_MAX_SIZE];
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* Check if image_id is supported */
|
/* Get the metadata associated with this image. */
|
||||||
while (data_ptr->id != data_id) {
|
while ((data_ptr->id != INVALID_ID) && (data_ptr->id != data_id)) {
|
||||||
if ((data_ptr++)->id == INVALID_ID) {
|
data_ptr++;
|
||||||
ERROR("%s(): image_id %u not supported\n",
|
|
||||||
__func__, data_id);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
assert(data_ptr->id != INVALID_ID);
|
||||||
|
|
||||||
if (data_id == TOS_FW_CONFIG_ID) {
|
if (data_id == TOS_FW_CONFIG_ID) {
|
||||||
tos_fw_config_base = data_base;
|
tos_fw_config_base = data_base;
|
||||||
|
|
Loading…
Add table
Reference in a new issue