From 69d0950e349287ceb40e0838d4df297e4b135b59 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 26 Nov 2019 13:24:32 -0500 Subject: [PATCH] tpm2: Move #defines for hash and sym alignment out of TpmProfile.h Signed-off-by: Stefan Berger --- src/tpm2/NVMarshal.c | 3 ++- src/tpm2/TpmProfile.h | 6 ------ src/tpm2/crypto/openssl/TpmToOsslHash.h | 5 ++++- src/tpm2/crypto/openssl/TpmToOsslSym.h | 2 ++ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tpm2/NVMarshal.c b/src/tpm2/NVMarshal.c index 63e66566..98d6d22e 100644 --- a/src/tpm2/NVMarshal.c +++ b/src/tpm2/NVMarshal.c @@ -41,6 +41,7 @@ #include "assert.h" +#define _CRYPT_HASH_C_ #define SESSION_PROCESS_C #define NV_C #define OBJECT_C @@ -3579,7 +3580,7 @@ static const struct _entry { { COMPILE_CONSTANT(ECC_SM2_P256, LE) }, { COMPILE_CONSTANT(MAX_ECC_KEY_BITS, LE) }, { COMPILE_CONSTANT(HASH_ALIGNMENT, EQ) }, - { COMPILE_CONSTANT(SYMMETRIC_ALIGNMENT, EQ) }, + { COMPILE_CONSTANT(SYM_ALIGNMENT, EQ) }, { COMPILE_CONSTANT(IMPLEMENTATION_PCR, EQ) }, { COMPILE_CONSTANT(PLATFORM_PCR, EQ) }, { COMPILE_CONSTANT(DRTM_PCR, EQ) }, diff --git a/src/tpm2/TpmProfile.h b/src/tpm2/TpmProfile.h index f42a8e78..59123680 100644 --- a/src/tpm2/TpmProfile.h +++ b/src/tpm2/TpmProfile.h @@ -192,12 +192,6 @@ #ifndef RADIX_BITS #define RADIX_BITS 32 #endif -#ifndef HASH_ALIGNMENT -#define HASH_ALIGNMENT 4 -#endif -#ifndef SYMMETRIC_ALIGNMENT -#define SYMMETRIC_ALIGNMENT 4 -#endif #ifndef HASH_LIB #define HASH_LIB Ossl #endif diff --git a/src/tpm2/crypto/openssl/TpmToOsslHash.h b/src/tpm2/crypto/openssl/TpmToOsslHash.h index edae6bf2..da6c76fd 100644 --- a/src/tpm2/crypto/openssl/TpmToOsslHash.h +++ b/src/tpm2/crypto/openssl/TpmToOsslHash.h @@ -3,7 +3,7 @@ /* Used to splice the OpenSSL() hash code into the TPM code */ /* Written by Ken Goldman */ /* IBM Thomas J. Watson Research Center */ -/* $Id: TpmToOsslHash.h 1519 2019-11-15 20:43:51Z kgoldman $ */ +/* $Id: TpmToOsslHash.h 1529 2019-11-21 23:29:01Z kgoldman $ */ /* */ /* Licenses and Notices */ /* */ @@ -98,6 +98,9 @@ typedef const BYTE *PCBYTE; library). */ /* The macro that calls the method also defines how the parameters get swizzled between the default form (in CryptHash.c)and the library form. */ + +#define HASH_ALIGNMENT 4 /* libtpms: keep old value */ + /* Initialize the hash context */ #define HASH_START_METHOD_DEF void (HASH_START_METHOD)(PANY_HASH_STATE state) #define HASH_START(hashState) \ diff --git a/src/tpm2/crypto/openssl/TpmToOsslSym.h b/src/tpm2/crypto/openssl/TpmToOsslSym.h index 72a4fd78..6bc4706e 100644 --- a/src/tpm2/crypto/openssl/TpmToOsslSym.h +++ b/src/tpm2/crypto/openssl/TpmToOsslSym.h @@ -96,6 +96,8 @@ typedef void(*TpmCryptSetSymKeyCall_t)( void *keySchedule ); +#define SYM_ALIGNMENT 4 /* libtpms: keep old value */ + /* B.2.2.3.3. Links to the OpenSSL AES code */ /* Macros to set up the encryption/decryption key schedules */