Documentation ¶
Overview ¶
Package fit provides tools to read and verify FIT kernel images See https://doc.coreboot.org/lib/payloads/fit.html
Index ¶
- type Image
- func (i *Image) Edit(f func(s string) string)
- func (i *Image) GetConfigName() (string, error)
- func (i *Image) Label() string
- func (i *Image) Load(verbose bool) error
- func (i *Image) LoadConfig() (string, string, error)
- func (i *Image) Rank() int
- func (i *Image) ReadImage(image string) (*bytes.Reader, error)
- func (i *Image) ReadSignedImage(image string, ring openpgp.KeyRing) (*bytes.Reader, error)
- func (i *Image) String() string
- type PGPSignature
- type RSASignature
- type Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Image ¶
type Image struct { // Cmdline is the command line for the new kernel. Cmdline string // Root is the FDT. Root *dt.FDT // Kernel is the name of the kernel node. Kernel string // InitRAMFS is the name of the initramfs node. InitRAMFS string // ConfigOverride is the optional FIT config to use instead of default ConfigOverride string // SkipInitRAMFS skips the search for an ramdisk entry in the config SkipInitRAMFS bool // BootRank ranks the priority of the images in boot menu BootRank int // KeyRing is the optional set of public keys used to validate images at Load KeyRing openpgp.KeyRing // contains filtered or unexported fields }
Image is a Flattened Image Tree implementation for OSImage.
func ParseConfig ¶
func ParseConfig(r io.ReadSeeker) ([]Image, error)
ParseConfig reads r for a FIT image and returns a OSImage for each configuration parsed.
func (*Image) GetConfigName ¶
GetConfigName finds the name of the default configuration or returns the override config if available
func (*Image) LoadConfig ¶
LoadConfig loads a configuration from a FIT image Returns <kernel_name>, <ramdisk_name>, error
func (*Image) ReadImage ¶
ReadImage reads an image node from an FDT and returns the `data` contents.
func (*Image) ReadSignedImage ¶
ReadSignedImage reads an image node from an FDT and verifies the content against a key set. Signature information is found in child nodes.
WARNING! Unlike many Go functions, this may return both the file and an error.
If the signature does not exist or does not match the keyring, both the file and a signature error will be returned.
type PGPSignature ¶
type PGPSignature struct {
// contains filtered or unexported fields
}
PGPSignature implements a OpenPGP signature check.
func (PGPSignature) String ¶
func (s PGPSignature) String() string
type RSASignature ¶
type RSASignature struct {
// contains filtered or unexported fields
}
RSASignature implements a PKCS1v15 signature check.
func (RSASignature) String ¶
func (s RSASignature) String() string
type Signature ¶
type Signature interface { fmt.Stringer // Warning: If the signature does not exist or does not match the keyring, // both the file and a signature error will be returned. // Returns a bytes.Reader to the original data array. Verify([]byte, openpgp.KeyRing) (*bytes.Reader, error) }
Signature defines an extendable interface for verifying images using varying signing methods.