feat: use complete TDINFO hash for TCB mappings - #1032
haitaohuang wants to merge 3 commits into
Conversation
e3dd4df to
ec626be
Compare
|
@haitaohuang , is any Microsoft people can review and approve as well? |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical issuer-chain binding and TDINFO hashing issues block approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adopts complete TDINFO-hash TCB mappings, canonical RTMR2 policy measurement, and authenticated migration continuity through SERVTD_EXT.
Changes:
- Updates policy verification, migration/rebinding, SPDM, and RA-TLS flows.
- Updates cumulative mapping and collateral-generation tools.
- Refreshes fixtures, templates, and build workflows.
File summaries
| File | Summary |
|---|---|
tools/servtd-collateral-generator/src/main.rs |
Updated collateral-generator CLI flow. |
tools/servtd-collateral-generator/src/build.rs |
nit, 2 votes: documentation still passes the removed --mapping-chain option. |
tools/servtd-collateral-generator/readme.md |
Updated generator usage documentation. |
tools/migtd-hash/src/main.rs |
moderate, 2 votes: invalid option combinations can panic instead of returning a validation error. |
tools/migtd-hash/src/lib.rs |
moderate, 2 votes: accept both tdinfo_hash and tdinfoHash; reject conflicting duplicate hash/SVN assignments instead of overwriting. |
tools/migtd-hash/Cargo.toml |
Updated hash-tool package metadata. |
src/policy/test/policy_v2/tcb_mapping.json |
Updated TCB mapping fixture. |
src/policy/test/policy_v2/servtd_collateral.json |
Updated collateral fixture. |
src/policy/test/policy_v2/cert_chain/policy_issuer_chain.pem |
Updated policy issuer-chain fixture. |
src/policy/src/v2/servtd_collateral.rs |
critical, 1 vote: the 48-byte servtd_hash is omitted from TDINFO hashing, allowing mismatches or collisions. |
src/policy/src/v2/policy.rs |
critical, 2 votes: the supplied issuer chain is not bound to the RTMR1-measured signer event. nit, 1 vote: documentation still describes the ignored outer signature as authoritative. |
src/policy/src/v2/mod.rs |
Exports policy-v2 measurement helpers. |
src/policy/src/v2/measurement.rs |
Adds canonical redacted policy measurement. |
src/policy/src/lib.rs |
Integrates policy measurement support. |
src/migtd/src/spdm/spdm_rsp.rs |
Updates SPDM attestation response handling. |
src/migtd/src/ratls/server_client.rs |
Updates policy and SERVTD_EXT binding. |
src/migtd/src/migration/session.rs |
Adds migration attribute validation. |
src/migtd/src/migration/rebinding.rs |
Updates rebinding continuity handling. |
src/migtd/src/migration/mod.rs |
Preserves Init_TDINFO framing compatibility. |
src/migtd/src/mig_policy.rs |
Updates mapping lookup and continuity validation. |
src/migtd/src/lib.rs |
Updates policy helper exports. |
src/migtd/src/event_log.rs |
Updates policy measurement event handling. |
src/migtd/src/bin/migtd/main.rs |
Updates runtime policy measurements. |
sh_script/build_policy_v2.sh |
nit, 1 vote: documented invocation lacks the required cumulative mapping argument. |
sh_script/build_AzCVMEmu_policy_and_test.sh |
Updates emulation policy generation. |
sh_script/Azure/build_azure_mock_test.sh |
moderate, 1 vote: migtd-hash build failures can be masked and omitted from binary verification. |
deps/td-shim-AzCVMEmu/tdx-tdcall/src/tdx_emu.rs |
Adds emulated SERVTD_EXT fields. |
config/templates/td_identity.json |
Updated TD identity template. |
config/templates/td_identity_signed.json |
Updated signed TD identity template. |
config/templates/tcb_mapping.json |
Updated TCB mapping template. |
config/templates/tcb_mapping_signed.json |
Updated signed mapping template. |
config/templates/servtd_collateral.json |
Updated collateral template. |
config/templates/policy_issuer_chain.pem |
Updated issuer-chain template. |
config/AzCVMEmu/tcb_mapping.json |
Updated emulation mapping fixture. |
Cargo.lock |
Updated dependency lockfile. |
Review details
Suppressed comments (3)
sh_script/Azure/build_azure_mock_test.sh:379
- This new build is piped through
grep ... || true, butmigtd-hashis omitted from the existence check below. A compiler failure can therefore be reported as “All tools built successfully” and only surface later when the missing binary is invoked at line 464. Make this build fail fast or include the binary in the verification loop.
cargo build --release -p migtd-hash 2>&1 | grep -E "(Compiling|Finished|error)" || true
sh_script/build_policy_v2.sh:8
- The new required mapping argument makes the documented command in
doc/policy_v2.md:126fail with the usage error because it still passes only the environment. Update that guide (and any downstream invocation) to pass the cumulative mapping path rather than leaving the release workflow unusable as documented.
tcb_mapping_file="${2:-}"
src/policy/src/v2/policy.rs:213
- This change makes the outer policy signature legacy and ignored, but
doc/policy_v2.md:63-70still instructs users to signpolicyDataand says the output contains an authoritative signature. That guide now describes the wrong trust model and release artifact; update it to document RTMR2's canonical measurement and the policy-issuer-signed TCB mapping instead.
/// Legacy outer signature, ignored because policyData integrity is
/// established by the RTMR2 measurement.
#[serde(default)]
pub signature: Option<String>,
- Files reviewed: 34/39 changed files
- Comments generated: 6
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Use SHA-384 over the complete unmasked TDINFO as the Policy v2 mapping key. Canonicalize policyData once with only the circular mapping removed so runtime verification and offline tooling extend identical RTMR2 bytes. Verify the signed mapping with the RTMR1-bound policy issuer chain, remove the separate mapping chain and obsolete mapping identity fields, and ignore the legacy outer policy signature as required by the proposal. Resolve the source's initial and current SERVTD_EXT hashes through its authenticated JSON mapping, allowing an older destination to accept a newer source release without predicting its hash. Signed-off-by: Haitao Huang <haitaohuang@microsoft.com> Assisted-by: GitHub Copilot CLI:GPT-5.6 Sol
ec626be to
aa9fc2d
Compare
Carry authenticated SERVTD_EXT continuity evidence through migration and rebinding. Ignore legacy host-supplied Init_TDINFO after validating its framing, reject lookup misses or SVN rollback, and fail closed when SERVTD_ATTR masking makes the endorsed unmasked hashes inapplicable. Signed-off-by: Haitao Huang <haitaohuang@microsoft.com> Assisted-by: GitHub Copilot CLI:GPT-5.6 Sol Assisted-by: GitHub Copilot CLI:gpt-6-astra
Retain authority-maintained hash history when adding a release, allow multiple hashes at one SVN, and reject conflicting duplicate assignments. Emit deterministic mapping bytes and validate signed mappings before use. Signed-off-by: Haitao Huang <haitaohuang@microsoft.com> Assisted-by: GitHub Copilot CLI:GPT-5.6 Sol Assisted-by: GitHub Copilot CLI:gpt-6-astra
aa9fc2d to
bd32692
Compare
|
| @@ -38,7 +49,7 @@ cargo build -p json-signer | |||
| ./target/debug/json-signer --sign \ | |||
| --name tdTcbMapping \ | |||
There was a problem hiding this comment.
just wondering, is the servtdIdentity signature part of the RTMR2 measurement? If so, could re-signing it here affect the tdinfo_hash we recorded earlier?
Summary
Implement the one-hash TCB mapping design proposed in #908:
SHA384(TDINFO)over the complete unmasked TDINFO as the mapping key;policyDatawith onlyservtdTcbMappingredacted;SERVTD_EXTrather than host-supplied Init_TDINFO;SERVTD_ATTR;migtd-hash, including multiple release hashes assigned to the same SVN.The legacy outer policy signature is ignored because policy integrity is established by RTMR2. The existing wire Init_TDINFO field remains for framing compatibility but is no longer used as authorization evidence.
Related to #908.
Validation
Future changes
Potential follow-up work, intentionally excluded from this focused series: