Skip to content

Commit f3fd746

Browse files
committed
wolfTPM Release v4.0.0 Prep
1 parent ba8dcee commit f3fd746

172 files changed

Lines changed: 467 additions & 213 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/make-test-swtpm.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ jobs:
4949
wolftpm_config: --enable-swtpm --disable-wrapper --disable-fwtpm
5050
test_command: "./examples/native/native_test"
5151

52+
# No examples (compile-only; examples disabled so no test_command)
53+
- name: no-examples
54+
wolftpm_config: --enable-swtpm --disable-examples --disable-fwtpm
55+
test_command: "true"
56+
5257
# Small stack
5358
- name: smallstack
5459
wolftpm_config: --enable-swtpm --enable-smallstack --disable-fwtpm
@@ -72,6 +77,10 @@ jobs:
7277
# STMicro ST33KTPM2
7378
- name: st33ktpm2
7479
wolftpm_config: --enable-st33 --disable-fwtpm
80+
# STMicro ST33KTPM2 over I2C (compile-only, no hardware in CI)
81+
- name: st33ktpm2-i2c
82+
wolftpm_config: --enable-st33 --enable-i2c --disable-fwtpm
83+
test_command: "true"
7584
# STMicro ST33KTPM2
7685
- name: st33ktpm2 firmware
7786
wolftpm_config: --enable-st33 --enable-firmware --disable-fwtpm
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Release Checks
2+
3+
# Gates intended to mirror the wolfTPM release procedure:
4+
# - C++ build with CC=g++ (proves headers are C++-safe for consumers)
5+
# - scan-build --status-bugs (Clang static analysis)
6+
# Both run on every PR and every push to release branches so regressions are
7+
# caught at PR time instead of during release prep.
8+
9+
on:
10+
push:
11+
branches: [ 'master', 'main', 'release/**', 'rel_v*_prep' ]
12+
pull_request:
13+
branches: [ '*' ]
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build_wolfssl:
21+
name: Build wolfSSL
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 10
24+
steps:
25+
- name: Checkout wolfSSL
26+
uses: actions/checkout@v4
27+
with:
28+
repository: wolfssl/wolfssl
29+
path: wolfssl
30+
ref: master
31+
32+
- name: Build wolfSSL
33+
working-directory: ./wolfssl
34+
run: |
35+
./autogen.sh
36+
./configure --enable-wolftpm --enable-pkcallbacks --enable-keygen \
37+
--prefix=/tmp/wolfssl-install \
38+
CFLAGS="-DWC_RSA_NO_PADDING"
39+
make -j$(nproc)
40+
make install
41+
42+
- name: Tar install dir
43+
run: tar -zcf wolfssl-install.tgz -C /tmp wolfssl-install
44+
45+
- name: Upload wolfSSL install
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: wolfssl-release-checks
49+
path: wolfssl-install.tgz
50+
retention-days: 1
51+
52+
cxx_build:
53+
name: C++ build (CC=g++)
54+
runs-on: ubuntu-latest
55+
timeout-minutes: 10
56+
needs: build_wolfssl
57+
steps:
58+
- name: Checkout wolfTPM
59+
uses: actions/checkout@v4
60+
61+
- name: Download wolfSSL
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: wolfssl-release-checks
65+
66+
- name: Install wolfSSL
67+
run: |
68+
sudo tar -xzf wolfssl-install.tgz -C /tmp
69+
sudo ldconfig /tmp/wolfssl-install/lib
70+
71+
- name: Build wolfTPM with g++ (default config)
72+
run: |
73+
./autogen.sh
74+
./configure CC=g++ \
75+
--with-wolfcrypt=/tmp/wolfssl-install
76+
make -j$(nproc)
77+
78+
- name: Build wolfTPM with g++ (--enable-fwtpm)
79+
run: |
80+
make distclean
81+
./configure CC=g++ --enable-fwtpm \
82+
--with-wolfcrypt=/tmp/wolfssl-install
83+
make -j$(nproc)
84+
85+
- name: Show log on errors
86+
if: failure()
87+
run: cat config.log
88+
89+
scan_build:
90+
name: scan-build (clang static analysis)
91+
runs-on: ubuntu-latest
92+
timeout-minutes: 15
93+
needs: build_wolfssl
94+
steps:
95+
- name: Install clang tools
96+
run: |
97+
sudo apt-get update
98+
sudo apt-get install -y clang-tools
99+
100+
- name: Checkout wolfTPM
101+
uses: actions/checkout@v4
102+
103+
- name: Download wolfSSL
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: wolfssl-release-checks
107+
108+
- name: Install wolfSSL
109+
run: |
110+
sudo tar -xzf wolfssl-install.tgz -C /tmp
111+
sudo ldconfig /tmp/wolfssl-install/lib
112+
113+
- name: scan-build default configuration
114+
run: |
115+
./autogen.sh
116+
scan-build --status-bugs ./configure \
117+
--with-wolfcrypt=/tmp/wolfssl-install
118+
scan-build --status-bugs -o scan-results-default make -j$(nproc)
119+
120+
- name: scan-build with --enable-fwtpm
121+
run: |
122+
make distclean
123+
scan-build --status-bugs ./configure --enable-fwtpm \
124+
--with-wolfcrypt=/tmp/wolfssl-install
125+
scan-build --status-bugs -o scan-results-fwtpm make -j$(nproc)
126+
127+
- name: Upload scan reports on failure
128+
if: failure()
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: scan-build-reports
132+
path: |
133+
scan-results-default/
134+
scan-results-fwtpm/
135+
retention-days: 7

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CMakeList.txt
22
#
3-
# Copyright (C) 2006-2025 wolfSSL Inc.
3+
# Copyright (C) 2006-2026 wolfSSL Inc.
44
#
55
# This file is part of wolfSSL. (formerly known as CyaSSL)
66
#
@@ -21,7 +21,7 @@
2121

2222
cmake_minimum_required(VERSION 3.16)
2323

24-
project(wolfTPM VERSION 3.10.0 LANGUAGES C)
24+
project(wolfTPM VERSION 4.0.0 LANGUAGES C)
2525

2626
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
2727
set(WOLFTPM_DEFINITIONS)
@@ -638,7 +638,7 @@ file(REMOVE ${OPTION_FILE})
638638
file(APPEND ${OPTION_FILE} "/* wolftpm options.h\n")
639639
file(APPEND ${OPTION_FILE} " * generated from cmake configure options\n")
640640
file(APPEND ${OPTION_FILE} " *\n")
641-
file(APPEND ${OPTION_FILE} " * Copyright (C) 2006-2025 wolfSSL Inc.\n")
641+
file(APPEND ${OPTION_FILE} " * Copyright (C) 2006-2026 wolfSSL Inc.\n")
642642
file(APPEND ${OPTION_FILE} " *\n")
643643
file(APPEND ${OPTION_FILE} " * This file is part of wolfSSL.\n")
644644
file(APPEND ${OPTION_FILE} " *\n")

ChangeLog.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,98 @@
11
# Release Notes
22

3+
## wolfTPM Release 4.0.0 (Apr 22, 2026)
4+
5+
**Summary**
6+
7+
Major release with three new features:
8+
9+
1. Firmware TPM 2.0 (fwTPM): a portable TPM 2.0 command processor built on wolfCrypt, usable as a replacement for a discrete TPM chip or as a CI/development replacement for external simulators.
10+
2. SPDM secured transport: secure vendor-defined TCG command communication with Nuvoton NPCT75x and Nations NS350 TPM modules.
11+
3. ST33KTPM2X firmware update: automatic format detection for both Generation 1 (non-LMS) and Generation 2 (LMS-signed) ST33KTPM firmware.
12+
13+
Also includes new seal/unseal examples, additional platform/HAL support, extensive security hardening (Fenrir and Coverity), CI sanitizer coverage, and deprecation of OPENSTM32.
14+
15+
**Detail**
16+
17+
* Firmware TPM 2.0 (fwTPM) implementation (PR #474)
18+
- Portable TPM 2.0 server built on wolfCrypt (RSA, ECC, SHA, AES, HMAC)
19+
- 105/113 TPM 2.0 v1.38 commands implemented (93%)
20+
- Socket transport (Microsoft TPM simulator protocol) and TIS transport
21+
- File-based or HAL-callback NV storage; HAL abstraction for IO
22+
- New configure options: `--enable-fwtpm` and `--enable-fwtpm-only`
23+
- New feature macros: `FWTPM_NO_NV`, `FWTPM_NO_ATTESTATION`, `FWTPM_NO_POLICY`, `FWTPM_NO_DA`
24+
- Full CI coverage: `fwtpm-test.yml` (11 matrix entries), `fuzz.yml` (weekly + per-PR smoke)
25+
- macOS and Windows build support with network-namespace isolation for Linux CI
26+
* SPDM secured transport for Nuvoton NPCT75x and Nations NS350 (PR #458)
27+
- Generic `WOLFTPM_SPDM_TCG` guard replaces per-vendor conditionals
28+
- Vendor-defined TCG commands with VdCode validation
29+
- PSK mode and identity-key mode with auto-connect
30+
- Hardware test CI workflow split across self-hosted runners
31+
- Added `spdm_ctrl` utility (renamed from `spdm_demo`)
32+
* STMicro ST33KTPM2X firmware update with LMS support (PR #446)
33+
- New `st33_fw_update` example tool for ST33KTPM firmware updates
34+
- Automatic firmware format detection based on TPM firmware version from `fwVerMinor`
35+
- Generation 1 firmware (< 512, e.g. 9.257): Non-LMS format, 177-byte manifest, ECC-only
36+
- Generation 2 firmware (>= 512, e.g. 9.512): LMS format, 2697-byte manifest with embedded LMS signature (LMS mandatory)
37+
- No manual format selection required - manifest size chosen automatically
38+
- See `examples/firmware/README.md` "ST33 Firmware Update" for usage
39+
* Seal/unseal examples with PCR, PolicyAuthorize, and NV policies (PR #464)
40+
- Seal/unseal with PCR and policy authorization
41+
- NV-based seal example with real parameter encryption (XOR and AES-CFB)
42+
- New `seal-test.yml` CI workflow
43+
* Platform and HAL additions
44+
- Raspberry Pi 4 hardware SPI support (PR #451)
45+
- U-Boot HAL (`tpm_io_uboot.c`)
46+
- Espressif ESP-IDF HAL SPI
47+
- Linux auto-detection between `/dev/tpmX` and direct SPI at runtime
48+
* Crypto callback and signing
49+
- TPM support for `wc_SignCert_cb` callback API (PR #450)
50+
- Fix for `wolfTPM2_SignHash` to return padded r/s, improved ECDSA P521 handling, added ECDSA tests with crypto callbacks (ZD20777)
51+
* Security hardening
52+
- Fenrir findings addressed across tpm2_wrap, tpm2_packet, tpm2_asn, NV, session auth, SPDM, and fwtpm paths
53+
- `ForceZero` on sensitive stack buffers (auth passwords, keyBlob, ECC/RSA private material, symmetric seeds, derived identity digests, NV read/write buffers, PSS padded buffers, session auth)
54+
- Constant-time export for ECDH shared secret and ECC signature r/s
55+
- Removed short-circuit OR in auth paths (HMAC verification, policy digest checks, ticket HMAC, ticket cpHashA, policy NV, PolicyPassword, credential unwrap, RSA-PKCS1v1.5)
56+
- Bounds checks for `TPM2_Packet_AppendPCR` count/sizeofSelect, ASN.1 BIT STRING length, X.509 version, BER indefinite length, `wolfTPM2_UnloadHandles` handle-range overflow
57+
- NULL-deref guards in `wolfTPM2_LoadRsaPrivateKey_ex`, `wolfTPM2_LoadEccPrivateKey`, `wolfTPM2_NVCreateAuthPolicy`, `wolfTPM2_EncryptDecryptBlock` (reject NULL IV for non-ECB, oversized IV)
58+
- Scaled AES key size to RSA key strength in `wolfTPM2_ImportRsaPrivateKeySeed`; scaled session AES key size to match authHash in `wolfTPM2_StartSession`
59+
- Return `BUFFER_E` instead of silently truncating auth values in `wolfTPM2_SetAuth`, `wolfTPM2_CreateKey`, `wolfTPM2_ChangeAuthKey`, `wolfTPM2_SetAuthHandleName`, `wolfTPM2_CreatePrimaryKey_ex`, `wolfTPM2_CreateLoadedKey`, `wolfTPM2_PolicyPassword`
60+
- Removed sensitive auth and key material from debug output; added `WOLFTPM_DEBUG_SECRETS` opt-in macro for developer-only printing
61+
- Moved auth size mismatch check outside `DEBUG_WOLFTPM` guard so it executes in all builds
62+
* Coverity and static analysis
63+
- New Coverity CI workflow (PR #444)
64+
- Fixed H-35, M-74, M-75 (PR #465)
65+
- DEADCODE CID 900621 and related fixes
66+
* CI improvements
67+
- Added ASan and UBSan sanitizers (PR #454)
68+
- Pedantic gcc and pedantic clang build matrices
69+
- macOS CI for fwTPM
70+
- Windows build support for fwTPM
71+
- Split hardware SPDM CI across multiple self-hosted runners
72+
- Added unit tests for name/hash KATs, KDFa test vectors (ATH/SECRET/DUPLICATE labels), ParamEnc/Dec roundtrip, persistent-handle range checks, `ComputeName`, `HashNvPublic`, `PolicyHash` boundary, policy auth value offset
73+
* Marshaling and packet fixes
74+
- `TPM_ALG_NULL` handling for `inScheme` serialization in Certify, CertifyCreation, Quote, GetSessionAuditDigest, GetCommandAuditDigest, GetTime, NV_Certify
75+
- Added `TPM2_Packet_AppendSymmetric`/`ParseSymmetric` for SYMCIPHER case
76+
- Fixed ECC ECDAA scheme serialization missing count field, RSA RSAES spurious hashAlg, `TPM2_Sign` ECDAA count
77+
- Added SM3_256 and SHA3 digest sizes to `TPM2_GetHashDigestSize`
78+
- Added ECSCHNORR and SM2 signature serialization
79+
- Added `kdf` field to `TPMT_KEYEDHASH_SCHEME` XOR serialization
80+
- Added `TPM2_Packet_ParseSensitive` counterpart and roundtrip test
81+
- Documented `pub->size` mutation side effect in `TPM2_Packet_AppendPublic`
82+
* Bug fixes
83+
- Fixed TLS ECDH curve mismatch in CI (PR #473)
84+
- Added missing `unistd.h` include causing regressions in wolfBoot tpmtools (PR #471)
85+
- Avoid nanosleep on non-Linux builds (PR #472)
86+
- Fixed MAX_CONTEXT_SIZE stack buffer in CSR PEM using heap for small-stack builds (PR #460)
87+
- Fixed AddressSanitizer warning for overlapping memcpy (use memmove) in wolfTPM2_USE_SW_ECDHE path
88+
- Proper guarding for `LINUX_DEV`, `SWTPM`, and `WINAPI` (PR #466)
89+
- Added error returns in `TPM2_IoCb_Zephyr_I2C`
90+
- Improved error logging when `wolfTPM2_Init` fails
91+
- Used `mp_to_unsigned_bin_len` (not `_ct`) for portability across wolfSSL builds
92+
* Deprecated / removed
93+
- OPENSTM32 platform support removed (PR #479)
94+
95+
396
## wolfTPM Release 3.10.0 (Dec 4, 2025)
497

598
**Summary**

IDE/Espressif/components/wolfssl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2006-2025 wolfSSL Inc.
2+
# Copyright (C) 2006-2026 wolfSSL Inc.
33
#
44
# This file is part of wolfTPM.
55
#

IDE/Espressif/components/wolfssl/include/user_settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* user_settings.h
22
*
3-
* Copyright (C) 2006-2025 wolfSSL Inc.
3+
* Copyright (C) 2006-2026 wolfSSL Inc.
44
*
55
* This file is part of wolfTPM.
66
*

IDE/Espressif/components/wolftpm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wolfTPM cmake for Espressif component
22
#
3-
# Copyright (C) 2006-2025 wolfSSL Inc.
3+
# Copyright (C) 2006-2026 wolfSSL Inc.
44
#
55
# This file is part of wolfTPM.
66
#

IDE/Espressif/main/include/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 2006-2025 wolfSSL Inc.
3+
* Copyright (C) 2006-2026 wolfSSL Inc.
44
*
55
* This file is part of wolfTPM.
66
*

IDE/Espressif/main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* main.c
22
*
3-
* Copyright (C) 2006-2025 wolfSSL Inc.
3+
* Copyright (C) 2006-2026 wolfSSL Inc.
44
*
55
* This file is part of wolfTPM.
66
*

IDE/VisualStudio/user_settings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* user_settings.h
22
*
3-
* Copyright (C) 2006-2025 wolfSSL Inc.
3+
* Copyright (C) 2006-2026 wolfSSL Inc.
44
*
55
* This file is part of wolfTPM.
66
*

0 commit comments

Comments
 (0)