Skip to content

Implement rebind for AzCVMEmu#734

Open
haitaohuang wants to merge 4 commits intointel:mainfrom
haitaohuang:rebind2
Open

Implement rebind for AzCVMEmu#734
haitaohuang wants to merge 4 commits intointel:mainfrom
haitaohuang:rebind2

Conversation

@haitaohuang
Copy link
Contributor

No description provided.

@haitaohuang haitaohuang requested a review from jyao1 as a code owner March 2, 2026 18:59
@jyao1
Copy link
Contributor

jyao1 commented Mar 4, 2026

could someone from MSFT to review AzCVMEmu?

@haitaohuang haitaohuang force-pushed the rebind2 branch 2 times, most recently from 4c53a30 to aa35f45 Compare March 4, 2026 23:08
// RebindingInfo layout (56 bytes minimum):
// [0..8] mig_request_id (u64)
// [8] rebinding_src (u8)
// [9] has_init_data (u8) - 0 for emulation
Copy link
Contributor

Choose a reason for hiding this comment

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

In emulation mode, with no init_data for the StartRebinding request, what code flow in MigTD is bypassed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically the src serves as the init migtd

populate_servtd_fields(binding_handle, target_td_uuid);
}

/// Populate MSK_FIELDS with ServTD extension data derived from the TD report.
Copy link
Contributor

Choose a reason for hiding this comment

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

"MSK_FIELDS" name is a confusing. Probably from previous version of the emulation code for "TDCS_FIELD_MIG_ENC_KEY ". "TDCS_FIELDS" is probably a better name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MSK_FILEDS is a static storage for emulated MSK and TDCS fields. I'll rename to BOULD_FIELDS instead and remove reference from comments

haitaohuang and others added 4 commits March 5, 2026 11:09
- Remove MIGTD_ROOT_CA_FILE for policy_v2 (root CA not needed policy v2)
- Extract quote data into reusable tdx-mock-data crate
- Generate the mock report from the quote data, remove hard coded report
- Compute SHA384 hashes at runtime for report_mac integrity

Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Populate emulated ServTD extension fields (init_servtd_info_hash,
init_attr, cpusvn, tee_tcb_svn) from TD report data when
setting up rebinding emulation. Previously these fields were all
zeros, causing verify_servtd_hash to fail with InvalidTdReport
during TLS handshake.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Add two new test matrix entries for rebinding:
- Rebind Prepare (Skip RA): builds with policy_v2 + skip-RA features
- Rebind Prepare (Mock Report): builds with mock report, generates
  policy from mock data before running rebind test

Also update log checking to handle rebind-specific log files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants