From ef8a25006df35cafbd47a574681901d9b8f23000 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 1 Oct 2018 11:55:18 -0600 Subject: sandbox: tpm: Enhance to support the latest Chromium OS This driver was originally written against Chromium OS circa 2012. A few new features have been added. Enhance the TPM driver to match. This mostly includes a few new messages and properly modelling whether a particular 'space' is present or not. Signed-off-by: Simon Glass --- include/tpm-v1.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'include') diff --git a/include/tpm-v1.h b/include/tpm-v1.h index 29788b5390f..f9ffbb26561 100644 --- a/include/tpm-v1.h +++ b/include/tpm-v1.h @@ -245,6 +245,40 @@ struct tpm_permanent_flags { u8 disable_full_da_logic_info; } __packed; +#define TPM_SHA1_160_HASH_LEN 0x14 + +struct __packed tpm_composite_hash { + u8 digest[TPM_SHA1_160_HASH_LEN]; +}; + +struct __packed tpm_pcr_selection { + __be16 size_of_select; + u8 pcr_select[3]; /* matches vboot's struct */ +}; + +struct __packed tpm_pcr_info_short { + struct tpm_pcr_selection pcr_selection; + u8 locality_at_release; + struct tpm_composite_hash digest_at_release; +}; + +struct __packed tpm_nv_attributes { + __be16 tag; + __be32 attributes; +}; + +struct __packed tpm_nv_data_public { + __be16 tag; + __be32 nv_index; + struct tpm_pcr_info_short pcr_info_read; + struct tpm_pcr_info_short pcr_info_write; + struct tpm_nv_attributes permission; + u8 read_st_clear; + u8 write_st_clear; + u8 write_define; + __be32 data_size; +}; + /** * Issue a TPM_Startup command. * -- cgit v1.2.3