Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions profiles/tdx/example_pce_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package tdx

import (
_ "embed"
"errors"
"fmt"

Expand Down Expand Up @@ -95,14 +94,6 @@ func extractPCERefVals(c *comid.Comid) error {
return nil
}

var (
// test cases are based on diag files here:
// https://github.com/ietf-rats-wg/draft-ietf-rats-corim/tree/main/cddl/examples

//go:embed testcases/comid_pce_refval.cbor
ComidPceRefVal []byte
)

func Example_decode_PCE_CBOR() {
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
Expand Down
9 changes: 0 additions & 9 deletions profiles/tdx/example_qe_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package tdx

import (
_ "embed"
"errors"
"fmt"

Expand Down Expand Up @@ -123,14 +122,6 @@ func Example_encode_tdx_QE_refval_without_profile() {
// {"tag-identity":{"id":"43bbe37f-2e61-4b33-aed3-53cff1428b20"},"entities":[{"name":"INTEL","regid":"https://intel.com","roles":["creator","tagCreator","maintainer"]}],"triples":{"reference-values":[{"environment":{"class":{"id":{"type":"oid","value":"2.16.840.1.113741.1.2.3.4.5"},"vendor":"Intel Corporation","model":"0123456789ABCDEF"}},"measurements":[{"value":{"isvsvn":{"type":"numeric-expression","value":{"numeric-operator":"greater_or_equal","numeric-type":{"type":"uint","value":10}}},"miscselect":"wAD7/wAA","mrsigner":{"type":"digest-expression","value":{"set-operator":"member","set-digest":["sha-256;5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXU=","sha-384;5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXXkW3L1wMC1cttNjTq36X82"]}},"isvprodid":{"type":"uint","value":1},"tcbevalnum":{"type":"numeric-expression","value":{"numeric-operator":"greater_or_equal","numeric-type":{"type":"uint","value":11}}}}}]}]}}
}

var (
// test cases are based on diag files here:
// https://github.com/ietf-rats-wg/draft-ietf-rats-corim/tree/main/cddl/examples

//go:embed testcases/comid_qe_refval.cbor
ComidQeRefVal []byte
)

func Example_decode_QE_CBOR() {
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
Expand Down
9 changes: 0 additions & 9 deletions profiles/tdx/example_seam_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package tdx

import (
_ "embed"
"errors"
"fmt"
"log"
Expand Down Expand Up @@ -217,14 +216,6 @@ func Example_encode_tdx_seam_refval_direct() {
// {"tag-identity":{"id":"43bbe37f-2e61-4b33-aed3-53cff1428b20"},"entities":[{"name":"INTEL","regid":"https://intel.com","roles":["creator","tagCreator","maintainer"]}],"triples":{"reference-values":[{"environment":{"class":{"id":{"type":"oid","value":"2.16.840.1.113741.1.2.3.4.5"},"vendor":"Intel Corporation","model":"TDXSEAM"}},"measurements":[{"value":{"tcbdate":"2025-01-27T00:00:00Z","isvsvn":{"type":"numeric-expression","value":{"numeric-operator":"greater_or_equal","numeric-type":{"type":"uint","value":10}}},"attributes":"AQE=","mrtee":{"type":"digest-expression","value":{"set-operator":"member","set-digest":["sha-256;5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXU="]}},"mrsigner":{"type":"digest-expression","value":{"set-operator":"member","set-digest":["sha-256;5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXU=","sha-384;5Fty9cDAtXLbTY06t+l/No/3TmI0eoJN7LZ6hOUiTXXkW3L1wMC1cttNjTq36X82"]}},"isvprodid":{"type":"bytes","value":"AQE="},"tcbevalnum":{"type":"numeric-expression","value":{"numeric-operator":"greater_or_equal","numeric-type":{"type":"uint","value":11}}}}}]}]}}
}

var (
// test cases are based on diag files here:
// https://github.com/ietf-rats-wg/draft-ietf-rats-corim/tree/main/cddl/examples

//go:embed testcases/comid_seam_refval.cbor
ComidSeamRefVal []byte
)

func Example_decode_CBOR() {
profileID, err := eat.NewProfile("2.16.840.1.113741.1.16.1")
if err != nil {
Expand Down
14 changes: 14 additions & 0 deletions profiles/tdx/test_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package tdx

import _ "embed"

//nolint:lll
const (
TestUIntInstance = 45
Expand Down Expand Up @@ -424,6 +426,18 @@ var (
TestInvalidTCBStatus = []int{1, 2, 3}
TestAdvisoryIDs = []string{"SA-00078", "SA-00077", "SA-00079"}
TestInvalidAdvisoryIDs = []float64{1.234, 2.567}

// test cases are based on diag files here:
// https://github.com/ietf-rats-wg/draft-ietf-rats-corim/tree/main/cddl/examples

//go:embed testcases/comid_seam_refval.cbor
ComidSeamRefVal []byte

//go:embed testcases/comid_qe_refval.cbor
ComidQeRefVal []byte

//go:embed testcases/comid_pce_refval.cbor
ComidPceRefVal []byte
)

type MessageType int
Expand Down