Commit Graph

28 Commits (master)

Author SHA1 Message Date
David Garske e08874afc7 Add tpm2-pkcs11 CI test against fwTPM, direct and through tpm2-abrmd 2026-11-02 12:12:23 -08:00
David Garske 5b60a8320c Add Infineon SLB9678 SPDM support on the wolfSPDM submodule 2026-10-20 10:22:25 -07:00
Aidan Garske 8ee6a61f26 Move Linux CI workloads into the shared Docker image 2026-10-07 15:32:59 -07:00
Sameeh Jubran 113bf95a31 sbom: vendor wolfGlass and stop looking up gen-sbom in wolfSSL
The generator now ships in tools/sbom, so the autotools and CMake
targets no longer need a wolfSSL checkout to find it. WOLFSSL_DIR
remains only for the wolfSSL dependency version.
2026-09-24 17:02:16 +03:00
Sameeh Jubran 94cf0fae1a sbom: re-sync scripts/sbom.am with the canonical wolfSSL copy
The vendored fragment had drifted 23 lines behind wolfSSL's canonical
scripts/sbom.am. The copy here predated three upstream fixes:

  - SBOM_CONFIG_H, which lets a product whose AC_CONFIG_HEADERS lives in
    a subdirectory point the macro capture at the right config.h.
  - sbomdir now uses Automake's $(docdir), so a --docdir override is
    honoured instead of being hardcoded to $(datadir)/doc/$(PACKAGE).
  - The macro capture now also passes $(AM_CFLAGS) $(CFLAGS), because
    some products carry their feature -D flags there rather than in
    AM_CPPFLAGS.

This drift shipped: it reached master when #536 merged. Drift like this
is exactly what a shared fragment is meant to prevent, and it is
invisible in review because each copy looks self-consistent on its own.

Replace the file wholesale so it is byte-identical to wolfssl master,
which also makes it byte-identical to the wolfCLU, wolfEngine, wolfMQTT,
wolfProvider, wolfSCEP and wolfSSH copies.

wolfTPM sets SBOM_OPTIONS_H, so it takes the product options-header path
and does not need an SBOM_CONFIG_H override of its own.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-09-24 17:00:59 +03:00
Sameeh Jubran fc511714d3 SBOM: adopt shared sbom.am fragment; bring CMake target to parity
Autotools: replace the inline make sbom recipe with the shared
scripts/sbom.am fragment (declare wolftpm identity, LICENSE, wolfSSL
dependency, and wolftpm/options.h as the feature-macro source). Add GIT
discovery + AC_SUBST for reproducible SOURCE_DATE_EPOCH, and revert the
WOLFTPM_LIBRARY_VERSION_{FIRST,SECOND,THIRD} split that only fed the old
hardcoded --lib path (the fragment discovers the artifact by glob).

CMake: pin the SBOM licence to GPL-3.0-or-later (header-accurate; matches
autotools SBOM_LICENSE_OVERRIDE) and record wolfSSL as a dependency via
--dep-wolfssl, capability-gated on gen-sbom --help so older gen-sbom
versions still produce a valid (dependency-less) SBOM.

Pin the license default to GPL-3.0-or-later to match the source headers
("or (at your option) any later version"), fixing the SBOM licence field.

Add a CI workflow that builds wolfSSL + wolfTPM and asserts SBOM identity,
licence, options capture, reproducibility, and the wolfSSL dependency.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-07-10 14:19:24 +03:00
aidan garske e65beffd12 tpm2-tools test: fix flaky tampered TK_HASHCHECK ticket negative test 2026-06-11 17:44:37 -07:00
aidan garske 40716ac612 tests: create restricted AIK for tpm2-tools quote 2026-06-03 11:15:46 -07:00
aidan garske 1e6393938b Fix empty brace scope scan findings 2026-05-14 17:50:08 -07:00
aidan garske 6b82a081e7 Add empty brace scope CI scan 2026-05-14 17:14:34 -07:00
David Garske 19e648442b Add network namespace isolation, macOS CI, and Windows build support for fwTPM
Use unshare --user --net to isolate fwtpm_check.sh TCP ports in CI, eliminating flaky port conflicts on shared runners. Add macOS CI with socket transport tests. Add Windows socket portability (Winsock2) and build-only CI via CMake.
2026-04-21 09:06:44 -07:00
David Garske 35629e96df
Merge pull request #482 from aidangarske/spdm-runners
Add hardware SPDM CI runner + fix SPDM auto-connect regression
2026-04-17 08:21:03 -07:00
David Garske 0c52f3be4d Add firmware TPM 2.0 (fwTPM) implementation
Add portable firmware TPM 2.0 implementation (fwTPM) built on wolfCrypt.
Implements 105/113 TPM 2.0 v1.38 commands (93%) as a standalone server
with socket and TIS transports, NV storage, and full CI/fuzz coverage.
2026-04-16 16:57:57 -07:00
Aidan Garske 3cb1ddb25c Fix SPDM auto-connect and add hardware test CI workflow
- src/tpm2_wrap.c: wolfTPM2_Init auto-SPDM path now calls vendor-specific
     wolfTPM2_SpdmConnectNuvoton/Nations (which sets TIS I/O, mode, and the
     host ephemeral key pair for mutual auth). Previous refactor to the
     generic wolfTPM2_SpdmConnect dropped that setup, so FINISH failed with
     WOLFSPDM_E_PEER_ERROR whenever the TPM was in SPDM-only-locked mode.

   - src/tpm2_spdm.c: wolfSPDM_ParseVendorDefined returns payload dataLen
     (>=0) on success per spdm_tcg.c:72 convention. wolfTPM2_SPDM_SecuredExchange
     was treating any non-zero return as an error, so the first TPM command
     over SPDM (10-byte Startup response) bubbled up as rc=0xa.

   - tests/unit_tests.c: Add test_tpm_alg_supported() helper that queries
     TPM_CAP_ALGS and skip test_wolfTPM2_EccSignVerifyDig iterations when the
     hash isn't supported. Nuvoton NPCT75x lacks SHA512 and returns
     TPM_RC_SIZE parameter 1 (not TPM_RC_HASH), so the prior post-hoc skip
     couldn't catch it.

   - .github/workflows/hw-spdm-test.yml: New workflow targeting a self-hosted
     Raspberry Pi runner. Runs examples/spdm/spdm_test.sh against real Nuvoton
     hardware. Fork-PR gated. Health check soft-fails with a warning if the
     Pi is unhealthy so merging isn't blocked on a flaky runner. Nations
     matrix entry scaffolded (commented) for when the NS350 is wired.

   - scripts/hw-runner-health-check.sh: Pre-flight that verifies /dev/spidev,
     /dev/gpiochip, and gpiod are present+accessible before the build.
2026-04-16 16:15:56 -07:00
aidan garske d6ba3812a9 Upgrade wolfTPM CI testing 2026-02-16 11:06:33 -08:00
Elms 2075d987ce README: Add swtpm build instructions and links
QEMU uses swtpm over unix socket, but it is currently not packaged so
is built from source.
2021-03-17 11:46:40 -07:00
Elms 230e21bbcc README: Add use of devtpm and QEMU
Add description on how to use swtpm with qemu to build and run and
test with wolfTPM within QEMU.
2021-03-17 11:46:40 -07:00
Elms ba75a0b438 tests: Pass test with ibmswtpm2
RC handle number modifier is added to response code.
2021-03-04 15:24:59 -08:00
David Garske 8087afaf27 Fixes from peer review. Resolve issue with make check. Removed the TPM Simulator for make check (does not build out of the box on all platforms). Make dist was not including the new tpm2_socket.h. 2020-12-01 07:45:04 -08:00
David Garske 4b0b70861c Added parameter encryption support to more examples. Fix to not set "encrypt" or "decrypt" if command doesn't allow it. Updated documentation. 2020-11-30 12:00:54 -08:00
David Garske dbd8e41b47 Refactor of the session authentication. Added "-e" option to some examples to enable parameter encryption and removed the _paramenc.c files. Fixup for the `getPrimaryStoragekey` to allow persisting if not `WOLFTPM_WINAPI`. Improve command line options. Added calculation of command hash and HMAC for sessions. 2020-11-20 16:47:14 -08:00
David Garske b48f53f5e7 Improvements to the example tls_server to accept "RSA" or "ECC". Improvement to TLS examples to old load keys/certs that are needed (reduces max handle load count). Added missing `scripts/tls_setup.sh` to automake. 2020-11-13 16:33:14 -08:00
Elms 951e27f706 examples: cleanup for mingw coexistence 2020-11-13 14:38:19 -08:00
Elms 0bff836fa2 examples: Cleanup TLS examples using keyblob 2020-11-13 11:31:01 -08:00
Elms d14e96fb6a scripts: support simulator on darwin and warn if starting fails 2020-10-01 11:09:10 -07:00
Elms e93c47c11b `make check` runs with simulator for `--enable-swtpm` 2020-09-30 13:11:24 -07:00
Elms d3bb89b0d7 scripts: fix swtpm_sim.test for OSX 2020-09-30 12:10:46 -07:00
Elms 905ee9a6f9 scripts: Add script to run unit tests with SWTPM 2020-09-28 16:25:16 -07:00