Skip to content

Commit

Permalink
Merge pull request #267 from chrisccoulson/efi-fix-grub-matching
Browse files Browse the repository at this point in the history
efi: Fix a potential grub matching bug
  • Loading branch information
chrisccoulson authored Oct 27, 2023
2 parents 3064cfd + 9dc5db5 commit f4d7881
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions efi/efi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,13 @@ func newMockUbuntuShimImage15_7(c *C) *mockImage {
func newMockUbuntuGrubImage1(c *C) *mockImage {
return newMockImage().
appendSignatures(efitest.ReadWinCertificateAuthenticodeDetached(c, grubUbuntuSig1)).
addSection(".mods", nil)
addSection("mods", nil)
}

func newMockUbuntuGrubImage2(c *C) *mockImage {
return newMockImage().
appendSignatures(efitest.ReadWinCertificateAuthenticodeDetached(c, grubUbuntuSig2)).
addSection(".mods", nil).
addSection("mods", nil).
withSbat([]SbatComponent{
{Name: "grub"},
{Name: "grub.ubuntu"},
Expand All @@ -340,7 +340,7 @@ func newMockUbuntuGrubImage2(c *C) *mockImage {
func newMockUbuntuGrubImage3(c *C) *mockImage {
return newMockImage().
appendSignatures(efitest.ReadWinCertificateAuthenticodeDetached(c, grubUbuntuSig3)).
addSection(".mods", nil).
addSection("mods", nil).
withSbat([]SbatComponent{
{Name: "grub"},
{Name: "grub.ubuntu"},
Expand Down
6 changes: 3 additions & 3 deletions efi/image_rules_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func makeMicrosoftUEFICASecureBootNamespaceRules() *secureBootNamespaceRules {
sbatComponentExists("grub.ubuntu"),
),
imageMatchesAll(
imageSectionExists(".mods"),
imageSectionExists("mods"),
imageSignedByOrganization("Canonical Ltd."),
),
),
Expand All @@ -149,7 +149,7 @@ func makeMicrosoftUEFICASecureBootNamespaceRules() *secureBootNamespaceRules {
sbatSectionExists,
sbatComponentExists("grub"),
),
imageSectionExists(".mods"),
imageSectionExists("mods"),
),
newGrubLoadHandler,
),
Expand Down Expand Up @@ -186,7 +186,7 @@ func makeFallbackImageRules() *imageRules {
// Grub
newImageRule(
"grub",
imageSectionExists(".mods"),
imageSectionExists("mods"),
newGrubLoadHandler,
),
// TODO: add rules for Ubuntu Core UKI and Ubuntu grub that are not part of
Expand Down

0 comments on commit f4d7881

Please sign in to comment.