Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ jobs:
- name: "No HAL"
os: ubuntu-latest
options: "-DWOLFTPM_HAL=no"
- name: "No HAL SPI"
os: ubuntu-latest
options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_HAL=no"
# Test Firmware disabled
- name: "No Firmware"
os: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/make-test-swtpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ jobs:
- name: hal-reset
wolftpm_config: --enable-st33 --enable-hal-reset --disable-fwtpm
test_command: "true"
# No example HAL, caller supplies the IO callback (compile-only)
- name: no-hal
wolftpm_config: --enable-spi --disable-hal --disable-fwtpm
test_command: "true"
# SPDM + Nuvoton (compile-only, no hardware in CI)
- name: spdm-nuvoton
wolfssl_config: --enable-wolftpm --enable-ecc --enable-sha384 --enable-aesgcm --enable-hkdf --enable-sp
Expand Down
7 changes: 5 additions & 2 deletions hal/tpm_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
/* Native Windows, native Linux and TPM Simulator do not need an IO callback */
#if ! (defined(WOLFTPM_LINUX_DEV) || \
defined(WOLFTPM_SWTPM) || \
defined(WOLFTPM_WINAPI) )
defined(WOLFTPM_WINAPI) ) && \
(defined(WOLFTPM_EXAMPLE_HAL) || defined(WOLFTPM_MMIO) || \
defined(WOLFTPM_FWTPM_HAL))

/* Set WOLFTPM_INCLUDE_IO_FILE so each .c is built here and not compiled directly */
#define WOLFTPM_INCLUDE_IO_FILE
Expand Down Expand Up @@ -280,7 +282,8 @@ int TPM2_IoCb_Reset(TPM2_CTX* ctx, void* userCtx)
}
#endif /* WOLFTPM_HAL_RESET */

#endif /* !(WOLFTPM_LINUX_DEV || WOLFTPM_SWTPM || WOLFTPM_WINAPI) */
#endif /* !(WOLFTPM_LINUX_DEV || WOLFTPM_SWTPM || WOLFTPM_WINAPI) &&
* (WOLFTPM_EXAMPLE_HAL || WOLFTPM_MMIO || WOLFTPM_FWTPM_HAL) */

/******************************************************************************/
/* --- END IO Callback Logic -- */
Expand Down
10 changes: 8 additions & 2 deletions hal/tpm_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@

#else

#ifdef WOLFTPM_EXAMPLE_HAL
#if defined(WOLFTPM_EXAMPLE_HAL) || defined(WOLFTPM_MMIO) || \
defined(WOLFTPM_FWTPM_HAL)

#ifdef WOLFTPM_ADV_IO
WOLFTPM_API int TPM2_IoCb(TPM2_CTX* ctx, INT32 isRead, UINT32 addr,
Expand Down Expand Up @@ -160,7 +161,12 @@ WOLFTPM_LOCAL int TPM2_IoCb_Linux_Reset(TPM2_CTX* ctx, void* userCtx);
#endif
#endif

#endif /* WOLFTPM_EXAMPLE_HAL */
#else

/* No example HAL: caller supplies its own IO callback to wolfTPM2_Init */
#define TPM2_IoCb NULL

#endif /* WOLFTPM_EXAMPLE_HAL || WOLFTPM_MMIO || WOLFTPM_FWTPM_HAL */
#endif /* !(WOLFTPM_LINUX_DEV || WOLFTPM_SWTPM || WOLFTPM_WINAPI) */

#ifdef __cplusplus
Expand Down
Loading