Skip to content

Commit

Permalink
efi: drop the grub change in this PR
Browse files Browse the repository at this point in the history
Grub detection will be fixed separately in canonical#268
  • Loading branch information
chrisccoulson committed Nov 27, 2023
1 parent 356e6cf commit 6499519
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
17 changes: 0 additions & 17 deletions efi/image_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,23 +165,6 @@ func (p imageSignedByOrganization) Matches(image peImageHandle) (bool, error) {
return false, nil
}

// imageSignedByCommonName is a predicate that is satisfied if an
// image is signed by a subject with the specified common name.
type imageSignedByCommonName string

func (p imageSignedByCommonName) Matches(image peImageHandle) (bool, error) {
sigs, err := image.SecureBootSignatures()
if err != nil {
return false, err
}
for _, sig := range sigs {
if sig.GetSigner().Subject.CommonName == string(p) {
return true, nil
}
}
return false, nil
}

type imageDigestPredicate struct {
alg crypto.Hash
digest []byte
Expand Down
11 changes: 0 additions & 11 deletions efi/image_rules_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,6 @@ func makeMicrosoftUEFICASecureBootNamespaceRules() *secureBootNamespaceRules {
),
newGrubLoadHandlerConstructor(grubChainloaderUsesShimProtocol).New,
),
withImageRuleOnlyForTesting(
"Ubuntu grub, signed with snakeoil or other test key",
imageMatchesAll(
imageSectionExists(".mods"),
imageMatchesAny(
imageSignedByOrganization("Snake Oil"),
imageSignedByCommonName("new vendor certificate"),
),
),
newGrubLoadHandlerConstructor(grubChainloaderUsesShimProtocol).New,
),
withImageRule(
"grub",
imageMatchesAny(
Expand Down

0 comments on commit 6499519

Please sign in to comment.