fix(migtd): store digests as tagged event bodies#921
Conversation
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]>
|
There are 2 consumers for the policy data.
Since we have described "MigTD Policy V2 Exchange"
That will require the RIM includes a full policy data for verification. |
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:
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.