]> xenbits.xensource.com Git - seabios.git/commitdiff
tpm: Use smbios_get_tables()
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 10 Dec 2020 20:18:28 +0000 (15:18 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sat, 18 Dec 2021 16:39:13 +0000 (11:39 -0500)
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>
src/tcgbios.c

index 58eb2feaddae2d92e050c27c19cecc0b7acf3b73..fe844b27066cc806edb8a656f6e3595887f7d41d 100644 (file)
@@ -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),