Skip to content

Commit

Permalink
efi: remove unused ImageLoadEventSource
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisccoulson committed Mar 25, 2024
1 parent f8dedd0 commit 2b46230
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions efi/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ func (p FileImage) Open() (ImageReader, error) {
type loadParams struct {
KernelCommandline string
SnapModel secboot.SnapModel
Source ImageLoadEventSource // XXX: This is temporary until efi/secureboot_policy.go has been ported to the new code
}

// ImageLoadParams provides one or more values for an external parameter that
Expand Down Expand Up @@ -162,32 +161,6 @@ func (p snapModelParams) applyTo(params ...loadParams) []loadParams {
return out
}

// ImageLoadEventSource corresponds to the source of a ImageLoadActivity.
// XXX: This exists temporarily until efi/secureboot_policy.go has been ported to the new
// profile generation implementation.
type ImageLoadEventSource int

const (
// Firmware indicates that the source of a ImageLoadActivity was platform firmware, via the EFI_BOOT_SERVICES.LoadImage()
// and EFI_BOOT_SERVICES.StartImage() functions, with the subsequently executed image being verified against the signatures
// in the EFI authorized signature database.
Firmware ImageLoadEventSource = iota

// Shim indicates that the source of a ImageLoadActivity was shim, without relying on EFI boot services for loading, verifying
// and executing the subsequently executed image. The image is verified by shim against the signatures in the EFI authorized
// signature database, the MOK database or shim's built-in vendor certificate before being executed directly.
Shim
)

func (s ImageLoadEventSource) applyTo(params ...loadParams) []loadParams {
var out []loadParams
for _, param := range params {
param.Source = s
out = append(out, param)
}
return out
}

type imageLoadParamsSet []ImageLoadParams

func (s imageLoadParamsSet) Resolve(initial *loadParams) []loadParams {
Expand Down

0 comments on commit 2b46230

Please sign in to comment.