diff --git a/profiles/tdx/example_pce_refval_test.go b/profiles/tdx/example_pce_refval_test.go index affa2b0..897594c 100644 --- a/profiles/tdx/example_pce_refval_test.go +++ b/profiles/tdx/example_pce_refval_test.go @@ -4,7 +4,6 @@ package tdx import ( - _ "embed" "errors" "fmt" @@ -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 { diff --git a/profiles/tdx/example_qe_refval_test.go b/profiles/tdx/example_qe_refval_test.go index 9db8dc1..e78470d 100644 --- a/profiles/tdx/example_qe_refval_test.go +++ b/profiles/tdx/example_qe_refval_test.go @@ -4,7 +4,6 @@ package tdx import ( - _ "embed" "errors" "fmt" @@ -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 { diff --git a/profiles/tdx/example_seam_refval_test.go b/profiles/tdx/example_seam_refval_test.go index 8208726..284a20e 100644 --- a/profiles/tdx/example_seam_refval_test.go +++ b/profiles/tdx/example_seam_refval_test.go @@ -4,7 +4,6 @@ package tdx import ( - _ "embed" "errors" "fmt" "log" @@ -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 { diff --git a/profiles/tdx/test_vars.go b/profiles/tdx/test_vars.go index f6ea0d3..24d0702 100644 --- a/profiles/tdx/test_vars.go +++ b/profiles/tdx/test_vars.go @@ -3,6 +3,8 @@ package tdx +import _ "embed" + //nolint:lll const ( TestUIntInstance = 45 @@ -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