Skip to content

Commit

Permalink
Make envieonment class optional
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Mar 1, 2024
1 parent aa2a1a0 commit acf66b0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions comid/example_cca_realm_refval_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ func Example_cca_realm_refval() {
panic(err)
}
// output:
// ClassID: cd1f0e5526f9460db9d8f7fde171787c
// Vendor: Workload Client Ltd
// ClassID: cd1f0e5526f9460db9d8f7fde171787c
// InstanceID: 4284b5694ca6c0d2cf4789a0b95ac8025c818de52304364be7cd2981b2d2edc685b322277ec25819962413d8c9b2c1f5
// Index: rim
// Alg: sha-384
Expand Down Expand Up @@ -100,13 +100,19 @@ func extractMeasurement(m Measurement) error {

func extractRealmClass(c *Class) error {
if c == nil {
return fmt.Errorf("no class")
fmt.Println("class not present")
return nil
}

if c.Vendor != nil {
fmt.Printf("Vendor: %s\n", c.GetVendor())
}

classID := c.ClassID

if classID == nil {
return fmt.Errorf("no class-id")
fmt.Println("class-id not present")
return nil
}

if classID.Type() != "uuid" {
Expand All @@ -115,9 +121,6 @@ func extractRealmClass(c *Class) error {

fmt.Printf("ClassID: %x\n", classID.Bytes())

if c.Vendor != nil {
fmt.Printf("Vendor: %s\n", c.GetVendor())
}
return nil
}

Expand Down

0 comments on commit acf66b0

Please sign in to comment.