Add SD remote backup reseal support - #686
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d673ab1a-bbb9-4a8a-be4c-805c73308210
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d673ab1a-bbb9-4a8a-be4c-805c73308210
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d673ab1a-bbb9-4a8a-be4c-805c73308210
|
naga-rathin please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
Pull request overview
Adds SDK- and test-level support for foundational HSM Security Domain (SD) remote-backup resealing, including new hardware-only integration tests and host-driver support for carrying TBOR out-of-band (OOB) payloads.
Changes:
- Add
SdResealRemoteBackuphardware integration tests plus expandedSdCreateRemoteBackuphardware coverage using synthetic (unsigned) policy-bound v2 KeyReports. - Refactor TBOR test harness provisioning fixtures (introduce reusable
PotaFixture) and update spec-coverage documentation. - Extend the Linux DDI backend to send TBOR OOB items via the driver’s data-transfer ioctl, enabling commands that require Metadata Page-backed OOB payloads.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ddi/tbor/types/tests/SPEC_COVERAGE.md | Adds spec coverage mapping for SdCreateRemoteBackup and SdResealRemoteBackup (emu vs hw split). |
| ddi/tbor/types/tests/README.md | Documents how to run hardware reseal tests serially and warns about partition mutation/concurrency. |
| ddi/tbor/types/tests/harness/x509_fixture.rs | Introduces PotaFixture to reuse POTA root material and thumbprint for provisioning flows. |
| ddi/tbor/types/tests/harness/mod.rs | Makes x509_fixture available beyond emu builds. |
| ddi/tbor/types/tests/commands/sd_restore_local_backup.rs | Switches provisioning to PotaFixture to align with updated harness patterns. |
| ddi/tbor/types/tests/commands/sd_reseal_remote_backup_hw.rs | New hardware-only reseal tests that build synthetic v2 KeyReports from real sealing keys. |
| ddi/tbor/types/tests/commands/sd_create_remote_backup.rs | Adds hardware-only SdCreateRemoteBackup coverage and synthetic report generation path. |
| ddi/tbor/types/tests/commands/part_init/mod.rs | Removes emu-only gate on part_policy_with_pota to support hardware provisioning paths. |
| ddi/tbor/types/tests/commands/mod.rs | Registers the new hardware-only reseal test module under feature gating. |
| ddi/nix/src/dev.rs | Adds Linux driver data-transfer ioctl support for TBOR OOB payload forwarding. |
| ddi/mbor/test_helpers/src/report.rs | Adds fake_manticore_key_report_bytes helper for synthetic policy-bound v2 KeyReports. |
| api/tests/src/utils/sd_provision.rs | Updates sealing key + KeyReport helper to synthesize reports on hardware until TborKeyReport exists. |
| api/tests/src/sd/restore_tests.rs | Updates callsites for new masked_key_and_report(session, policy) signature. |
| api/tests/src/sd/restore_peer_tests.rs | Updates callsites for new masked_key_and_report(session, policy) signature. |
| api/tests/src/sd/restore_local_tests.rs | Updates callsites for new masked_key_and_report(session, policy) signature. |
| api/tests/src/sd/reseal_tests.rs | Exercises public API reseal flow using policy-bound report generation. |
| api/tests/src/sd/create_peer_tests.rs | Updates create-peer SD flows to use policy-bound report generation. |
| api/tests/src/sd/create_backup_tests.rs | Updates create-remote-backup SD flows to use policy-bound report generation. |
| api/tests/Cargo.toml | Adds azihsm_ddi_mbor_test_helpers dependency needed for synthetic report generation in tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| for (slot, item) in buffers.iter_mut().zip(oob.iter()) { | ||
| slot.xfer_length = item.len() as u32; | ||
| slot.buf_addr = item.as_ptr(); | ||
| } |
| #[cfg(all(not(feature = "emu"), not(feature = "mock"), not(feature = "sock")))] | ||
| pub mod sd_reseal_remote_backup_hw; |
| #[cfg(all(not(feature = "emu"), not(feature = "mock"), not(feature = "sock")))] | ||
| #[test] |
Adds SDK support and hardware test coverage for the foundational HSM SD remote-backup reseal API.
Changes
• Adds DDI hardware tests for remote-backup resealing.
• Adds public API roundtrip and re-randomization tests.
• Reuses the existing CreateSD provisioning flow.
• Adds policy-bound synthetic v2 KeyReports until firmware KeyReport generation and signature-chain validation are available.
• Verifies missing OOB metadata and tampered source backups are rejected.
• Keeps backup key seed material inside the HSM during resealing.