Skip to content

Commit

Permalink
Replace with real Intel profile Identifier
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Feb 11, 2025
1 parent 7c8464c commit 188755a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
1 change: 0 additions & 1 deletion comid/measurement.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ func (o Mval) Valid() error {
o.UEID == nil &&
o.UUID == nil &&
o.IntegrityRegisters == nil &&

o.Extensions.IsEmpty() {
// Check for Value as well, need an API to add something
return fmt.Errorf("no measurement value set")
Expand Down
6 changes: 3 additions & 3 deletions comid/tdx-profile/example_pce_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// Example_decode_PCE_JSON decodes the TDX Provisioning Certification Enclave Measurement Extensions from the given JSON Template
func Example_decode_PCE_JSON() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down Expand Up @@ -198,7 +198,7 @@ var (
)

func Example_decode_PCE_CBOR() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down Expand Up @@ -250,7 +250,7 @@ func Example_decode_PCE_CBOR() {
}

func Example_encode_tdx_pce_refval_with_profile() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down
4 changes: 2 additions & 2 deletions comid/tdx-profile/example_qe_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

// Example_decode_QE_JSON decodes the TDX Quoting Enclave Measurement Extensions from the given JSON Template
func Example_decode_QE_JSON() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down Expand Up @@ -266,7 +266,7 @@ var (
)

func Example_decode_QE_CBOR() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down
8 changes: 4 additions & 4 deletions comid/tdx-profile/example_seam_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

// Example_decode_JSON decodes the TDX Measurement Extensions from the given JSON Template
func Example_decode_JSON() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down Expand Up @@ -110,7 +110,7 @@ func Example_encode_tdx_seam_refval_without_profile() {
}

func Example_encode_tdx_seam_refval_with_profile() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down Expand Up @@ -244,7 +244,7 @@ func setTDXSeamMvalExtensions(val *comid.Mval) error {

teeAttr, err := NewTeeAttributes(TestTeeAttributes)
if err != nil {
fmt.Errorf("unable to get teeAttributes %w", err)
return fmt.Errorf("unable to get teeAttributes %w", err)
}
err = val.Extensions.Set("attributes", teeAttr)
if err != nil {
Expand Down Expand Up @@ -378,7 +378,7 @@ var (
)

func Example_decode_CBOR() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down
4 changes: 3 additions & 1 deletion comid/tdx-profile/mval_extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ type MValExtensions struct {
// danger with that is if the your profile ID clashes with another profile,
// which should not happen if it a registered PEN or a URL containing a domain
// that you own.
// Note Intel profile is "2.16.840.1.113741.1.16.1",
// which is "joint-iso-itu-t.country.us.organization.intel.intel-comid.profile"

func init() {
profileID, err := eat.NewProfile("http://intel.com/tdx-profile")
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
panic(err) // will not error, as the hard-coded string above is valid
}
Expand Down

0 comments on commit 188755a

Please sign in to comment.