From b395b6528737f3f3d4358805c53b3b0683f0ddea Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 7 Feb 2024 14:28:33 -0800 Subject: [PATCH] Fix for config.h, which should only be included from .c files, not headers. ZD 17473 --- IDE/OPENSTM32/Inc/wolftpm_example.h | 4 ---- IDE/OPENSTM32/Src/wolftpm_example.c | 3 +++ examples/attestation/activate_credential.c | 4 ++++ examples/attestation/make_credential.c | 4 ++++ examples/bench/bench.c | 4 ++++ examples/boot/secret_seal.c | 3 +++ examples/boot/secret_unseal.c | 3 +++ examples/boot/secure_rot.c | 3 +++ examples/csr/csr.c | 3 +++ examples/gpio/gpio_config.c | 7 ++++++- examples/gpio/gpio_read.c | 4 ++++ examples/gpio/gpio_set.c | 4 ++++ examples/keygen/create_primary.c | 4 ++++ examples/keygen/external_import.c | 7 ++++++- examples/keygen/keygen.c | 4 ++++ examples/keygen/keyimport.c | 4 ++++ examples/keygen/keyload.c | 3 +++ examples/management/flush.c | 4 ++++ examples/native/native_test.c | 4 ++++ examples/nvram/counter.c | 6 +++++- examples/nvram/policy_nv.c | 6 +++++- examples/nvram/read.c | 6 +++++- examples/nvram/store.c | 6 +++++- examples/pcr/extend.c | 4 ++++ examples/pcr/policy.c | 4 ++++ examples/pcr/policy_sign.c | 3 +++ examples/pcr/quote.c | 4 ++++ examples/pcr/read_pcr.c | 4 ++++ examples/pkcs7/pkcs7.c | 3 +++ examples/seal/seal.c | 4 ++++ examples/seal/unseal.c | 4 ++++ examples/timestamp/clock_set.c | 4 ++++ examples/timestamp/signed_timestamp.c | 4 ++++ examples/tls/tls_client.c | 3 +++ examples/tls/tls_client_notpm.c | 3 +++ examples/tls/tls_server.c | 3 +++ examples/tpm_test_keys.c | 4 ++++ examples/wrap/wrap_test.c | 7 ++++++- hal/tpm_io.c | 4 ++++ hal/tpm_io_atmel.c | 3 +++ hal/tpm_io_barebox.c | 3 +++ hal/tpm_io_infineon.c | 3 +++ hal/tpm_io_linux.c | 5 ++++- hal/tpm_io_microchip.c | 6 +++++- hal/tpm_io_mmio.c | 3 +++ hal/tpm_io_qnx.c | 3 +++ hal/tpm_io_st.c | 3 +++ hal/tpm_io_xilinx.c | 3 +++ src/tpm2.c | 3 +++ src/tpm2_cryptocb.c | 4 ++++ src/tpm2_linux.c | 4 ++++ src/tpm2_packet.c | 4 +++- src/tpm2_param_enc.c | 4 ++++ src/tpm2_swtpm.c | 4 ++++ src/tpm2_tis.c | 3 +++ src/tpm2_winapi.c | 3 +++ src/tpm2_wrap.c | 4 ++++ wolftpm/tpm2_types.h | 4 ---- 58 files changed, 213 insertions(+), 18 deletions(-) diff --git a/IDE/OPENSTM32/Inc/wolftpm_example.h b/IDE/OPENSTM32/Inc/wolftpm_example.h index da90daa2..cf360eb9 100644 --- a/IDE/OPENSTM32/Inc/wolftpm_example.h +++ b/IDE/OPENSTM32/Inc/wolftpm_example.h @@ -27,10 +27,6 @@ #include #include -#ifdef HAVE_CONFIG_H - #include -#endif - #ifndef WOLFSSL_USER_SETTINGS #include #endif diff --git a/IDE/OPENSTM32/Src/wolftpm_example.c b/IDE/OPENSTM32/Src/wolftpm_example.c index 03785106..89d8a9e1 100644 --- a/IDE/OPENSTM32/Src/wolftpm_example.c +++ b/IDE/OPENSTM32/Src/wolftpm_example.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include "wolftpm_example.h" diff --git a/examples/attestation/activate_credential.c b/examples/attestation/activate_credential.c index 93b2bc44..673e9852 100644 --- a/examples/attestation/activate_credential.c +++ b/examples/attestation/activate_credential.c @@ -23,6 +23,10 @@ * and extract the secret for challenge response to an attestation server */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/attestation/make_credential.c b/examples/attestation/make_credential.c index b2b85f6f..99a22421 100644 --- a/examples/attestation/make_credential.c +++ b/examples/attestation/make_credential.c @@ -21,6 +21,10 @@ /* This example shows how to create a challenge for Remote Attestation */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #ifndef WOLFTPM2_NO_WRAPPER diff --git a/examples/bench/bench.c b/examples/bench/bench.c index 72967137..e036c780 100644 --- a/examples/bench/bench.c +++ b/examples/bench/bench.c @@ -22,6 +22,10 @@ /* This example shows benchmarks using the TPM2 wrapper API's in TPM2_Wrapper_Bench() below. */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/boot/secret_seal.c b/examples/boot/secret_seal.c index c3be9813..33e98148 100644 --- a/examples/boot/secret_seal.c +++ b/examples/boot/secret_seal.c @@ -22,6 +22,9 @@ /* Example for using TPM to seal a secret using an external key based on PCR(s) */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/boot/secret_unseal.c b/examples/boot/secret_unseal.c index 609625e8..439cdfb6 100644 --- a/examples/boot/secret_unseal.c +++ b/examples/boot/secret_unseal.c @@ -22,6 +22,9 @@ /* Example for using TPM to seal a secret using an external key based on PCR(s) */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/boot/secure_rot.c b/examples/boot/secure_rot.c index 5f013253..814adfe6 100644 --- a/examples/boot/secure_rot.c +++ b/examples/boot/secure_rot.c @@ -22,6 +22,9 @@ /* Example for using TPM for secure boot root of trust */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/csr/csr.c b/examples/csr/csr.c index b5907fd6..e2a0333a 100644 --- a/examples/csr/csr.c +++ b/examples/csr/csr.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/gpio/gpio_config.c b/examples/gpio/gpio_config.c index ebd5cac1..0d37c712 100644 --- a/examples/gpio/gpio_config.c +++ b/examples/gpio/gpio_config.c @@ -20,7 +20,12 @@ */ /* This examples demonstrates the use of GPIO available on some TPM modules. - * Support tested with STM ST33 and Nuvoton NPCT750 FW 7.2.3.0 or later */ + * Support tested with STM ST33 and Nuvoton NPCT750 FW 7.2.3.0 or later + */ + +#ifdef HAVE_CONFIG_H + #include +#endif #include diff --git a/examples/gpio/gpio_read.c b/examples/gpio/gpio_read.c index e5ce2aba..076f9b52 100644 --- a/examples/gpio/gpio_read.c +++ b/examples/gpio/gpio_read.c @@ -25,6 +25,10 @@ * */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/gpio/gpio_set.c b/examples/gpio/gpio_set.c index 8762ce97..77dc8cfd 100644 --- a/examples/gpio/gpio_set.c +++ b/examples/gpio/gpio_set.c @@ -25,6 +25,10 @@ * */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/keygen/create_primary.c b/examples/keygen/create_primary.c index c981bec0..a5f4acce 100644 --- a/examples/keygen/create_primary.c +++ b/examples/keygen/create_primary.c @@ -21,6 +21,10 @@ /* Tool and example for creating and storing primary keys using TPM2.0 */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/keygen/external_import.c b/examples/keygen/external_import.c index 48344c10..3b67dc49 100644 --- a/examples/keygen/external_import.c +++ b/examples/keygen/external_import.c @@ -20,7 +20,12 @@ */ /* Example for importing an external RSA key with seed and creating a - * child key under it. */ + * child key under it. + */ + +#ifdef HAVE_CONFIG_H + #include +#endif #include diff --git a/examples/keygen/keygen.c b/examples/keygen/keygen.c index 1a718117..ab87d475 100644 --- a/examples/keygen/keygen.c +++ b/examples/keygen/keygen.c @@ -21,6 +21,10 @@ /* Tool and example for creating, storing and loading keys using TPM2.0 */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/keygen/keyimport.c b/examples/keygen/keyimport.c index cf4c7814..2268984a 100644 --- a/examples/keygen/keyimport.c +++ b/examples/keygen/keyimport.c @@ -21,6 +21,10 @@ /* Tool and example for creating, storing and loading keys using TPM2.0 */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/keygen/keyload.c b/examples/keygen/keyload.c index 439950ad..343d7bbc 100644 --- a/examples/keygen/keyload.c +++ b/examples/keygen/keyload.c @@ -21,6 +21,9 @@ /* Tool and example for creating, storing and loading keys using TPM2.0 */ +#ifdef HAVE_CONFIG_H + #include +#endif /* use ANSI stdio for support of format strings, must be set before * including stdio.h diff --git a/examples/management/flush.c b/examples/management/flush.c index 82d0180a..dc635f44 100644 --- a/examples/management/flush.c +++ b/examples/management/flush.c @@ -21,6 +21,10 @@ /* This is a helper tool for reseting the value of a TPM2.0 PCR */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/native/native_test.c b/examples/native/native_test.c index e471bf05..ae864dad 100644 --- a/examples/native/native_test.c +++ b/examples/native/native_test.c @@ -21,6 +21,10 @@ /* This example shows using the TPM2_ specification API's in TPM2_Native_Test() */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/nvram/counter.c b/examples/nvram/counter.c index 75e9e80b..5d3dd82c 100644 --- a/examples/nvram/counter.c +++ b/examples/nvram/counter.c @@ -24,7 +24,11 @@ * NB: This example uses Parameter Encryption to protect * the Password Authorization of the TPM NVRAM Index * - **/ + */ + +#ifdef HAVE_CONFIG_H + #include +#endif #include diff --git a/examples/nvram/policy_nv.c b/examples/nvram/policy_nv.c index d8e575db..b858ca9e 100644 --- a/examples/nvram/policy_nv.c +++ b/examples/nvram/policy_nv.c @@ -24,7 +24,11 @@ * NB: This example uses Parameter Encryption to protect the password of the * TPM NVRAM Index, where the private and public parts of a TPM key is stored * - **/ + */ + +#ifdef HAVE_CONFIG_H + #include +#endif #include diff --git a/examples/nvram/read.c b/examples/nvram/read.c index 869cbb8a..d90172f0 100644 --- a/examples/nvram/read.c +++ b/examples/nvram/read.c @@ -24,7 +24,11 @@ * NB: This example uses Parameter Encryption to protect * the Password Authorization of the TPM NVRAM Index * - **/ + */ + +#ifdef HAVE_CONFIG_H + #include +#endif #include diff --git a/examples/nvram/store.c b/examples/nvram/store.c index 4cb8e3b6..007a6e76 100644 --- a/examples/nvram/store.c +++ b/examples/nvram/store.c @@ -24,7 +24,11 @@ * NB: This example uses Parameter Encryption to protect the password of the * TPM NVRAM Index, where the private and public parts of a TPM key is stored * - **/ + */ + +#ifdef HAVE_CONFIG_H + #include +#endif #include diff --git a/examples/pcr/extend.c b/examples/pcr/extend.c index 0378b7e9..5220948c 100644 --- a/examples/pcr/extend.c +++ b/examples/pcr/extend.c @@ -21,6 +21,10 @@ /* This is a helper tool for extending hash into a TPM2.0 PCR */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #ifndef WOLFTPM2_NO_WRAPPER diff --git a/examples/pcr/policy.c b/examples/pcr/policy.c index dc796084..dfaafef4 100644 --- a/examples/pcr/policy.c +++ b/examples/pcr/policy.c @@ -21,6 +21,10 @@ /* This is a helper tool for setting policies on a TPM 2.0 PCR */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/pcr/policy_sign.c b/examples/pcr/policy_sign.c index 72a3673c..456ec029 100644 --- a/examples/pcr/policy_sign.c +++ b/examples/pcr/policy_sign.c @@ -22,6 +22,9 @@ /* Example for signing PCR(s) to create a policy for unsealing a secret */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/pcr/quote.c b/examples/pcr/quote.c index 1519692e..dc30ad7f 100644 --- a/examples/pcr/quote.c +++ b/examples/pcr/quote.c @@ -23,6 +23,10 @@ * PCR measurement. PCR values are used as basis for system integrity. */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #ifndef WOLFTPM2_NO_WRAPPER diff --git a/examples/pcr/read_pcr.c b/examples/pcr/read_pcr.c index 098a39ba..2e9de463 100644 --- a/examples/pcr/read_pcr.c +++ b/examples/pcr/read_pcr.c @@ -21,6 +21,10 @@ /* This is a helper tool for reading the value of a TPM2.0 PCR */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/pkcs7/pkcs7.c b/examples/pkcs7/pkcs7.c index 7ffa2937..0641dd17 100644 --- a/examples/pkcs7/pkcs7.c +++ b/examples/pkcs7/pkcs7.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/seal/seal.c b/examples/seal/seal.c index f546fee1..8d4066ad 100644 --- a/examples/seal/seal.c +++ b/examples/seal/seal.c @@ -21,6 +21,10 @@ /* Example for TPM 2.0 sealing a user secret using TPM key */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/seal/unseal.c b/examples/seal/unseal.c index 402fff15..c61d99c2 100644 --- a/examples/seal/unseal.c +++ b/examples/seal/unseal.c @@ -21,6 +21,10 @@ /* This example demonstrates how to extract the data from a TPM seal object */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/timestamp/clock_set.c b/examples/timestamp/clock_set.c index 9db5cbc6..11222540 100644 --- a/examples/timestamp/clock_set.c +++ b/examples/timestamp/clock_set.c @@ -21,6 +21,10 @@ /* This example shows how to increment the TPM2 clock */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/timestamp/signed_timestamp.c b/examples/timestamp/signed_timestamp.c index 67deb1df..f3e192c4 100644 --- a/examples/timestamp/signed_timestamp.c +++ b/examples/timestamp/signed_timestamp.c @@ -23,6 +23,10 @@ * generate a signed timestamp from the TPM using a Attestation Identity Key. */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/examples/tls/tls_client.c b/examples/tls/tls_client.c index 9d6de10d..472b4e82 100644 --- a/examples/tls/tls_client.c +++ b/examples/tls/tls_client.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/tls/tls_client_notpm.c b/examples/tls/tls_client_notpm.c index 090464ff..93d583f4 100644 --- a/examples/tls/tls_client_notpm.c +++ b/examples/tls/tls_client_notpm.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/tls/tls_server.c b/examples/tls/tls_server.c index 8e10fbbe..6bc40985 100644 --- a/examples/tls/tls_server.c +++ b/examples/tls/tls_server.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/examples/tpm_test_keys.c b/examples/tpm_test_keys.c index 1d09c664..c5df1827 100644 --- a/examples/tpm_test_keys.c +++ b/examples/tpm_test_keys.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + /* use ANSI stdio for support of format strings, must be set before * including stdio.h */ diff --git a/examples/wrap/wrap_test.c b/examples/wrap/wrap_test.c index cc347c75..94e698e9 100644 --- a/examples/wrap/wrap_test.c +++ b/examples/wrap/wrap_test.c @@ -19,7 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -/* This example shows using the TPM2 wrapper API's in TPM2_Wrapper_Test() below. */ +/* This example shows using the TPM2 wrapper API's in TPM2_Wrapper_Test() below. + */ + +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io.c b/hal/tpm_io.c index c0d8751a..d6faba18 100644 --- a/hal/tpm_io.c +++ b/hal/tpm_io.c @@ -31,6 +31,10 @@ * */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include #include "tpm_io.h" diff --git a/hal/tpm_io_atmel.c b/hal/tpm_io_atmel.c index bbb3f8f9..31c3778f 100644 --- a/hal/tpm_io_atmel.c +++ b/hal/tpm_io_atmel.c @@ -21,6 +21,9 @@ /* This example shows IO interfaces for ATMEL microcontrollers using ASF */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io_barebox.c b/hal/tpm_io_barebox.c index 3513d501..478b1400 100644 --- a/hal/tpm_io_barebox.c +++ b/hal/tpm_io_barebox.c @@ -21,6 +21,9 @@ /* This example shows IO interfaces for Barebox */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io_infineon.c b/hal/tpm_io_infineon.c index 252b986c..04bca155 100644 --- a/hal/tpm_io_infineon.c +++ b/hal/tpm_io_infineon.c @@ -23,6 +23,9 @@ * - TC2XX/TC3XX using macro: `WOLFTPM_INFINEON_TRICORE`. */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io_linux.c b/hal/tpm_io_linux.c index 5ca01e89..193498d7 100644 --- a/hal/tpm_io_linux.c +++ b/hal/tpm_io_linux.c @@ -23,8 +23,11 @@ * * NB: To use /dev/tpm0, wolfTPM does not require an IO callback, just pass NULL * - * */ + */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io_microchip.c b/hal/tpm_io_microchip.c index 46403c53..178963ff 100644 --- a/hal/tpm_io_microchip.c +++ b/hal/tpm_io_microchip.c @@ -20,8 +20,12 @@ */ /* This example shows IO interfaces for Microchip micro-controllers using - * MPLAB X and Harmony */ + * MPLAB X and Harmony + */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io_mmio.c b/hal/tpm_io_mmio.c index 0ea70ee1..1156c931 100644 --- a/hal/tpm_io_mmio.c +++ b/hal/tpm_io_mmio.c @@ -21,6 +21,9 @@ /* Support for Memory Mapped I/O for accessing TPM */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io_qnx.c b/hal/tpm_io_qnx.c index 495e5591..eb42afa4 100644 --- a/hal/tpm_io_qnx.c +++ b/hal/tpm_io_qnx.c @@ -21,6 +21,9 @@ /* This example shows IO interfaces for QNX */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io_st.c b/hal/tpm_io_st.c index 6eedfc36..d6744b27 100644 --- a/hal/tpm_io_st.c +++ b/hal/tpm_io_st.c @@ -21,6 +21,9 @@ /* This example shows IO interfaces for STM32 CubeMX HAL */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/hal/tpm_io_xilinx.c b/hal/tpm_io_xilinx.c index 43f20fff..6516b73f 100644 --- a/hal/tpm_io_xilinx.c +++ b/hal/tpm_io_xilinx.c @@ -21,6 +21,9 @@ /* This example shows IO interfaces for Xilinx */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/src/tpm2.c b/src/tpm2.c index 75f7ec70..76ebba9d 100644 --- a/src/tpm2.c +++ b/src/tpm2.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include #include diff --git a/src/tpm2_cryptocb.c b/src/tpm2_cryptocb.c index ef25d83a..0115d868 100644 --- a/src/tpm2_cryptocb.c +++ b/src/tpm2_cryptocb.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #if !defined(WOLFTPM2_NO_WRAPPER) diff --git a/src/tpm2_linux.c b/src/tpm2_linux.c index c1b2032c..9c3f354d 100644 --- a/src/tpm2_linux.c +++ b/src/tpm2_linux.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #ifdef WOLFTPM_LINUX_DEV diff --git a/src/tpm2_packet.c b/src/tpm2_packet.c index 85949a65..0cb830ee 100644 --- a/src/tpm2_packet.c +++ b/src/tpm2_packet.c @@ -19,10 +19,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include - /* Endianess Helpers */ #ifdef LITTLE_ENDIAN_ORDER #define cpu_to_be16(d) ByteReverseWord16(d) diff --git a/src/tpm2_param_enc.c b/src/tpm2_param_enc.c index f040fdf4..2df0d283 100644 --- a/src/tpm2_param_enc.c +++ b/src/tpm2_param_enc.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/src/tpm2_swtpm.c b/src/tpm2_swtpm.c index f67cee18..583650fc 100644 --- a/src/tpm2_swtpm.c +++ b/src/tpm2_swtpm.c @@ -32,6 +32,10 @@ * See docs/SWTPM.md */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #ifdef WOLFTPM_SWTPM diff --git a/src/tpm2_tis.c b/src/tpm2_tis.c index 4004f74a..0c0a8ed0 100644 --- a/src/tpm2_tis.c +++ b/src/tpm2_tis.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include diff --git a/src/tpm2_winapi.c b/src/tpm2_winapi.c index fcd8a461..840a5c26 100644 --- a/src/tpm2_winapi.c +++ b/src/tpm2_winapi.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif #include diff --git a/src/tpm2_wrap.c b/src/tpm2_wrap.c index b6c17099..24bdf8f4 100644 --- a/src/tpm2_wrap.c +++ b/src/tpm2_wrap.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/wolftpm/tpm2_types.h b/wolftpm/tpm2_types.h index ded3f009..aa814357 100644 --- a/wolftpm/tpm2_types.h +++ b/wolftpm/tpm2_types.h @@ -22,10 +22,6 @@ #ifndef __TPM2_TYPES_H__ #define __TPM2_TYPES_H__ -#ifdef HAVE_CONFIG_H - #include -#endif - #include #include