summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-12-10 15:18:28 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-12-18 11:39:13 -0500
commit4912bae2d14e9258f0c873aa09139bf73fc3ebb9 (patch)
treeaac3666773731a1f0d77342f5f0d672c51d98fe3
parent831f1463aaf1eb27265c18ce81d312f9029c8c99 (diff)
downloadqemu-seabios-4912bae2d14e9258f0c873aa09139bf73fc3ebb9.tar.gz
tpm: Use smbios_get_tables()
Instead of using the SMBios21Addr global variable, use the smbios_get_tables() helper. This doesn't change any behavior yet, but it will be useful when we start supporting SMBIOS 3.0 entry points. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--src/tcgbios.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tcgbios.c b/src/tcgbios.c
index 58eb2fe..fe844b2 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -1058,15 +1058,15 @@ tpm_smbios_measure(void)
.eventid = 1,
.eventdatasize = SHA1_BUFSIZE,
};
- struct smbios_21_entry_point *sep = SMBios21Addr;
+ u32 smbios_len;
+ void *smbios_tables = smbios_get_tables(&smbios_len);
- dprintf(DEBUG_tcg, "TCGBIOS: SMBIOS at %p\n", sep);
+ dprintf(DEBUG_tcg, "TCGBIOS: SMBIOS tables at %p\n", smbios_tables);
- if (!sep)
+ if (!smbios_tables)
return;
- sha1((const u8 *)sep->structure_table_address,
- sep->structure_table_length, pcctes.digest);
+ sha1((const u8 *)smbios_tables, smbios_len, pcctes.digest);
tpm_add_measurement_to_log(1,
EV_EVENT_TAG,
(const char *)&pcctes, sizeof(pcctes),