aboutsummaryrefslogtreecommitdiff
path: root/src/std
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-08-09 13:24:51 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-08-11 10:42:32 -0400
commit19e8ea6312f3f60c34c2c20f95fb81306b320f74 (patch)
treedc2621386513a14d388c734021bee6b5b22f1dfb /src/std
parenta99de5c35df0419ed630437c31031e145351dbc8 (diff)
downloadseabios-hppa-19e8ea6312f3f60c34c2c20f95fb81306b320f74.zip
seabios-hppa-19e8ea6312f3f60c34c2c20f95fb81306b320f74.tar.gz
seabios-hppa-19e8ea6312f3f60c34c2c20f95fb81306b320f74.tar.bz2
tpm: Append to TPM2 log the hashes used for PCR extension
Modify the function that writes the TPM logs to take the same digest passed to tpm_extend. Update the tpm2 acpi log header to describe the digest format. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/std')
-rw-r--r--src/std/tcg.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/std/tcg.h b/src/std/tcg.h
index 401b20b..3234524 100644
--- a/src/std/tcg.h
+++ b/src/std/tcg.h
@@ -518,22 +518,20 @@ struct tpm2_digest_values {
struct tpm2_digest_value digest[0];
} PACKED;
+// Each entry in the TPM log contains: a tpm_log_header, a variable
+// length digest, a tpm_log_trailer, and a variable length event. The
+// 'digest' matches what is sent to the TPM hardware via the Extend
+// command. On TPM1.2 the digest is a SHA1 hash; on TPM2.0 the digest
+// contains a tpm2_digest_values struct followed by a variable number
+// of tpm2_digest_value structs (as specified by the hardware via the
+// TPM2_CAP_PCRS request).
struct tpm_log_header {
u32 pcrindex;
u32 eventtype;
u8 digest[0];
} PACKED;
-struct tpml_digest_values_sha1 {
- u32 count; /* number of digests */
- u16 hashtype;
- u8 sha1[SHA1_BUFSIZE];
-} PACKED;
-
-struct tcg_pcr_event2_sha1 {
- u32 pcrindex;
- u32 eventtype;
- struct tpml_digest_values_sha1 digest;
+struct tpm_log_trailer {
u32 eventdatasize;
u8 event[0];
} PACKED;
@@ -549,10 +547,12 @@ struct TCG_EfiSpecIdEventStruct {
struct TCG_EfiSpecIdEventAlgorithmSize {
u16 algorithmId;
u16 digestSize;
- } digestSizes[1];
+ } digestSizes[0];
+ /*
u8 vendorInfoSize;
u8 vendorInfo[0];
-};
+ */
+} PACKED;
#define TPM_TCPA_ACPI_CLASS_CLIENT 0