summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2021-08-13 10:12:42 +0300
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-08-14 21:54:41 +0300
commit61ee780352e054df587d8781f23b323c967b5d2a (patch)
tree24dac98ec7eb2c13c8d35275c4cd2a8a37debf44 /lib
parentfdff03e5b338772b9340b7b2965b9de71c323f24 (diff)
downloadu-boot-61ee780352e054df587d8781f23b323c967b5d2a.tar.xz
efi_loader: refactor efi_append_scrtm_version()
Refactor efi_append_scrtm_version() to use common function for adding eventlog and extending PCR. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_tcg2.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index c6f2e48106..35e69b9112 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -1321,23 +1321,11 @@ out:
*/
static efi_status_t efi_append_scrtm_version(struct udevice *dev)
{
- struct tpml_digest_values digest_list;
u8 ver[] = U_BOOT_VERSION_STRING;
- const int pcr_index = 0;
efi_status_t ret;
- ret = tcg2_create_digest(ver, sizeof(ver), &digest_list);
- if (ret != EFI_SUCCESS)
- goto out;
+ ret = tcg2_measure_event(dev, 0, EV_S_CRTM_VERSION, sizeof(ver), ver);
- ret = tcg2_pcr_extend(dev, pcr_index, &digest_list);
- if (ret != EFI_SUCCESS)
- goto out;
-
- ret = tcg2_agile_log_append(pcr_index, EV_S_CRTM_VERSION, &digest_list,
- sizeof(ver), ver);
-
-out:
return ret;
}