aboutsummaryrefslogtreecommitdiff
path: root/lib/libtpm/tpm.code
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2020-01-21 15:01:47 -0500
committerAlexey Kardashevskiy <aik@ozlabs.ru>2020-02-21 14:03:07 +1100
commit16a1867425ee88d8b674d2a51ada19ff7ddf1b42 (patch)
tree08b8badc52ef98e071989bef356ae723a2b47b2d /lib/libtpm/tpm.code
parent8a6b0d7061c5e504be2e378bd691a762307a1805 (diff)
downloadSLOF-16a1867425ee88d8b674d2a51ada19ff7ddf1b42.zip
SLOF-16a1867425ee88d8b674d2a51ada19ff7ddf1b42.tar.gz
SLOF-16a1867425ee88d8b674d2a51ada19ff7ddf1b42.tar.bz2
tcgbios: Measure the GPT table
Measure and log the GPT table including LBA1 and all GPT table entries with a non-zero Type GUID. We follow the specification "TCG PC Client Platform Firmware Profile Specification" for the format of what needs to be logged and measured. See section "Event Logging" subsection "Measuring UEFI Variables" for the UEFI_GPT_DATA structure. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib/libtpm/tpm.code')
-rw-r--r--lib/libtpm/tpm.code32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/libtpm/tpm.code b/lib/libtpm/tpm.code
index b8f5669..205c608 100644
--- a/lib/libtpm/tpm.code
+++ b/lib/libtpm/tpm.code
@@ -137,3 +137,35 @@ MIRP
PRIM(tpm20_X2d_menu)
tpm20_menu();
MIRP
+
+/*************************************************************************/
+/* Set the LBA1 of the GPT */
+/* SLOF: tpm-gpt-set-lba1 ( addr length -- ) */
+/* LIBTPM: tpm_gpt_set_lba1(addr, length) */
+/*************************************************************************/
+PRIM(tpm_X2d_gpt_X2d_set_X2d_lba1)
+ int length = TOS.u; POP;
+ void *addr = TOS.a; POP;
+ tpm_gpt_set_lba1(addr, length);
+MIRP
+
+/*************************************************************************/
+/* Add a GPT table entry */
+/* SLOF: tpm-gpt-add-entry ( addr length -- ) */
+/* LIBTPM: tpm_gpt_add_entry(addr, length) */
+/*************************************************************************/
+PRIM(tpm_X2d_gpt_X2d_add_X2d_entry)
+ int length = TOS.u; POP;
+ void *addr = TOS.a; POP;
+ tpm_gpt_add_entry(addr, length);
+MIRP
+
+/*************************************************************************/
+/* Measure and log GPT EVENT */
+/* SLOF: tpm-measure-gpt ( -- errcode ) */
+/* LIBTPM: errcode = tpm_measure_gpt() */
+/*************************************************************************/
+PRIM(tpm_X2d_measure_X2d_gpt)
+ PUSH;
+ TOS.n = tpm_measure_gpt();
+MIRP