eventlog

package
v0.0.0-...-1e67125 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package eventlog provides utilities for interpreting Canonical Event Log events.

Index

Constants

This section is empty.

Variables

View Source
var ErrLocateGetterNil = errors.New("locate getter is nil")

ErrLocateGetterNil is returned when a LocateOptions.Getter is nil.

Functions

func Locate

func Locate(locType uint32, loc []byte, opts *LocateOptions) ([]byte, error)

Locate returns the value of a RIM locator.

func RIMEventsFromEventLog

func RIMEventsFromEventLog(el *eventlog.CryptoAgileLog) map[uint32][]*eventlog.SP800155Event3

RIMEventsFromEventLog returns a map of RIM locator type to a slice of SP800-155 Event3 events that match the RIM locator type.

Types

type EfiVarFSReader

type EfiVarFSReader struct {
	// Root is the mount location of the efivarfs volume.
	Root string
}

EfiVarFSReader implements VariableReader for the Linux efivarfs interface to UEFI variables.

func MakeEfiVarFSReader

func MakeEfiVarFSReader(root string) *EfiVarFSReader

MakeEfiVarFSReader returns a Linux efivarfs UEFI variable reader

func (*EfiVarFSReader) ReadVariable

func (r *EfiVarFSReader) ReadVariable(guid uuid.UUID, name []uint8) ([]byte, error)

ReadVariable returns the contents of a UEFI variable using Linux's efivarfs volume represented in r.Root. The name is in UEFI-native UCS-2 encoding. We use the UTF-16 decoder because UCS-2 and UTF-16 use the same encoding for code points representable in 16 bits.

type LocateOptions

type LocateOptions struct {
	Getter             trust.HTTPSGetter
	UEFIVariableReader VariableReader
}

LocateOptions contains options for locating data that can be local or remote.

func DefaultLocateOptions

func DefaultLocateOptions() *LocateOptions

DefaultLocateOptions returns a default LocateOptions.

type VariableReader

type VariableReader interface {
	ReadVariable(guid uuid.UUID, name []uint8) ([]byte, error)
}

VariableReader provides a method of reading UEFI variable contents given the vendor GUID and CHAR16 variable name. The UEFI specification states that strings are encoded in UCS-2.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL