Skip to content

Commit

Permalink
Add more test vars
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Jan 28, 2025
1 parent c940e33 commit 661ae12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions comid/tdx-profile/example_seam_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,6 @@ func Example_encode_tdx_seam_refval_direct() {

func setTDXSeamMvalExtensions(val *comid.Mval) error {
tcbDate, _ := time.Parse(time.RFC3339, "2025-01-27T00:00:00Z")

svn := TeeSVN(10)
teeTcbEvNum := TeeTcbEvalNum(11)
teeAttr := TeeAttributes([]byte{0x01, 0x01})

err := val.Extensions.Set("tcbdate", &tcbDate)
if err != nil {
return fmt.Errorf("unable to set tcbDate %w", err)
Expand All @@ -233,15 +228,19 @@ func setTDXSeamMvalExtensions(val *comid.Mval) error {
if err != nil {
return fmt.Errorf("unable to set isvprodid %w", err)
}
svn := TeeSVN(TestISVSVN)
err = val.Extensions.Set("isvsvn", &svn)
if err != nil {
return fmt.Errorf("unable to set isvsvn %w", err)
}
teeTcbEvNum := TeeTcbEvalNum(TestTCBEvalNum)
err = val.Extensions.Set("tcbevalnum", &teeTcbEvNum)
if err != nil {
return fmt.Errorf("unable to set tcbevalnum %w", err)
}
err = val.Extensions.Set("attributes", &teeAttr)

teeAttr := NewTeeAttributes(TestTeeAttributes)
err = val.Extensions.Set("attributes", teeAttr)
if err != nil {
return fmt.Errorf("unable to set attributes %w", err)
}
Expand Down
8 changes: 5 additions & 3 deletions comid/tdx-profile/test_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ var (
TestUIntISVProdID = 23
TestBytesISVProdID = []byte{0x01, 0x02, 0x03}
TestInvalidInstance = -1
TestTeeAttributes = []byte{0x09, 0x0A, 0x0B}
TestTeeAttributes = []byte{0x01, 0x01}
TestTeeMiscSelect = []byte{0x0B, 0x0C, 0x0D}
TestPCEID = "PCEID001"
TestCompSVN = []uint{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
TestTCBStatus = []string{"OutOfDate", "ConfigurationNeeded", "UpToDate"}
TestInvalidTCBStatus = []int{1, 2, 3}
TestAdvisoryIDs = []string{"SA-00078", "SA-00077", "SA-00079"}
TestInvalidAdvisoryIDs = []float64{1.234, 2.567}

TDXPCERefValTemplate = `{
TestISVSVN = 10
TestTCBEvalNum = 11
TestTime = "2025-01-29T00:00:00Z"
TDXPCERefValTemplate = `{
"lang": "en-GB",
"tag-identity": {
"id": "43BBE37F-2E61-4B33-AED3-53CFF1428B17",
Expand Down
2 changes: 0 additions & 2 deletions comid/tdx-profile/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import "github.com/veraison/corim/comid"
type setType []any

type maskType []byte

type TeeSVN uint

type TeeDigest comid.Digests

type TeeTcbEvalNum uint

0 comments on commit 661ae12

Please sign in to comment.