-
Notifications
You must be signed in to change notification settings - Fork 31
[WIP] igvm_defs: introduce corim measurement header #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -341,6 +341,14 @@ pub enum IgvmVariableHeaderType { | |||||||||||
| /// specified by a structure of type [`IGVM_VHS_PARAMETER`]. | ||||||||||||
| #[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] | ||||||||||||
| IGVM_VHT_ENVIRONMENT_INFO_PARAMETER = 0x313, | ||||||||||||
| /// A Corim measurement structure described by [`IGVM_VHS_CORIM_MEASUREMENT`]. | ||||||||||||
| /// FIXME: should this be an init header to be early in the file? | ||||||||||||
| #[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] | ||||||||||||
| IGVM_VHT_CORIM_MEASUREMENT = 0x314, | ||||||||||||
| /// A Corim signature structure described by [`IGVM_VHS_CORIM_SIGNATURE`]. | ||||||||||||
| /// FIXME: should this be an init header to be early in the file? | ||||||||||||
| #[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] | ||||||||||||
| IGVM_VHT_CORIM_SIGNATURE = 0x315, | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| /// The range of header types for platform structures. | ||||||||||||
|
|
@@ -1237,3 +1245,57 @@ pub enum VbsSigningAlgorithm { | |||||||||||
| /// ECDSA P384. | ||||||||||||
| ECDSA_P384 = 0x1, | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| /// A structure defining a CoRIM CBOR payload for a given platform. TODO: rename | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| /// to remove measurement? | ||||||||||||
| /// | ||||||||||||
| /// The payload described by this header is a CBOR CoRIM payload. There may only | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be good to be have a similar level of detail here as below, pointing to section 4.1 of the spec, and explicitly calling it out as a tagged unsigned CoRIM map. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| /// be one for a given platform. There may be an associated COSE_Sign1 structure | ||||||||||||
| /// wrapping this payload, see [`IGVM_VHS_CORIM_SIGNATURE`]. | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For detached mode
Suggested change
|
||||||||||||
| /// | ||||||||||||
| /// The CoRIM payload must adhere to the following specifications for each | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| /// platform: | ||||||||||||
| /// | ||||||||||||
| /// | Platform | Specification | | ||||||||||||
| /// |----------|---------------| | ||||||||||||
| /// | Intel TDX | TBD | | ||||||||||||
| /// | VBS | TBD | | ||||||||||||
| /// | AMD SEV-SNP | TBD | | ||||||||||||
| /// | ARM CCA | TBD | | ||||||||||||
| #[repr(C)] | ||||||||||||
| #[derive(Copy, Clone, Debug, IntoBytes, Immutable, KnownLayout, FromBytes)] | ||||||||||||
| struct IGVM_VHS_CORIM_MEASUREMENT { | ||||||||||||
| /// Compatibility mask. | ||||||||||||
| pub compatibility_mask: u32, | ||||||||||||
| /// File offset for the CoRIM CBOR payload. | ||||||||||||
| pub file_offset: u32, | ||||||||||||
| /// Size in bytes of the CoRIM CBOR payload. | ||||||||||||
| pub size_bytes: u32, | ||||||||||||
| /// Reserved. | ||||||||||||
| pub reserved: u32, | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| /// This is a signed COSE_Sign1 structure wrapping a CoRIM CBOR payload for a | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| /// given platform. The payload measured by this CBOR is described the | ||||||||||||
| /// corresponding [`IGVM_VHS_CORIM_MEASUREMENT`] structure. There cannot be this | ||||||||||||
| /// structure without that one. | ||||||||||||
| /// | ||||||||||||
| /// Note that a user may choose to create a single CBOR containing this | ||||||||||||
| /// COSE_Sign1 with the payload filled in by the other corim measurement | ||||||||||||
| /// structure. | ||||||||||||
| /// | ||||||||||||
| /// The payload described by this header is a COSE_Sign1 structure described in | ||||||||||||
| /// section 4.2 in RFC https://datatracker.ietf.org/doc/draft-ietf-rats-corim/, | ||||||||||||
| /// which is a COSE_Sign1 structure with a CBOR corim payload. | ||||||||||||
| #[repr(C)] | ||||||||||||
| #[derive(Copy, Clone, Debug, IntoBytes, Immutable, KnownLayout, FromBytes)] | ||||||||||||
| struct IGVM_VHS_CORIM_SIGNATURE { | ||||||||||||
| /// Compatibility mask. | ||||||||||||
| pub compatibility_mask: u32, | ||||||||||||
| /// File offset for the COSE_Sign1 measurement payload. | ||||||||||||
| pub file_offset: u32, | ||||||||||||
| /// Size in bytes of the COSE_Sign1 measurement payload. | ||||||||||||
| pub size_bytes: u32, | ||||||||||||
| /// Reserved. | ||||||||||||
| pub reserved: u32, | ||||||||||||
| } | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we call it IGVM_VHT_CORIM_DOCUMENT that aligns better with spec?