Skip to content

Commit

Permalink
BootGuard tests: reword errors
Browse files Browse the repository at this point in the history
- spell out Boot Policy Manifest and Key Manifest
- grammar :)

Signed-off-by: Daniel Maslowski <[email protected]>
  • Loading branch information
orangecms committed Jan 31, 2024
1 parent 2d8466d commit 78d78b4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/test/bootguard_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,32 +230,32 @@ func BootGuardBPM(hw hwapi.LowLevelHardwareInterfaces, p *PreSet) (bool, error,
var errs error
b, err := bootguard.NewBPMAndKM(bpmReader, kmReader)
if b == nil || err != nil {
errs = multierr.Combine(errs, fmt.Errorf("couldn't parse KM and BPM\n"))
errs = multierr.Combine(errs, fmt.Errorf("couldn't parse Key Manifest and Boot Policy Manifest\n"))
}
if err := b.ValidateBPM(); err != nil {
errs = multierr.Combine(errs, fmt.Errorf("couldn't validate BPM"))
errs = multierr.Combine(errs, fmt.Errorf("couldn't validate Boot Policy Manifest"))
}
if err := b.VerifyBPM(); err != nil {
errs = multierr.Combine(errs, fmt.Errorf("couldn't verify BPM signature"))
errs = multierr.Combine(errs, fmt.Errorf("couldn't verify Boot Policy Manifest signature"))
}
secure, err := b.BPMCryptoSecure()
if !secure || err != nil {
errs = multierr.Combine(errs, fmt.Errorf("bpm crypto parameters are insecure"))
errs = multierr.Combine(errs, fmt.Errorf("Boot Policy Manifest crypto parameters are insecure"))
}
if p.Strict {
secure, err = b.StrictSaneBPMSecurityProps()
} else {
secure, err = b.SaneBPMSecurityProps()
}
if !secure || err != nil {
errs = multierr.Combine(errs, fmt.Errorf("bpm hasn't sane security properties: %v", err))
errs = multierr.Combine(errs, fmt.Errorf("Boot Policy Manifest doesn't have sane security properties: %v", err))
}
secure, err = b.BPMKeyMatchKMHash()
if !secure || err != nil {
errs = multierr.Combine(errs, fmt.Errorf("bpm doesn't match km hash: %v", err))
errs = multierr.Combine(errs, fmt.Errorf("Boot Policy Manifest doesn't match Key Manifest hash: %v", err))
}
if errs != nil {
return false, fmt.Errorf("multiple errors"), fmt.Errorf("%+v", errs)
return false, fmt.Errorf("Errors occurred"), fmt.Errorf("%+v", errs)
}
return true, nil, nil
}
Expand Down

0 comments on commit 78d78b4

Please sign in to comment.