aboutsummaryrefslogtreecommitdiffstats
path: root/src/std
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2016-02-02 13:09:15 -0500
committerKevin O'Connor <kevin@koconnor.net>2016-02-05 20:47:37 -0500
commit8b7a0add3acfa14ea28ca9a9fbc410d314c62a10 (patch)
tree33be5eae98f243b697891ade7107ab6c390c7139 /src/std
parentd766c1ab99a2c2a88b59a3e25a492f424e42a62e (diff)
downloadseabios-8b7a0add3acfa14ea28ca9a9fbc410d314c62a10.tar.gz
tpm: Implement tpm20_extend
Implement the tpm20_extend function. We use it with only SHA1. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Diffstat (limited to 'src/std')
-rw-r--r--src/std/tcg.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/std/tcg.h b/src/std/tcg.h
index e0d6f307..d45c7f62 100644
--- a/src/std/tcg.h
+++ b/src/std/tcg.h
@@ -375,6 +375,8 @@ struct tpm_res_sha1complete {
#define TPM2_RS_PW 0x40000009
#define TPM2_RH_PLATFORM 0x4000000c
+#define TPM2_ALG_SHA1 0x0004
+
/* TPM 2 command tags */
#define TPM2_ST_NO_SESSIONS 0x8001
#define TPM2_ST_SESSIONS 0x8002
@@ -385,6 +387,7 @@ struct tpm_res_sha1complete {
#define TPM2_CC_Startup 0x144
#define TPM2_CC_StirRandom 0x146
#define TPM2_CC_GetRandom 0x17b
+#define TPM2_CC_PCR_Extend 0x182
/* TPM 2 error codes */
#define TPM2_RC_INITIALIZE 0x100
@@ -426,4 +429,18 @@ struct tpm2_req_hierarchychangeauth {
struct tpm2b_20 newAuth;
} PACKED;
+struct tpm2_digest_value {
+ u32 count; /* 1 entry only */
+ u16 hashalg; /* TPM2_ALG_SHA1 */
+ u8 sha1[SHA1_BUFSIZE];
+} PACKED;
+
+struct tpm2_req_extend {
+ struct tpm_req_header hdr;
+ u32 pcrindex;
+ u32 authblocksize;
+ struct tpm2_authblock authblock;
+ struct tpm2_digest_value digest;
+} PACKED;
+
#endif // tcg.h