Skip to content

Commit

Permalink
Update QE reference value
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Jan 22, 2025
1 parent d0b1d5b commit 6b0662c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
18 changes: 16 additions & 2 deletions comid/tdx-profile/example_qe_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,26 @@ func decodeQEMValExtensions(m comid.Measurement) error {
if err != nil {
return fmt.Errorf("failed to decode isvprodid from measurement extensions")
}
tS, ok := val.(*teeIsvProdID)
tS, ok := val.(*TeeIsvProdID)
if !ok {
fmt.Printf("val was not pointer to teeIsvProdID")
}

fmt.Printf("\nIsvProdID: %x", *tS)
if tS.IsBytesIsvProdID() {
b, err := tS.GetBytesIsvProdID()

Check failure on line 137 in comid/tdx-profile/example_qe_refval_test.go

View workflow job for this annotation

GitHub Actions / Lint

shadow: declaration of "err" shadows declaration at line 105 (govet)
if err != nil {
return fmt.Errorf("failed to decode isvprodid: %w", err)
}
fmt.Printf("\nIsvProdID: %x", b)
} else if tS.IsUintIsvProdID() {
b, err := tS.GetUintIsvProdID()

Check failure on line 143 in comid/tdx-profile/example_qe_refval_test.go

View workflow job for this annotation

GitHub Actions / Lint

shadow: declaration of "err" shadows declaration at line 105 (govet)
if err != nil {
return fmt.Errorf("failed to decode isvprodid: %w", err)
}
fmt.Printf("\nIsvProdID: %d", b)
} else {
return fmt.Errorf("isvprodid is neither integer or byte string")
}

val, err = m.Val.Extensions.Get("mrsigner")
if err != nil {
Expand Down
8 changes: 5 additions & 3 deletions comid/tdx-profile/example_seam_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,20 @@ func decodeMValExtensions(m comid.Measurement) error {
if !ok {
fmt.Printf("val was not pointer to TeeIsvProdID")
}
if (*tS).IsBytesIsvProdID() {
if tS.IsBytesIsvProdID() {
b, err := tS.GetBytesIsvProdID()

Check failure on line 278 in comid/tdx-profile/example_seam_refval_test.go

View workflow job for this annotation

GitHub Actions / Lint

shadow: declaration of "err" shadows declaration at line 258 (govet)
if err != nil {
return fmt.Errorf("failed to decode isvprodid: %w", err)
}
fmt.Printf("\nIsvProdID: %x", b)
} else if (*tS).IsUintIsvProdID() {
} else if tS.IsUintIsvProdID() {
b, err := tS.GetUintIsvProdID()

Check failure on line 284 in comid/tdx-profile/example_seam_refval_test.go

View workflow job for this annotation

GitHub Actions / Lint

shadow: declaration of "err" shadows declaration at line 258 (govet)
if err != nil {
return fmt.Errorf("failed to decode isvprodid: %w", err)
}
fmt.Printf("\nIsvProdID: %d", b)
} else {
return fmt.Errorf("isvprodid is neither integer or byte string")
}

val, err = m.Val.Extensions.Get("isvsvn")
Expand Down Expand Up @@ -374,7 +376,7 @@ func Example_decode_CBOR() {
// Vendor: Intel Corporation
// Model: TDX SEAM
// tcbEvalNum: 11
// IsvProdID: 0102
// IsvProdID: abcd
// ISVSVN: 6
// Attributes: 0102
// Digest Alg: 1
Expand Down
Binary file modified comid/tdx-profile/testcases/comid_seam_refval.cbor
Binary file not shown.
2 changes: 1 addition & 1 deletion comid/tdx-profile/testcases/src/comid_seam_refval.diag
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/ measurement-map / {
/ comid.mval / 1 : {
/ comid.attributes / -82 :[ 1, 2],
/ comid.isvprodid / -85 :[ 1, 2],
/ comid.isvprodid / -85 : h'ABCD',
/ comid.isvsvn / -73 : 6,
/ comid.mrsigner / -84 : [
[
Expand Down

0 comments on commit 6b0662c

Please sign in to comment.