wolfTPM

wolfTPM is a TPM 2.0 library for physical and firmware TPMs. It is my largest area: I added post-quantum commands, SPDM, the Rust crate, and hardening.

Role: major contributor C, TPM 2.0 v1.85, SPDM, Rust wolfSSL/wolfTPM
01 / What I built

Main changes

02 / Design

One design choice

Anything a TPM, firmware TPM, or SPDM tunnel sends is outside data, so every length is checked against the bytes actually received. Clamping a bad length and carrying on can report success with a wrong size, so the parser now rejects instead.

03 / Debugging

A bug I fixed

TPM2_Encapsulate clamped an oversized length field to the buffer and returned success with a ciphertext size larger than the bytes received. I added a strict parser that returns TPM_RC_SIZE, and zeroed the shared secret on failure. (#621)

04 / Verification

How it was checked

PREvidence
#621New unit test for the strict parser; existing fwTPM ML-KEM round-trip tests still pass.
#627Sign and verify matrix plus weak pre-hash rejection table; pqc_ctrl.sh passes 20/20 against wolfSSL master.
05 / Limits

What is not done yet

The strict pre-hash rule broke pre-production TPM firmware that only takes SHA-256, so a build-time opt-out exists. Some response types still use the older clamping parser.

All my merged pull requests 122 in wolfSSL/wolfTPM
  • #680Add an application-supplied TPM command transport
  • #670Fix spdm_ctrl public key output and error reporting
  • #632Harden fwTPM state handling
  • #641Fix fwTPM policy authValue, hash ticket, and encrypted duplication checks
  • #635Add code size regression reporting
  • #629Harden fwTPM command processing
  • #634Harden wolfTPM transport handling
  • #633Harden wolfTPM examples
  • #630Harden wolfTPM wrappers
  • #631Harden wolfTPM client parsing
  • #627Reject Hash-ML-DSA keys whose pre-hash is weaker than the parameter set
  • #626Add the wolfTPM manual as an in-repo docs/ source with build tooling
  • #625Run Linux CI in the shared Docker image
  • #617Build SPDM from the wolfSPDM submodule
  • #620Reject PCR property capability counts larger than the response
  • #622Reject storage keys in fwTPM decrypt commands and bind split param-enc sessions
  • #621Reject truncated or malformed ML-KEM encapsulation results
  • #615Bound fwTPM PCR capability response parsing
  • #614Skip unsupported SHA-1 and add PQC smoke examples
  • #616Clarify SealSQ PQC builds and examples
  • #613Correct fwTPM hierarchy and NV behavior and clear TPM command secrets
  • #611Add docs.rs support and crates.io packaging to the wolftpm crate
  • #602Add official wolfTPM Rust wrapper crate
  • #594Add TPM2_PolicyTransportSPDM support for client and firmware TPM
  • #610Reduce the fwTPM RAM use when NV is disabled
  • #609Include missing dist files
  • #590Bump version to v4.2.0 and add the 4.2.0 ChangeLog
  • #608Fix fwTPM SPDM and TPM transport security findings
  • #605Guard fwTPM public name computation on buffer allocation success
  • #604Harden wolfTPM examples fwTPM and SPDM error handling and secret zeroization
  • #603Restrict unsealed output file permissions
  • #598Fix error handling in wolfTPM examples
  • #595Bound fwTPM child blob sizes before copying from the response
  • #596Harden fwTPM key derivation and command validation
  • #600Improve TPM2 core zeroization and robustness and comments correctness
  • #597Fix TPM2 core parsing key import and response handling
  • #599Fix SPI transfer error handling and SPDM version parsing
  • #601Refresh expired wolfSSL example CA certs and add a refresh script
  • #592Support ML-KEM credential activation and ML-DSA quotes in fwTPM
  • #593Make fwTPM state changes transactional and harden PolicyPCR and private-blob wrapping
  • #591Coverity fixes Harden TPM bounds and configuration paths
  • #588Harden fwTPM protocol handling and SPDM authentication
  • #584Fix TCG v185 complaince issues for fwtpm and spdm
  • #582Harden wolfTPM validation and data handling
  • #581Harden PCR policy bounds checks
  • #579Correct fwTPM command attribute reporting and verified ticket HMAC algorithm
  • #577Fix fwTPM hierarchy and policy authorization gaps and SPDM responder version negotiation
  • #578Validate v1.85 ML-DSA and ML-KEM templates in LoadExternal and CreateLoaded
  • #570Add SealSQ QVault post-quantum TPM Support
  • #573Reject unsupported LoadExternal private types and fix creation ticket HMAC order
  • #575Validate NV space authorization and report v1.85 revision in fwtpm
  • #572Correct PolicyAuthorize response codes for keySign name ticket and approvedPolicy
  • #571Fix wolfCrypt refcount race P521 primary derivation and policy session auth bypass
  • #563Reuse transport connections and reduce NV write and hash cache overhead
  • #568Fix v185 spec compliance authenticate object context blobs on ContextSave/Load
  • #567Fix v185 fwtpm compliance issues for PolicyAuthorize
  • #566Fix v185 fwtpm complaince issue with auth entry
  • #565Strengthen TPM input validation and memory handling
  • #552Fix AES_BLOCK_SIZE undeclared under OPENSSL_COEXIST wolfSSL
  • #559Add TPM MLDSA authentication for post quantum TLS 1.3 with example and tests
  • #561Fix fwTPM response buffer overflow, SPDM clear-frame command bypass, and other misc hardening
  • #558Guard tainted PCR select copy in fwTPM properties Coverity test
  • #555Bound TPM2 response decrypt-parameter size, zeroize primary-key auth, and expand marshalling/import test coverage
  • #551Harden crypto callback, ASN.1 parsing, param-enc and marshalling; add negative tests
  • #548Bound tainted count/index in fwTPM PCR_PROPERTIES capability unit test (Coverity CID 911468)
  • #547Harden ECDH buffer bounds, RSA/ECC key conversion, identity auth, and fwTPM PQC TestParms
  • #545Bound response parameterSize, fix SPI auto-detect off-by-one, document import dual-use default
  • #537Add Transparent TPM_RC_RETRY auto-resubmit
  • #542Fix 4 Coverity findings (fwTPM PolicyNV, listen socket, secret_seal)
  • #541fwTPM: Dictionary Attack (DA) hardening and DA/noDA test coverage
  • #539Select session, RSA OAEP and PQC template hash algorithms via _ex wrappers
  • #538Remove unreachable plaintext Rewrap branch in fwtpm (Coverity CID 910043)
  • #535Various hardening fixes and tests
  • #534CI: ghcr image for apt deps + intensive wolfSSL/ibmswtpm2 build caching
  • #533Gate ML-KEM/ML-DSA name helpers on WOLFTPM_PQC for lean --enable-pqc builds
  • #527Fine-grained PQC (v1.85) build macros: trim ML-DSA/ML-KEM by algorithm and operation
  • #530always set continueSession in password auth response for fwtpm
  • #528Filter cpp/path-injection false positives from CodeQL
  • #525Auto-resolve latest wolfSSL stable and test functional suites against it
  • #526fix flaky tampered TK_HASHCHECK ticket negative test
  • #524Add CodeQL, Semgrep, and Copilot security review gates
  • #520Fix PQC minor leak, capability-gate tests, add negative examples, add PQC benchmarks
  • #523Harden Testing and fwTPM/src
  • #521Remove flaky SPDM HW tests in CI
  • #518fwTPM/wolfTPM testing and hardening
  • #510Add fwtpm SPDM support
  • #511security review fixes batch 12
  • #512security review fixes batch 13
  • #508Optimize CI for wolfTPM
  • #507Add empty brace scope CI scan
  • #503Hardening fixes for examples, fwTPM command handlers, and crypto helpers
  • #501Fix changes to pqc header file rename
  • #445Add TPM 2.0 v1.85 PQC (ML-DSA and ML-KEM) and fwTPM PQC Support
  • #496Security Hardening and TCG v185 compliance
  • #494Fix NS350 RSA-4096 Failures
  • #491fwTPM/SPDM/src corrections and unit test additions
  • #489Normalize NS350 chip state at entry/exit of nations SPDM tests
  • #488Add Unit Testing, Fix Short Curcuits, Other fixes
  • #487Fix SPI and I2C behavior with SWTPM or FWTPM
  • #481SPDM and Examples Fixes and Unit Testing
  • #485Split hardware SPDM CI across runners
  • #484Reset on SPDM runner test
  • #482Add hardware SPDM CI runner + fix SPDM auto-connect regression
  • #480Test Mutations, Unit tests, ForceZero Unification, and Fixes for wolfTPM
  • #458wolfTPM SPDM support (Nuvoton NPCT75x and NSING NS350)
  • #475Fix wolfTPM security review Findings (4)
  • #473Fix tls ecdh curve mismatch (wolfTPM build test CI failures)
  • #470Fix security review wolfTPM findings (3)
  • #468Fix security review issues
  • #464Add seal/unseal examples with PCR, PolicyAuthorize, and NV policies
  • #465Fix H-35, M-74, M-75 for wolfTPM
  • #463Fix coverity scan issues in wolfTPM
  • #461Fix security vulnerabilities found in security review
  • #460Improve error logging when wolfTPM2_Init fails
  • #459Fix coverity DEADCODE CID 900621 from pr 455
  • #454Upgrade wolfTPM CI testing
  • #452Fix for st33KTPM support pr deadcode
  • #446Add STM33TPM Firmware Update Support for LMS/non-LMS
  • #451Update U-boot Support with SPI use
  • #395wolfTPM Zephyr Project Port
  • #398wolfTPM Support For Das U-Boot Bootloader
  • #409Keygen Optional Authentication Password -auth=<yourpassword>

all work view the repository