From b55b642fc48b5a5cdbbf21e46397e5c8c2ecafcb Mon Sep 17 00:00:00 2001 From: Tadeusz Struk Date: Thu, 27 Jun 2019 17:17:21 -0700 Subject: sys: Add missing definition of TPMS_TAGGED_POLICY struc For whatever reson we don't have the definition of the TPMS_TAGGED_POLICY struct even though its size is used to calculate the TPM2_MAX_TAGGED_POLICIES value. Signed-off-by: Tadeusz Struk --- include/tss2/tss2_mu.h | 14 ++++++++++++++ include/tss2/tss2_tpm2_types.h | 6 ++++++ lib/tss2-mu.def | 2 ++ lib/tss2-mu.map | 2 ++ src/tss2-mu/tpms-types.c | 8 ++++++++ 5 files changed, 32 insertions(+) diff --git a/include/tss2/tss2_mu.h b/include/tss2/tss2_mu.h index a9c25e19..7adec599 100644 --- a/include/tss2/tss2_mu.h +++ b/include/tss2/tss2_mu.h @@ -790,6 +790,20 @@ Tss2_MU_TPMS_TAGGED_PROPERTY_Unmarshal( size_t *offset, TPMS_TAGGED_PROPERTY *dest); +TSS2_RC +Tss2_MU_TPMS_TAGGED_POLICY_Marshal( + TPMS_TAGGED_POLICY const *src, + uint8_t buffer[], + size_t buffer_size, + size_t *offset); + +TSS2_RC +Tss2_MU_TPMS_TAGGED_POLICY_Unmarshal( + uint8_t const buffer[], + size_t buffer_size, + size_t *offset, + TPMS_TAGGED_POLICY *dest); + TSS2_RC Tss2_MU_TPMS_CLOCK_INFO_Marshal( TPMS_CLOCK_INFO const *src, diff --git a/include/tss2/tss2_tpm2_types.h b/include/tss2/tss2_tpm2_types.h index c1e79878..51550530 100644 --- a/include/tss2/tss2_tpm2_types.h +++ b/include/tss2/tss2_tpm2_types.h @@ -999,6 +999,12 @@ typedef struct { BYTE pcrSelect[TPM2_PCR_SELECT_MAX]; /* the bit map of PCR with the identified property */ } TPMS_TAGGED_PCR_SELECT; +/* Definition of TPMS_TAGGED_POLICY Structure */ +typedef struct { + TPM2_HANDLE handle; + TPMT_HA policyHash; +} TPMS_TAGGED_POLICY; + /* Definition of TPML_CC Structure */ typedef struct { UINT32 count; /* number of commands in the commandCode list may be 0 */ diff --git a/lib/tss2-mu.def b/lib/tss2-mu.def index f0581e27..36f4ba37 100644 --- a/lib/tss2-mu.def +++ b/lib/tss2-mu.def @@ -110,6 +110,8 @@ EXPORTS Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Unmarshal Tss2_MU_TPMS_TAGGED_PROPERTY_Marshal Tss2_MU_TPMS_TAGGED_PROPERTY_Unmarshal + Tss2_MU_TPMS_TAGGED_POLICY_Marshal + Tss2_MU_TPMS_TAGGED_POLICY_Unmarshal Tss2_MU_TPMS_CLOCK_INFO_Marshal Tss2_MU_TPMS_CLOCK_INFO_Unmarshal Tss2_MU_TPMS_TIME_ATTEST_INFO_Marshal diff --git a/lib/tss2-mu.map b/lib/tss2-mu.map index 69a3d3e8..8ac754ed 100644 --- a/lib/tss2-mu.map +++ b/lib/tss2-mu.map @@ -110,6 +110,8 @@ Tss2_MU_TPMS_ALGORITHM_DESCRIPTION_Unmarshal; Tss2_MU_TPMS_TAGGED_PROPERTY_Marshal; Tss2_MU_TPMS_TAGGED_PROPERTY_Unmarshal; + Tss2_MU_TPMS_TAGGED_POLICY_Marshal; + Tss2_MU_TPMS_TAGGED_POLICY_Unmarshal; Tss2_MU_TPMS_CLOCK_INFO_Marshal; Tss2_MU_TPMS_CLOCK_INFO_Unmarshal; Tss2_MU_TPMS_TIME_ATTEST_INFO_Marshal; diff --git a/src/tss2-mu/tpms-types.c b/src/tss2-mu/tpms-types.c index 755e3d85..cd90dab7 100644 --- a/src/tss2-mu/tpms-types.c +++ b/src/tss2-mu/tpms-types.c @@ -976,6 +976,14 @@ TPMS_UNMARSHAL_2(TPMS_TAGGED_PROPERTY, property, Tss2_MU_UINT32_Unmarshal, value, Tss2_MU_UINT32_Unmarshal) +TPMS_MARSHAL_2(TPMS_TAGGED_POLICY, + handle, VAL, Tss2_MU_UINT32_Marshal, + policyHash, ADDR, Tss2_MU_TPMT_HA_Marshal) + +TPMS_UNMARSHAL_2(TPMS_TAGGED_POLICY, + handle, Tss2_MU_UINT32_Unmarshal, + policyHash, Tss2_MU_TPMT_HA_Unmarshal) + TPMS_MARSHAL_4(TPMS_CLOCK_INFO, clock, VAL, Tss2_MU_UINT64_Marshal, resetCount, VAL, Tss2_MU_UINT32_Marshal, -- cgit v1.2.3