Skip to content
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

feat: implement first phase of TDX Measurement Extensions #162

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yogeshbdeshpande
Copy link
Contributor

@yogeshbdeshpande yogeshbdeshpande commented Jan 28, 2025

See Issue #163

@yogeshbdeshpande yogeshbdeshpande force-pushed the tdx-profile branch 2 times, most recently from cd06383 to 2c3a227 Compare January 28, 2025 13:14
@yogeshbdeshpande yogeshbdeshpande changed the title First revision of Tdx profile feat: implement first phase of TDX Measurement Extensions Jan 28, 2025
- Define TDX Extension code points in the Comid Measurement Value Extension Slot
- Provide Examples of TDX Platform(SEAM), Provisioning Certification Enclave(PCE) and TDX Quoting Enclace(QE) Reference Values
- Implement CBOR and JSON Encoding and Decoding of TDX Extension Points to generate TDX CoMIDs
The implementation adheres to
https://datatracker.ietf.org/doc/draft-cds-rats-intel-corim-profile/

Signed-off-by: Yogesh Deshpande <[email protected]>
comid/tdx-profile/*.cbor Outdated Show resolved Hide resolved
return nil
}

func extractPCEMeasurements(meas *comid.Measurements) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Given the non-trivial operations invoved in extracting PCE values, is it worth adding some exported helper functions that would remove the need for thise internal functions?

// -----END PUBLIC KEY-----
}

func extractQERefVals(c *comid.Comid) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto for QE values -- it seems it would be useful to export this helper function, modified to return the actual extracted values.

comid/tdx-profile/teeadvisoryids.go Outdated Show resolved Hide resolved
comid/tdx-profile/teeadvisoryids.go Outdated Show resolved Hide resolved
comid/tdx-profile/teeinstanceid.go Outdated Show resolved Hide resolved
comid/tdx-profile/teeinstanceid.go Outdated Show resolved Hide resolved
comid/tdx-profile/teeinstanceid.go Outdated Show resolved Hide resolved
comid/tdx-profile/teeinstanceid.go Outdated Show resolved Hide resolved
comid/tdx-profile/teeisvproid.go Show resolved Hide resolved
@yogeshbdeshpande yogeshbdeshpande marked this pull request as ready for review January 28, 2025 15:28
@@ -37,3 +37,4 @@ and giving it a new type or a value (for enums).
Please see [extensions documentation](extensions/README.md) for details.



Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: remove

@@ -441,7 +441,9 @@ func (o Mval) Valid() error {
o.UEID == nil &&
o.UUID == nil &&
o.IntegrityRegisters == nil &&

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please run go fmt

// that you own.

func init() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not versioned? And it's not https? And isn't CoRIM specific? I'd expect there to be an EAT profile for TDX as well that would clash.

Ned needs to add a /v1 or and ensure it's https-protected.

return &TeeISVProdID{val: t}
case int:
if t < 0 {
return nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

nil as error value is an anti-pattern. Can you not return (*TeeISVProdID, error)?


import "fmt"

const MaxSVNCount = 16
Copy link
Collaborator

Choose a reason for hiding this comment

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

Exported variables should be commented, generally throughout this PR.

comid/tdx-profile/teetcbstatus.go Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do none of these CoRIMs use the TDX profile identifier? That's what's needed to interpret the profile-specific values..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the CoMID construction, so you do not see the Intel Profile. Yes, once I produce the CoRIM Template, there will be Intel Profile Identifier!

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.

3 participants