diff --git a/comid/example_cca_realm_refval_test.go b/comid/example_cca_realm_refval_test.go index 6150ff89..e087f09e 100644 --- a/comid/example_cca_realm_refval_test.go +++ b/comid/example_cca_realm_refval_test.go @@ -135,11 +135,14 @@ func extractRealmMeasurements(r *IntegrityRegisters) error { if r == nil { return fmt.Errorf("no integrity registers") } + for i, r := range r.m { switch t := i.(type) { case string: fmt.Printf("Index: %s\n", t) - extractRealmDigests(r) + if err := extractRealmDigests(r); err != nil { + return fmt.Errorf("invalid Digests for key: %s, %v", t, err) + } default: return fmt.Errorf("unexpected type for index: %T", t) } @@ -150,7 +153,7 @@ func extractRealmMeasurements(r *IntegrityRegisters) error { func extractRealmDigests(digests Digests) error { if err := digests.Valid(); err != nil { - return fmt.Errorf("invalid digtests %w:", err) + return fmt.Errorf("invalid digest: %v", err) } for _, d := range digests { fmt.Printf("Alg: %s\n", d.AlgIDToString())