Skip to content

fix(migtd): store digests as tagged event bodies#921

Open
sgrams wants to merge 1 commit into
intel:mainfrom
sgrams:use_digests_instead_of_raw_policy_artifacts
Open

fix(migtd): store digests as tagged event bodies#921
sgrams wants to merge 1 commit into
intel:mainfrom
sgrams:use_digests_instead_of_raw_policy_artifacts

Conversation

@sgrams

@sgrams sgrams commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Resolves #922

The RA-TLS certificate embeds the full cc-measurement event log via the EXTNID_MIGTD_EVENT_LOG extension. In the v1 (non-policy_v2) path, the event log entries for the migration policy and SGX root CA carried the raw artifact bytes as their tagged event body, so growing the pre-production policy JSON from ~48 KiB to ~59 KiB pushed the reassembled handshake Certificate message past rustls' MAX_HANDSHAKE_SIZE cap (0xffff, 65535 B), surfacing as a TlsStream error during the RA-TLS handshake over virtio-vsock.

Store only a 48-byte SHA-384 digest of the artifact as the tagged event body in:

  • v1 get_policy_and_measure (migration policy)
  • v1 get_ca_and_measure (SGX root CA)
  • v2 get_policy_issuer_chain_and_measure (issuer chain)

RTMR values are unchanged because write_tagged_event_log still receives the full artifact via hash_data. verify_event_log only replays event header digests, and parse_events discards the tag body for these event IDs, so verifier compatibility is preserved. The RA-TLS certificate size is now decoupled from policy size and stays well under the rustls handshake cap regardless of future policy growth.

The RA-TLS certificate embeds the full cc-measurement event log via the
EXTNID_MIGTD_EVENT_LOG extension. In the v1 (non-policy_v2) path, the
event log entries for the migration policy and SGX root CA carried the
raw artifact bytes as their tagged event body, so growing the
pre-production policy JSON from ~48 KiB to ~59 KiB pushed the reassembled
handshake Certificate message past rustls' MAX_HANDSHAKE_SIZE cap
(0xffff, 65535 B), surfacing as a TlsStream error during the RA-TLS
handshake over virtio-vsock.

Store only a 48-byte SHA-384 digest of the artifact as the tagged event
body in:

  * v1 get_policy_and_measure       (migration policy)
  * v1 get_ca_and_measure           (SGX root CA)
  * v2 get_policy_issuer_chain_and_measure (issuer chain)

RTMR values are unchanged because write_tagged_event_log still receives
the full artifact via hash_data. verify_event_log only replays event
header digests, and parse_events discards the tag body for these event
IDs, so verifier compatibility is preserved. The RA-TLS certificate size
is now decoupled from policy size and stays well under the rustls
handshake cap regardless of future policy growth.

Signed-off-by: Stanislaw Grams <[email protected]>
@sgrams sgrams self-assigned this Jul 2, 2026
@sgrams sgrams requested a review from jyao1 as a code owner July 2, 2026 09:22
@jyao1

jyao1 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

There are 2 consumers for the policy data.

  1. Peer MigTD

Since we have described "MigTD Policy V2 Exchange"
The MigTD source and destination need to exchange policy during attestation phase. Because the Policy V2 includes collateral information, it might be too big to be fit into the session establishment protocol. As such, the session establishment protocol (such as TLS or SPDM) may include the hash of the policy instead of including the whole policy data.
The policy data can be transported independently with the session establishment protocol by using following structure
.
I think it is OK to change to hash.

  1. 3rd party Attestor

That will require the RIM includes a full policy data for verification.
If the attestor has a clear policy data/hash mapping, then it is OK to change as well.

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.

Premigration fails with generated fmspc policy - TlsStream error

2 participants