From 3fbcdbcd06a34aa836b18d1d4ced0a764ddee70e Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 19 Dec 2023 21:41:23 -0500 Subject: [PATCH] rev180: Sync PCR related headers Since GLOBAL_C is now set in Platform.h it is necessary to adjust the usage of this #define in NVMarshal.c. Signed-off-by: Stefan Berger --- src/tpm2/NVMarshal.c | 10 +++++----- src/tpm2/PCR.c | 1 - src/tpm2/Platform.h | 4 ++++ src/tpm2/PlatformPCR.c | 3 --- src/tpm2/tpm_to_platform_interface.h | 2 -- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index 68b2d945..924a72e3 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -2945,7 +2945,7 @@ VolatileState_Marshal(BYTE **buffer, INT32 *size) #endif // SESSION_PROCESS_C BLOCK_SKIP_WRITE_POP(size); -#if defined DA_C || defined GLOBAL_C || defined MANUFACTURE_C +#if defined DA_C || defined GLOBAL_C_UNSUPPORTED || defined MANUFACTURE_C has_block = TRUE; #error Unsupport #define value(s) #else @@ -2953,7 +2953,7 @@ VolatileState_Marshal(BYTE **buffer, INT32 *size) #endif written += BLOCK_SKIP_WRITE_PUSH(has_block, buffer, size); -#if defined DA_C || defined GLOBAL_C || defined MANUFACTURE_C +#if defined DA_C || defined GLOBAL_C_UNSUPPORTED || defined MANUFACTURE_C #error Unsupport #define value(s) #if !ACCUMULATE_SELF_HEAL_TIMER has_block = TRUE; @@ -3071,7 +3071,7 @@ VolatileState_Marshal(BYTE **buffer, INT32 *size) #endif BLOCK_SKIP_WRITE_POP(size); -#if defined IO_BUFFER_C || defined GLOBAL_C +#if defined IO_BUFFER_C || defined GLOBAL_C_UNSUPPORTED # error Unsupport #define value(s) /* s_actionInputBuffer: skip; only used during a single command */ /* s_actionOutputBuffer: skip; only used during a single command */ @@ -3406,7 +3406,7 @@ skip_cc_getcommandauditdigest: #endif /* SESSION_PROCESS_C */ skip_session_process: -#if defined DA_C || defined GLOBAL_C || defined MANUFACTURE_C +#if defined DA_C || defined GLOBAL_C_UNSUPPORTED || defined MANUFACTURE_C # error Unsupport #define value(s) needs_block = TRUE; #else @@ -3417,7 +3417,7 @@ skip_session_process: "Volatile state", "s_selfHealTimer.1"); } -#if defined DA_C || defined GLOBAL_C || defined MANUFACTURE_C +#if defined DA_C || defined GLOBAL_C_UNSUPPORTED || defined MANUFACTURE_C # error Unsupport #define value(s) #if !ACCUMULATE_SELF_HEAL_TIMER needs_block = TRUE; diff --git a/src/tpm2/PCR.c b/src/tpm2/PCR.c index bf1dab9a..70caa336 100644 --- a/src/tpm2/PCR.c +++ b/src/tpm2/PCR.c @@ -75,7 +75,6 @@ //** Includes, Defines, and Data Definitions #define PCR_C #include "Tpm.h" -#include "platform_pcr_fp.h" // libtpms: temporary // verify values from pcrstruct.h. not <= because group #0 is reserved // indicating no auth/policy support diff --git a/src/tpm2/Platform.h b/src/tpm2/Platform.h index 536232c2..684e08d7 100644 --- a/src/tpm2/Platform.h +++ b/src/tpm2/Platform.h @@ -73,5 +73,9 @@ #include "platform_public_interface.h" #include "tpm_to_platform_interface.h" #include "platform_to_tpm_interface.h" +#define GLOBAL_C +#define NV_C +#include "pcrstruct.h" +#include "platform_pcr_fp.h" #endif // _PLATFORM_H_ diff --git a/src/tpm2/PlatformPCR.c b/src/tpm2/PlatformPCR.c index d47af5c0..e3cd3a3d 100644 --- a/src/tpm2/PlatformPCR.c +++ b/src/tpm2/PlatformPCR.c @@ -61,9 +61,6 @@ // PCR platform interface functions #include "Platform.h" #include "TpmAlgorithmDefines.h" -#include "GpMacros.h" // libtpms: temporary -#include "Capabilities.h" // - " - -#include "platform_pcr_fp.h" // libtpms: temporary // use this as a convenient lookup for hash size for PCRs. UINT16 CryptHashGetDigestSize(TPM_ALG_ID hashAlg // IN: hash algorithm to look up diff --git a/src/tpm2/tpm_to_platform_interface.h b/src/tpm2/tpm_to_platform_interface.h index e427b1ea..3207d193 100644 --- a/src/tpm2/tpm_to_platform_interface.h +++ b/src/tpm2/tpm_to_platform_interface.h @@ -460,8 +460,6 @@ LIB_EXPORT int _plat__GetTpmFirmwareSecret( LIB_EXPORT uint32_t _plat__GetTpmType(void); // platform PCR initialization functions -#if 0 // libtpms: added #include "platform_pcr_fp.h" -#endif // libtpms: added #endif // _TPM_TO_PLATFORM_INTERFACE_H_