From e25b1d6f49d40df21266b48e34766031d1d00b92 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 9 Jun 2021 12:48:41 -0400 Subject: tcgbios: Fix details in log entries Fix two details of the logs: - Set the filed SpecErrata to 2 as required by specs. - Write the separator into the log entry's event field. Signed-off-by: Stefan Berger Signed-off-by: Alexey Kardashevskiy --- lib/libtpm/tcgbios.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libtpm/tcgbios.c b/lib/libtpm/tcgbios.c index f9e4602..d3deccb 100644 --- a/lib/libtpm/tcgbios.c +++ b/lib/libtpm/tcgbios.c @@ -659,7 +659,7 @@ static int tpm20_write_EfiSpecIdEventStruct(void) .hdr.platformClass = TPM_TCPA_ACPI_CLASS_CLIENT, .hdr.specVersionMinor = 0, .hdr.specVersionMajor = 2, - .hdr.specErrata = 0, + .hdr.specErrata = 2, .hdr.uintnSize = 2, }; struct tpms_pcr_selection *sel; @@ -958,7 +958,8 @@ uint32_t tpm_add_event_separators(uint32_t start_pcr, uint32_t end_pcr) /* event separators need to be extended and logged for PCRs 0-7 */ for (pcrIndex = start_pcr; pcrIndex <= end_pcr; pcrIndex++) { rc = tpm_add_measurement_to_log(pcrIndex, EV_SEPARATOR, - NULL, 0, + (const char *)evt_separator, + sizeof(evt_separator), evt_separator, sizeof(evt_separator)); if (rc) -- cgit v1.1