-
Notifications
You must be signed in to change notification settings - Fork 93
Add finer per-command-group gating macros in fTPM #574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,6 +113,14 @@ 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-all-gates | `--enable-fwtpm --enable-swtpm` | | the eleven command-group `-DFWTPM_NO_*` gates together (NV retained) | | ||
| | fwtpm-all-gates-mldsa | `--enable-fwtpm --enable-swtpm --enable-v185 --enable-mldsa` | | the eleven command-group `-DFWTPM_NO_*` gates together (NV retained) | | ||
| | 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` | | ||
|
|
@@ -221,6 +229,26 @@ 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
| - `FWTPM_NO_HASH_CMDS`: Hash, HMAC, HMAC\_Start, HashSequenceStart, | ||
| SequenceUpdate, SequenceComplete, EventSequenceComplete (7 commands). When | ||
| `WOLFTPM_MLDSA` is built, SequenceUpdate/SequenceComplete are retained because | ||
| the MLDSA sign-sequence commands share them. | ||
| - `FWTPM_NO_CONTEXT`: ContextSave, ContextLoad (2 commands). FlushContext is | ||
| retained. | ||
| - `FWTPM_NO_SYM_ENCRYPT`: EncryptDecrypt, EncryptDecrypt2 (2 commands). Nests | ||
| inside `NO_AES`; AES itself is retained for context protection and AES-GCM. | ||
| - `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 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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.