Fix for config.h, which should only be included from .c files, not headers. ZD 17473

pull/330/head
David Garske 2024-02-07 14:28:33 -08:00
parent b676415d18
commit b395b65287
58 changed files with 213 additions and 18 deletions

View File

@ -27,10 +27,6 @@
#include <stm32f4xx.h>
#include <cmsis_os.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "wolftpm_example.h"

View File

@ -23,6 +23,10 @@
* and extract the secret for challenge response to an attestation server
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -21,6 +21,10 @@
/* This example shows how to create a challenge for Remote Attestation */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#ifndef WOLFTPM2_NO_WRAPPER

View File

@ -22,6 +22,10 @@
/* This example shows benchmarks using the TPM2 wrapper API's in
TPM2_Wrapper_Bench() below. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -22,6 +22,9 @@
/* Example for using TPM for secure boot root of trust
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>

View File

@ -25,6 +25,10 @@
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <examples/gpio/gpio.h>

View File

@ -25,6 +25,10 @@
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -21,6 +21,10 @@
/* Tool and example for creating and storing primary keys using TPM2.0 */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>

View File

@ -21,6 +21,10 @@
/* Tool and example for creating, storing and loading keys using TPM2.0 */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -21,6 +21,10 @@
/* Tool and example for creating, storing and loading keys using TPM2.0 */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -21,6 +21,9 @@
/* Tool and example for creating, storing and loading keys using TPM2.0 */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* use ANSI stdio for support of format strings, must be set before
* including stdio.h

View File

@ -21,6 +21,10 @@
/* This is a helper tool for reseting the value of a TPM2.0 PCR */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <examples/management/flush.h>

View File

@ -21,6 +21,10 @@
/* This example shows using the TPM2_ specification API's in TPM2_Native_Test() */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_param_enc.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>

View File

@ -21,6 +21,10 @@
/* This is a helper tool for extending hash into a TPM2.0 PCR */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#ifndef WOLFTPM2_NO_WRAPPER

View File

@ -21,6 +21,10 @@
/* This is a helper tool for setting policies on a TPM 2.0 PCR */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -22,6 +22,9 @@
/* Example for signing PCR(s) to create a policy for unsealing a secret
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -23,6 +23,10 @@
* PCR measurement. PCR values are used as basis for system integrity.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#ifndef WOLFTPM2_NO_WRAPPER

View File

@ -21,6 +21,10 @@
/* This is a helper tool for reading the value of a TPM2.0 PCR */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -21,6 +21,10 @@
/* Example for TPM 2.0 sealing a user secret using TPM key */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -21,6 +21,10 @@
/* This example demonstrates how to extract the data from a TPM seal object */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -21,6 +21,10 @@
/* This example shows how to increment the TPM2 clock */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -23,6 +23,10 @@
* generate a signed timestamp from the TPM using a Attestation Identity Key.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <stdio.h>

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* use ANSI stdio for support of format strings, must be set before
* including stdio.h
*/

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_wrap.h>

View File

@ -31,6 +31,10 @@
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>
#include "tpm_io.h"

View File

@ -21,6 +21,9 @@
/* This example shows IO interfaces for ATMEL microcontrollers using ASF */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -21,6 +21,9 @@
/* This example shows IO interfaces for Barebox */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -23,6 +23,9 @@
* - TC2XX/TC3XX using macro: `WOLFTPM_INFINEON_TRICORE`.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -23,8 +23,11 @@
*
* NB: To use /dev/tpm0, wolfTPM does not require an IO callback, just pass NULL
*
* */
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -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 <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -21,6 +21,9 @@
/* Support for Memory Mapped I/O for accessing TPM */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -21,6 +21,9 @@
/* This example shows IO interfaces for QNX */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -21,6 +21,9 @@
/* This example shows IO interfaces for STM32 CubeMX HAL */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -21,6 +21,9 @@
/* This example shows IO interfaces for Xilinx */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_tis.h>

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2.h>
#include <wolftpm/tpm2_packet.h>

View File

@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#if !defined(WOLFTPM2_NO_WRAPPER)

View File

@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_types.h>
#ifdef WOLFTPM_LINUX_DEV

View File

@ -19,10 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_packet.h>
/* Endianess Helpers */
#ifdef LITTLE_ENDIAN_ORDER
#define cpu_to_be16(d) ByteReverseWord16(d)

View File

@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_param_enc.h>
#include <wolftpm/tpm2_packet.h>

View File

@ -32,6 +32,10 @@
* See docs/SWTPM.md
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_types.h>
#ifdef WOLFTPM_SWTPM

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_tis.h>

View File

@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_types.h>

View File

@ -19,6 +19,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/tpm2_wrap.h>
#include <wolftpm/tpm2_param_enc.h>

View File

@ -22,10 +22,6 @@
#ifndef __TPM2_TYPES_H__
#define __TPM2_TYPES_H__
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <wolftpm/visibility.h>
#include <stdint.h>