wolfSSL / wolfTPM

wolfTPM is a highly portable TPM 2.0 library, designed for embedded use.
https://www.wolfssl.com
GNU General Public License v2.0
230 stars 55 forks source link

Revise I2C HAL gating logic in tpm_to_infineon #347

Closed gojimmypi closed 2 months ago

gojimmypi commented 2 months ago

This PR updates the gating logic in the hal/tpm_io_infineon.c to be more consistent with other target platforms.

For example, note how the tpm_io_microchip.c is wrapped with WOLFTPM_MICROCHIP_HARMONY, disabling the entire file otherwise:

image

Without this modification, enabling WOLFTPM_INCLUDE_IO_FILE and WOLFTPM_I2C causes a compile-time error as the only gate is WOLFTPM_I2C. In my case, I'm using the Espressf I2C library, not the cyhal here:

image

Here's the content of my wolfTPM options.h:

#define WOLFTPM_ADV_IO
#define WOLFTPM_I2C
#define WOLFTPM_EXAMPLE_HAL
#define WOLFSSL_ESPIDF
#define WOLFTPM_INCLUDE_IO_FILE

Testing

I have not tested this, as I don't have the target library that is being changed.