types

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTPMALGorithm added in v0.2.0

func GetTPMALGorithm() (*PCRData, []Algorithm)

func PhasesToString added in v0.2.0

func PhasesToString(s []PhaseInfo) string

PhasesToString returns a nice string for all the phases with semicolons between them

Types

type Algorithm added in v0.2.0

type Algorithm struct {
	Alg            tpm2.TPMAlgID
	BankDataSetter *[]BankData
}

type BankData

type BankData struct {
	// list of PCR banks
	PCRs []int `json:"pcrs"`
	// Public key of the TPM
	PKFP string `json:"pkfp"`
	// Policy digest
	Pol string `json:"pol"`
	// Signature of the policy digest in base64
	Sig string `json:"sig"`
}

BankData constains data for a specific PCR bank.

type PCRData

type PCRData struct {
	SHA1   []BankData `json:"sha1,omitempty"`
	SHA256 []BankData `json:"sha256,omitempty"`
	SHA384 []BankData `json:"sha384,omitempty"`
	SHA512 []BankData `json:"sha512,omitempty"`
}

PCRData is the data structure for PCR signature json.

type PhaseInfo

type PhaseInfo struct {
	Phase constants.Phase
}

PhaseInfo describes which phase extensions are signed/measured.

func OrderedPhases

func OrderedPhases() []PhaseInfo

OrderedPhases returns the phases that are measured, in order.

Derived from https://github.com/systemd/systemd/blob/v253/src/boot/measure.c#L295-L308 ref: https://www.freedesktop.org/software/systemd/man/systemd-pcrphase.service.html#Description

This means that for each phase the values will be measured at that point, so we want to cover all points If you custom extend the PCR with your own phases, the this is useless I.E. You want to load something and then extend so its measured up to that point, then the values below do not work for you OrderedPhases returns the phases that are measured.

type RSAKey added in v0.2.0

type RSAKey interface {
	crypto.Signer
	PublicRSAKey() *rsa.PublicKey
}

RSAKey is the input for the CalculateBankData function.

type UkiSection added in v0.2.0

type UkiSection struct {
	// Section name.
	Name constants.Section
	// Path to the contents of the section.
	Path string
	// Should the section be measured to the TPM?
	Measure bool
	// Should the section be appended, or is it already in the PE file.
	Append bool
	// Size & VMA of the section.
	Size uint64
	VMA  uint64
}

UkiSection is a UKI file section.

Jump to

Keyboard shortcuts

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