Skip to content
Open
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
141 changes: 141 additions & 0 deletions .github/workflows/fwtpm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,64 @@ jobs:
build_only: true
extra_cflags: -DFWTPM_NO_PARAM_ENC

# Build-only: finer per-command-group FWTPM_NO_* macros
- name: fwtpm-no-key-migration

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 [Medium] New feature gates receive no behavioral/runtime test coverage · Missing Tests

Every newly added matrix configuration sets build_only: true and no test or example source references any of the six new macros, so CI verifies compilation only. It never checks that a gated command returns TPM_RC_COMMAND_CODE, disappears from TPM_CAP_COMMANDS, or updates TPM_PT_TOTAL_COMMANDS, nor that the FWTPM_NO_HASH_CMDS + MLDSA sequence path works. This gap is exactly what let the retained-but-unusable MLDSA SequenceComplete entry pass. Additionally, the documented all-gates ECC-only/NO_RSA minimal configuration is not built because the all-gates entry does not disable RSA. Severity views differ (review: Medium; review-security: Low); stricter Medium kept.

Fix: Add at least one runtime gated configuration that checks command rejection and capability/count reporting, plus an MLDSA sequence test under FWTPM_NO_HASH_CMDS. Also build the documented all-gates ECC-only/NO_RSA configuration.

os: ubuntu-latest
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen
build_only: true
extra_cflags: -DFWTPM_NO_KEY_MIGRATION

- name: fwtpm-no-ecdh
os: ubuntu-latest
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen
build_only: true
extra_cflags: -DFWTPM_NO_ECDH

- name: fwtpm-no-hash-cmds
os: ubuntu-latest
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen
build_only: true
extra_cflags: -DFWTPM_NO_HASH_CMDS

- name: fwtpm-no-context
os: ubuntu-latest
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen
build_only: true
extra_cflags: -DFWTPM_NO_CONTEXT

- name: fwtpm-no-sym-encrypt
os: ubuntu-latest
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen
build_only: true
extra_cflags: -DFWTPM_NO_SYM_ENCRYPT

- name: fwtpm-no-clock
os: ubuntu-latest
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen
build_only: true
extra_cflags: -DFWTPM_NO_CLOCK

# Build-only: fewer PCRs than the 24 standard ones. The locality
# tables are sized to a fixed 24 while IMPLEMENTATION_PCR sets the
# implemented count, so this leg proves the two boundaries compile
# apart. PLATFORM_PCR must drop with it or PCR_SELECT_MIN exceeds
# PCR_SELECT_MAX. Runtime coverage is in fwtpm-gated-runtime.
- name: fwtpm-reduced-pcr
os: ubuntu-latest
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen
build_only: true
extra_cflags: -DIMPLEMENTATION_PCR=8 -DPLATFORM_PCR=8

# Note: the all-gates combinations are built AND run by the
# fwtpm-gated-runtime job below, so they are not duplicated here.

# Build-only: cross-algorithm + feature macro combinations
- name: fwtpm-no-rsa-no-policy
os: ubuntu-latest
Expand Down Expand Up @@ -300,6 +358,89 @@ jobs:
tests/*.log
retention-days: 5

# ----------------------------------------------------------------
# Command-group gates: runtime behavior, not just compilation.
#
# `make check` cannot be used here - it also runs fwtpm_check.sh, which
# drives the examples and tpm2-tools against a server that no longer
# implements the gated commands. This job builds each gated configuration
# and runs only tests/fwtpm_unit.test, whose test_fwtpm_command_gates /
# test_fwtpm_total_commands cases assert that a gated command is rejected
# with TPM_RC_COMMAND_CODE, is absent from TPM_CAP_COMMANDS, and is not
# counted in TPM_PT_TOTAL_COMMANDS.
# ----------------------------------------------------------------
fwtpm-gated-runtime:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Every command-group gate together on an ECC-only build - the
# minimal configuration documented in docs/FWTPM.md.
- name: all-gates-ecc-only
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen --disable-rsa
extra_cflags: >-
-DFWTPM_NO_POLICY
-DFWTPM_NO_ATTESTATION
-DFWTPM_NO_CREDENTIAL
-DFWTPM_NO_DA
-DFWTPM_NO_PARAM_ENC
-DFWTPM_NO_KEY_MIGRATION
-DFWTPM_NO_ECDH
-DFWTPM_NO_HASH_CMDS
-DFWTPM_NO_CONTEXT
-DFWTPM_NO_SYM_ENCRYPT
-DFWTPM_NO_CLOCK

# Same gates with ML-DSA: SequenceUpdate must survive (the ML-DSA
# verify sequences stream through it) while SequenceComplete must
# not, and the ML-DSA sign/verify sequence tests must still pass.
- name: all-gates-mldsa
wolftpm_config: --enable-fwtpm --enable-swtpm --enable-v185 --enable-mldsa
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen --enable-experimental --enable-dilithium --enable-mlkem
extra_cflags: >-
-DFWTPM_NO_POLICY
-DFWTPM_NO_ATTESTATION
-DFWTPM_NO_CREDENTIAL
-DFWTPM_NO_DA
-DFWTPM_NO_PARAM_ENC
-DFWTPM_NO_KEY_MIGRATION
-DFWTPM_NO_ECDH
-DFWTPM_NO_HASH_CMDS
-DFWTPM_NO_CONTEXT
-DFWTPM_NO_SYM_ENCRYPT
-DFWTPM_NO_CLOCK

# Fewer PCRs than the 24 standard ones: exercises the highest
# implemented PCR and the first unavailable one
# (test_fwtpm_pcr_bounds).
- name: reduced-pcr
wolftpm_config: --enable-fwtpm --enable-swtpm
wolfssl_config: --enable-wolftpm --enable-pkcallbacks --enable-keygen
extra_cflags: -DIMPLEMENTATION_PCR=8 -DPLATFORM_PCR=8

steps:
- name: Checkout wolfTPM
uses: actions/checkout@v4

- name: Setup wolfSSL
uses: ./.github/actions/setup-wolfssl
with:
configure-flags: ${{ matrix.wolfssl_config }}
cflags: -DWC_RSA_NO_PADDING ${{ matrix.extra_cflags }}

- name: Build wolfTPM (${{ matrix.name }})
run: |
./autogen.sh
./configure ${{ matrix.wolftpm_config }} \
CFLAGS="${{ matrix.extra_cflags }}"
make -j"$(nproc)" tests/fwtpm_unit.test

- name: Run fwTPM handler tests
run: ./tests/fwtpm_unit.test

# ----------------------------------------------------------------
# Dictionary Attack TPM_RC_RETRY (daUsed) end-to-end.
# Builds the server with -DFWTPM_DA_USED_RETRY so it returns TPM_RC_RETRY on
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Features:
* TIS register-level transport over shared memory or SPI/I2C for bare-metal integration
* HAL abstractions for IO transport and NV storage portability
* File-based or custom NV storage via HAL callbacks
* Compile-time algorithm and feature selection (e.g., `NO_RSA`, `FWTPM_NO_NV`)
* Compile-time algorithm and per-command-group feature selection (e.g., `NO_RSA`, `FWTPM_NO_NV`, and independent per-command-group gates you pick and choose to shrink the fTPM footprint)
* `WOLFTPM_SMALL_STACK` support for constrained environments

See [docs/FWTPM.md](docs/FWTPM.md) for build instructions, configuration, and API reference.
Expand Down
31 changes: 26 additions & 5 deletions docs/FWTPM.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,22 +664,43 @@ to reduce code size on constrained targets.
| `FWTPM_NO_POLICY` | not defined | `PolicyGetDigest`, `PolicyRestart`, `PolicyPCR`, `PolicyPassword`, `PolicyAuthValue`, `PolicyCommandCode`, `PolicyOR`, `PolicySecret`, `PolicyAuthorize`, `PolicyNV` |
| `FWTPM_NO_CREDENTIAL` | not defined | `MakeCredential`, `ActivateCredential` |
| `FWTPM_NO_DA` | not defined | `DictionaryAttackParameters`, `DictionaryAttackLockReset`, and all lockout accounting |
| `FWTPM_NO_PARAM_ENC` | not defined | command/response parameter (XOR/AES-CFB) encryption support in sessions |
| `FWTPM_NO_KEY_MIGRATION` | not defined | `Import`, `Duplicate`, `Rewrap` |
| `FWTPM_NO_ECDH` | not defined | `ECDH_KeyGen`, `ECDH_ZGen`, `EC_Ephemeral`, `ZGen_2Phase`, `ECC_Parameters` (ECDSA sign/verify retained), plus the `ecEphemeral*` commit state in `FWTPM_CTX` |
| `FWTPM_NO_HASH_CMDS` | not defined | `Hash`, `HMAC`, `HMAC_Start`, `HashSequenceStart`, `SequenceUpdate`, `SequenceComplete`, `EventSequenceComplete`, and the `FWTPM_CTX` hash-sequence slots |
| `FWTPM_NO_CONTEXT` | not defined | `ContextSave`, `ContextLoad` (`FlushContext` retained), plus the per-boot context protection key and saved-context replay list in `FWTPM_CTX` |
| `FWTPM_NO_SYM_ENCRYPT` | not defined | `EncryptDecrypt`, `EncryptDecrypt2` |
| `FWTPM_NO_CLOCK` | not defined | `ReadClock`, `ClockSet`, `ClockRateAdjust` |

Removing a command group also removes it from the `TPM2_GetCapability(TPM_CAP_COMMANDS)` advertisement and the `TPM_PT_TOTAL_COMMANDS` count, since both are derived from the dispatch table. Note: when `WOLFTPM_MLDSA` is built, `SequenceUpdate` alone is retained under `FWTPM_NO_HASH_CMDS`, because ML-DSA verify sequences stream their message through it. `SequenceComplete` is not shared -- ML-DSA sequences finalize through `TPM2_SignSequenceComplete` / `TPM2_VerifySequenceComplete` -- so it is gated out with the rest of the hash commands rather than advertised as a command that can never succeed.

The `FWTPM_DA_USED_RETRY` macro (off by default) does not remove commands; it
makes the server return `TPM_RC_RETRY` on the first DA-protected auth use after
startup, emulating a real TPM persisting `daUsed`. See
[Dictionary Attack (DA) Protection](#dictionary-attack-da-protection).

**Minimal build example** (measured boot only):
**Minimal build example.** There is no umbrella macro - select the command
groups to drop explicitly, so each is a deliberate choice. For example, to build
a small ECC-only signing + NV fTPM (this set drops attestation; keep
`Sign`/`VerifySignature`, PCR, and NV):

```sh
./configure --enable-fwtpm --enable-swtpm \
CFLAGS="-DNO_RSA -DFWTPM_NO_NV -DFWTPM_NO_ATTESTATION \
-DFWTPM_NO_POLICY -DFWTPM_NO_CREDENTIAL"
CFLAGS="-DNO_RSA \
-DFWTPM_NO_POLICY -DFWTPM_NO_ATTESTATION -DFWTPM_NO_CREDENTIAL \
-DFWTPM_NO_DA -DFWTPM_NO_PARAM_ENC -DFWTPM_NO_KEY_MIGRATION \
-DFWTPM_NO_ECDH -DFWTPM_NO_HASH_CMDS -DFWTPM_NO_CONTEXT \
-DFWTPM_NO_SYM_ENCRYPT -DFWTPM_NO_CLOCK"
```

This retains only: `Startup`, `Shutdown`, `SelfTest`, `GetRandom`, `GetCapability`,
`PCR_Read`, `PCR_Extend`, `PCR_Reset`, `Hash`, ECC keygen/sign, and session support.
That set retains a core fTPM: `Startup`, `Shutdown`, `SelfTest`, `GetRandom`,
`GetCapability`, the `PCR_*` commands, `Create`/`CreatePrimary`/`Load`/
`ReadPublic`/`FlushContext`, `Sign`/`VerifySignature`, the `NV_*` commands, and
session support (`StartAuthSession`/`Unseal`). Add `-DFWTPM_NO_NV` to also drop
NV, or drop any `-DFWTPM_NO_*` above to keep that group. This ECC-only build is
small enough to run as a soft-core fTPM on a constrained FPGA (see the MicroBlaze
V example in the `wolftpm-examples` repo, which fits an ECC-only fTPM into
~192 KB of on-chip memory).

**Dependencies:**
- `FWTPM_NO_NV` also removes `NV_Certify` (even if `FWTPM_NO_ATTESTATION` is not set)
Expand Down
80 changes: 70 additions & 10 deletions src/fwtpm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,35 @@ All tests below run in GitHub Actions CI. Run manually before PR submission.
|------|---------------|-------|-------|
| fwtpm-socket | `--enable-fwtpm --enable-swtpm --enable-debug` | | Primary test |
| fwtpm-tis | `--enable-fwtpm --enable-debug` | | TIS/SHM transport |
| fwtpm-asan | `--enable-fwtpm --enable-swtpm --enable-debug` | `-fsanitize=address` | Memory errors |
| fwtpm-ubsan | `--enable-fwtpm --enable-swtpm --enable-debug` | `-fsanitize=undefined` | UB detection |
| fwtpm-v185 | `--enable-fwtpm --enable-v185` | | PQC: wrapper + handler unit tests |
| fwtpm-macos-socket | `--enable-fwtpm --enable-swtpm --enable-debug` | | macOS runner |

ASan / UBSan / LeakSan coverage lives in `sanitizer.yml`, not this workflow.

### Runtime Tests, gated builds (`fwtpm-gated-runtime` job)

These configurations remove commands, so `make check` (which drives the
examples and tpm2-tools) does not apply. The job builds and runs only
`tests/fwtpm_unit.test`, whose `test_fwtpm_command_gates` /
`test_fwtpm_total_commands` / `test_fwtpm_pcr_bounds` cases assert that a gated
command is rejected with `TPM_RC_COMMAND_CODE`, is absent from
`TPM_CAP_COMMANDS`, and is not counted in `TPM_PT_TOTAL_COMMANDS`.

| Name | wolfTPM Config | wolfSSL Config | Extra CFLAGS |
|------|---------------|---------------|-------------|
| all-gates-ecc-only | `--enable-fwtpm --enable-swtpm` | `--disable-rsa` | the eleven command-group `-DFWTPM_NO_*` gates together (NV retained) |
| all-gates-mldsa | `--enable-fwtpm --enable-swtpm --enable-v185 --enable-mldsa` | `--enable-dilithium --enable-mlkem` | the same eleven gates; proves SequenceUpdate survives for ML-DSA while SequenceComplete does not |
| reduced-pcr | `--enable-fwtpm --enable-swtpm` | | `-DIMPLEMENTATION_PCR=8 -DPLATFORM_PCR=8` |

### Build-Only Tests

| Name | wolfTPM Config | wolfSSL Config | Extra CFLAGS |
|------|---------------|---------------|-------------|
| fwtpm-no-rsa | `--enable-fwtpm --enable-swtpm` | `--disable-rsa` | |
| fwtpm-no-ecc | `--enable-fwtpm --enable-swtpm` | `--disable-ecc` | |
| fwtpm-no-sha384 | `--enable-fwtpm --enable-swtpm` | `--disable-sha384` | |
| fwtpm-no-sha1 | `--enable-fwtpm --enable-swtpm` | `--disable-sha` | `-DNO_SHA` |
| fwtpm-v185-build-only | `--enable-fwtpm --enable-v185` | | `-DDEBUG_WOLFTPM` |
| fwtpm-only | `--enable-fwtpm-only --enable-swtpm` | | No client library |
| fwtpm-minimal | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_ATTESTATION -DFWTPM_NO_NV -DFWTPM_NO_POLICY -DFWTPM_NO_CREDENTIAL -DFWTPM_NO_DA -DFWTPM_NO_PARAM_ENC` |
| fwtpm-no-policy | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_POLICY` |
Expand All @@ -113,6 +133,13 @@ All tests below run in GitHub Actions CI. Run manually before PR submission.
| fwtpm-no-credential | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_CREDENTIAL` |
| fwtpm-no-da | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_DA` |
| fwtpm-no-param-enc | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_PARAM_ENC` |
| fwtpm-no-key-migration | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_KEY_MIGRATION` |
| fwtpm-no-ecdh | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_ECDH` |
| fwtpm-no-hash-cmds | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_HASH_CMDS` |
| fwtpm-no-context | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_CONTEXT` |
| fwtpm-no-sym-encrypt | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_SYM_ENCRYPT` |
| fwtpm-no-clock | `--enable-fwtpm --enable-swtpm` | | `-DFWTPM_NO_CLOCK` |
| fwtpm-reduced-pcr | `--enable-fwtpm --enable-swtpm` | | `-DIMPLEMENTATION_PCR=8 -DPLATFORM_PCR=8` |
| fwtpm-no-rsa-no-policy | `--enable-fwtpm --enable-swtpm` | `--disable-rsa` | `-DFWTPM_NO_POLICY` |
| fwtpm-no-ecc-no-nv | `--enable-fwtpm --enable-swtpm` | `--disable-ecc` | `-DFWTPM_NO_NV` |
| fwtpm-small-stack | `--enable-fwtpm --enable-swtpm` | | `-DWOLFTPM_SMALL_STACK` |
Expand Down Expand Up @@ -140,7 +167,9 @@ control), spec version targeting, and HAL abstraction details.
Key options: `--enable-fwtpm`, `--enable-fwtpm-only`, `--enable-swtpm`,
`--enable-fwtpm-small-ctx`, `--enable-fuzz`. Feature disable macros:
`FWTPM_NO_ATTESTATION`, `FWTPM_NO_NV`, `FWTPM_NO_POLICY`, `FWTPM_NO_CREDENTIAL`,
`FWTPM_NO_DA`, `FWTPM_NO_PARAM_ENC`. Feature enable macros:
`FWTPM_NO_DA`, `FWTPM_NO_PARAM_ENC`, `FWTPM_NO_KEY_MIGRATION`, `FWTPM_NO_ECDH`,
`FWTPM_NO_HASH_CMDS`, `FWTPM_NO_CONTEXT`, `FWTPM_NO_SYM_ENCRYPT`,
`FWTPM_NO_CLOCK`. Feature enable macros:
`WOLFTPM_FWTPM_TCG_TEST` (optional `Vendor_TCG_Test` echo command, off by default).

Command codes with reserved bits set (only the 16-bit index plus the `CC_VEND` V bit are valid), or codes not in the dispatch table, are rejected with `TPM_RC_COMMAND_CODE`.
Expand Down Expand Up @@ -186,16 +215,20 @@ CI exercises 7 build-only configure permutations + the two e2e modes on

The fwTPM implements 105 of 113 commands from the v1.38 baseline (93% coverage).

**Always enabled (47 commands):**
**Core set -- never gated (36 commands):**
Startup, Shutdown, SelfTest, IncrementalSelfTest, GetTestResult, GetRandom,
StirRandom, GetCapability, TestParms, PCR\_Read, PCR\_Extend, PCR\_Reset,
PCR\_Event, PCR\_Allocate, PCR\_SetAuthPolicy, PCR\_SetAuthValue,
ReadClock, ClockSet, ClockRateAdjust, CreatePrimary, FlushContext,
ContextSave, ContextLoad, ReadPublic, Clear, ClearControl, ChangeEPS, ChangePPS, HierarchyControl,
HierarchyChangeAuth, SetPrimaryPolicy, EvictControl, Create, ObjectChangeAuth,
Load, Sign, VerifySignature, Hash, HMAC, HMAC\_Start, HashSequenceStart,
SequenceUpdate, SequenceComplete, EventSequenceComplete, StartAuthSession,
Unseal, LoadExternal, Import, Duplicate, Rewrap, CreateLoaded
CreatePrimary, FlushContext, ReadPublic, Clear, ClearControl, ChangeEPS,
ChangePPS, HierarchyControl, HierarchyChangeAuth, SetPrimaryPolicy,
EvictControl, Create, ObjectChangeAuth, Load, Sign, VerifySignature,
StartAuthSession, Unseal, LoadExternal, CreateLoaded

These are present in every build. A default build (no `FWTPM_NO_*` macro set)
additionally enables every group listed under **Conditional on feature macros**
below; setting a gate macro removes that group's commands from the dispatch
table, from `TPM2_GetCapability(TPM_CAP_COMMANDS)`, and from the
`TPM_PT_TOTAL_COMMANDS` count.

**Optional vendor command (off by default, `WOLFTPM_FWTPM_TCG_TEST`):**
Vendor\_TCG\_Test
Expand All @@ -221,6 +254,33 @@ EncryptDecrypt, EncryptDecrypt2
- `FWTPM_NO_PARAM_ENC`: Disables parameter encryption/decryption for command and
response parameters. Sessions still work for HMAC auth, but encrypted transport
is disabled. Reduces code size by removing AES-CFB and XOR param encryption.
- `FWTPM_NO_KEY_MIGRATION`: Import, Duplicate, Rewrap (3 commands). Shared key

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 [Medium] Command coverage docs still label newly gated commands as always enabled · Documentation

The new macro descriptions say commands such as ReadClock, ContextSave, hash sequences, and Import can be disabled, while the preceding command-coverage section still lists them under "Always enabled (47 commands)". The new feature makes that count and category inaccurate for gated builds.

Fix: Rename that section to describe the default command set, or move the newly gated commands into conditional groups and adjust the count. Also include the six new macros in the earlier feature-disable macro summary.

helpers (used by Create/Load) are retained.
- `FWTPM_NO_ECDH`: ECDH\_KeyGen, ECDH\_ZGen, EC\_Ephemeral, ZGen\_2Phase,
ECC\_Parameters (5 commands). ECDSA sign/verify are retained. Also drops the
`ecEphemeral*` commit state from `FWTPM_CTX`.
- `FWTPM_NO_HASH_CMDS`: Hash, HMAC, HMAC\_Start, HashSequenceStart,
SequenceUpdate, SequenceComplete, EventSequenceComplete (7 commands). When
`WOLFTPM_MLDSA` is built, only SequenceUpdate is retained -- the MLDSA
verify sequences stream their message through it. SequenceComplete is not
shared: MLDSA sequences finalize through SignSequenceComplete /
VerifySequenceComplete, so advertising it in a gated build would expose a
command that can never succeed. Also drops the per-instance hash-sequence
slots (`hashSeq[FWTPM_MAX_HASH_SEQ]`) from `FWTPM_CTX`.
- `FWTPM_NO_CONTEXT`: ContextSave, ContextLoad (2 commands). FlushContext is
retained. Also drops the per-boot context protection key and the saved-context
replay list from `FWTPM_CTX`.
- `FWTPM_NO_SYM_ENCRYPT`: EncryptDecrypt, EncryptDecrypt2 (2 commands). Nests
inside `NO_AES`; AES itself is retained for session parameter encryption,
AES-GCM, and (unless `FWTPM_NO_CONTEXT` is also set) context protection.
- `FWTPM_NO_CLOCK`: ReadClock, ClockSet, ClockRateAdjust (3 commands). GetTime is
under `FWTPM_NO_ATTESTATION`, not this flag.
These gates are independent and there is intentionally no umbrella macro: pick
exactly the groups your fTPM does not need. Applying all of them plus the earlier
`FWTPM_NO_POLICY/ATTESTATION/CREDENTIAL/DA/PARAM_ENC` (keeping NV, or adding
`FWTPM_NO_NV` to drop it) leaves a core fTPM (Startup/GetCapability/GetRandom/
PCR/Create/Load/Sign/VerifySignature/NV/sessions) - see the MicroBlaze V example
in wolftpm-examples for a worked selection.

### Missing Commands -- TODO

Expand Down
Loading
Loading