aboutsummaryrefslogtreecommitdiff
path: root/lib/libtpm/tpm.code
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.ibm.com>2021-07-08 17:36:55 -0400
committerAlexey Kardashevskiy <aik@ozlabs.ru>2021-07-11 23:32:28 +1000
commit6c0fcd9f3085814b808d18aa81ae6669063ea33b (patch)
tree1b699115f53b45d3ea10d1823307f06cd30d88b3 /lib/libtpm/tpm.code
parent52dcdb5421a976e41951f05ec2fd247fee154e6c (diff)
downloadSLOF-6c0fcd9f3085814b808d18aa81ae6669063ea33b.zip
SLOF-6c0fcd9f3085814b808d18aa81ae6669063ea33b.tar.gz
SLOF-6c0fcd9f3085814b808d18aa81ae6669063ea33b.tar.bz2
tpm: Add firmware API call 2HASH-EXT-LOG
Add a new firmware API call with the name 2HASH-EXT-LOG that will be used by trusted grub for measuring, logging, and extending TPM PCRs. 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.code18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/libtpm/tpm.code b/lib/libtpm/tpm.code
index d67d2c3..f5e1d39 100644
--- a/lib/libtpm/tpm.code
+++ b/lib/libtpm/tpm.code
@@ -188,3 +188,21 @@ PRIM(tpm_X2d_hash_X2d_log_X2d_extend_X2d_event_X2d_buffer)
data, datalen,
desc, desclen, is_elf);
MIRP
+
+/****************************************************************************************/
+/* Firmware API */
+/* SLOF: tpm-2hash-ext-log ( pcr event-type info info-len data data-len -- success? ) */
+/* LIBTPM: success = tpm-2hash-ext-log */
+/****************************************************************************************/
+PRIM(tpm_X2d_2hash_X2d_ext_X2d_log)
+ uint32_t datalen = TOS.u; POP;
+ const void *data = TOS.a; POP;
+ uint64_t infolen = TOS.u; POP;
+ const char *info = TOS.a; POP;
+ uint32_t eventtype = TOS.u; POP;
+ uint32_t pcrindex = TOS.u;
+
+ TOS.u = tpm_2hash_ext_log(pcrindex, eventtype,
+ info, infolen,
+ data, datalen);
+MIRP