diff --git a/efi/preinstall/check_host_security.go b/efi/preinstall/check_host_security.go index 0bc28383..7a1ab6a9 100644 --- a/efi/preinstall/check_host_security.go +++ b/efi/preinstall/check_host_security.go @@ -21,7 +21,6 @@ package preinstall import ( "bytes" - "fmt" "github.com/canonical/tcglog-parser" "github.com/pilebones/go-udev/netlink" @@ -115,17 +114,9 @@ Loop: // as the TCG PC Client Platform Firmware Profile spec says that the event // data in EV_EFI_ACTION events should not be NULL terminated. errs = append(errs, ErrInsufficientDMAProtection) - default: - // Unexpected data - return fmt.Errorf("unexpected EV_EFI_ACTION event data in PCR7 event: %q", event.Data) } - case tcglog.EventTypeEFIVariableDriverConfig, tcglog.EventTypeSeparator: - // ok case tcglog.EventTypeEFIVariableAuthority: break Loop - default: - // Unexpected event type - return fmt.Errorf("unexpected event type (%v) in PCR7", event.EventType) } } diff --git a/efi/preinstall/check_host_security_test.go b/efi/preinstall/check_host_security_test.go index d4748b8c..404877db 100644 --- a/efi/preinstall/check_host_security_test.go +++ b/efi/preinstall/check_host_security_test.go @@ -22,9 +22,7 @@ package preinstall_test import ( . "gopkg.in/check.v1" - "github.com/canonical/tcglog-parser" . "github.com/snapcore/secboot/efi/preinstall" - internal_efi "github.com/snapcore/secboot/internal/efi" "github.com/snapcore/secboot/internal/efitest" ) @@ -127,30 +125,3 @@ func (s *hostSecuritySuite) TestCheckSecureBootPolicyPCRForDegradedSettingsFirmw c.Assert(err, Implements, &tmpl) c.Check(err.(CompoundError).Unwrap(), DeepEquals, []error{ErrUEFIDebuggingEnabled, ErrInsufficientDMAProtection}) } - -func (s *hostSecuritySuite) TestCheckSecureBootPolicyPCRForDegradedSettingsErrUnexpectedData(c *C) { - log := efitest.NewLog(c, &efitest.LogOptions{FirmwareDebugger: true}) - for _, ev := range log.Events { - if ev.PCRIndex != internal_efi.SecureBootPolicyPCR { - continue - } - ev.Data = tcglog.EFICallingEFIApplicationEvent - break - } - err := CheckSecureBootPolicyPCRForDegradedFirmwareSettings(log) - c.Check(err, ErrorMatches, `unexpected EV_EFI_ACTION event data in PCR7 event: \"Calling EFI Application from Boot Option\"`) -} - -func (s *hostSecuritySuite) TestCheckSecureBootPolicyPCRForDegradedSettingsErrUnexpectedType(c *C) { - log := efitest.NewLog(c, &efitest.LogOptions{FirmwareDebugger: true}) - for _, ev := range log.Events { - if ev.PCRIndex != internal_efi.SecureBootPolicyPCR { - continue - } - ev.EventType = tcglog.EventTypeAction - break - } - c.Check(CheckSecureBootPolicyPCRForDegradedFirmwareSettings(log), ErrorMatches, `unexpected event type \(EV_ACTION\) in PCR7`) - err := CheckSecureBootPolicyPCRForDegradedFirmwareSettings(log) - c.Check(err, ErrorMatches, `unexpected event type \(EV_ACTION\) in PCR7`) -}