bgbootpolicy

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: BSD-3-Clause Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CachingTypeWriteProtect = CachingType(iota)
	CachingTypeWriteBack
	CachingTypeReserved0
	CachingTypeReserved1
)
View Source
const StructureIDBPMH = "__ACBP__"

StructureIDBPMH is the StructureID (in terms of the document #575623) of element 'BPMH'.

View Source
const StructureIDPM = "__PMDA__"

StructureIDPM is the StructureID (in terms of the document #575623) of element 'PM'.

View Source
const StructureIDSE = "__IBBS__"

StructureIDSE is the StructureID (in terms of the document #575623) of element 'SE'.

View Source
const StructureIDSignature = "__PMSG__"

StructureIDSignature is the StructureID (in terms of the document #575623) of element 'Signature'.

Variables

This section is empty.

Functions

This section is empty.

Types

type BPMH

type BPMH struct {
	StructInfo `id:"__ACBP__" version:"0x10"`

	HdrStructVersion uint8 `json:"HdrStructVersion"`

	PMBPMVersion uint8 `json:"bpmhRevision"`

	// PrettyString: BPM SVN
	BPMSVN bg.SVN `json:"bpmhSNV"`
	// PrettyString: ACM SVN Auth
	ACMSVNAuth bg.SVN `json:"bpmhACMSVN"`

	Reserved0 [1]byte `require:"0" json:"bpmhReserved0,omitempty"`

	NEMDataStack Size4K `json:"bpmhNEMStackSize"`
}

func NewBPMH

func NewBPMH() *BPMH

NewBPMH returns a new instance of BPMH with all default values set.

func (*BPMH) ACMSVNAuthOffset

func (s *BPMH) ACMSVNAuthOffset() uint64

ACMSVNAuthOffset returns the offset in bytes of field ACMSVNAuth

func (*BPMH) ACMSVNAuthTotalSize

func (s *BPMH) ACMSVNAuthTotalSize() uint64

ACMSVNAuthSize returns the size in bytes of the value of field ACMSVNAuth

func (*BPMH) BPMSVNOffset

func (s *BPMH) BPMSVNOffset() uint64

BPMSVNOffset returns the offset in bytes of field BPMSVN

func (*BPMH) BPMSVNTotalSize

func (s *BPMH) BPMSVNTotalSize() uint64

BPMSVNSize returns the size in bytes of the value of field BPMSVN

func (*BPMH) GetStructInfo

func (s *BPMH) GetStructInfo() bg.StructInfo

GetStructInfo returns current value of StructInfo of the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*BPMH) HdrStructVersionOffset

func (s *BPMH) HdrStructVersionOffset() uint64

HdrStructVersionOffset returns the offset in bytes of field HdrStructVersion

func (*BPMH) HdrStructVersionTotalSize

func (s *BPMH) HdrStructVersionTotalSize() uint64

HdrStructVersionSize returns the size in bytes of the value of field HdrStructVersion

func (*BPMH) NEMDataStackOffset

func (s *BPMH) NEMDataStackOffset() uint64

NEMDataStackOffset returns the offset in bytes of field NEMDataStack

func (*BPMH) NEMDataStackTotalSize

func (s *BPMH) NEMDataStackTotalSize() uint64

NEMDataStackSize returns the size in bytes of the value of field NEMDataStack

func (*BPMH) PMBPMVersionOffset

func (s *BPMH) PMBPMVersionOffset() uint64

PMBPMVersionOffset returns the offset in bytes of field PMBPMVersion

func (*BPMH) PMBPMVersionTotalSize

func (s *BPMH) PMBPMVersionTotalSize() uint64

PMBPMVersionSize returns the size in bytes of the value of field PMBPMVersion

func (*BPMH) PrettyString

func (s *BPMH) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the content of the structure in an easy-to-read format.

func (*BPMH) ReadDataFrom

func (s *BPMH) ReadDataFrom(r io.Reader) (int64, error)

ReadDataFrom reads the BPMH from 'r' excluding StructInfo, in format defined in the document #575623.

func (*BPMH) ReadFrom

func (s *BPMH) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the BPMH from 'r' in format defined in the document #575623.

func (*BPMH) Rehash

func (s *BPMH) Rehash()

Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.

func (*BPMH) RehashRecursive

func (s *BPMH) RehashRecursive()

RehashRecursive calls Rehash (see below) recursively.

func (*BPMH) Reserved0Offset

func (s *BPMH) Reserved0Offset() uint64

Reserved0Offset returns the offset in bytes of field Reserved0

func (*BPMH) Reserved0TotalSize

func (s *BPMH) Reserved0TotalSize() uint64

Reserved0Size returns the size in bytes of the value of field Reserved0

func (*BPMH) SetStructInfo

func (s *BPMH) SetStructInfo(newStructInfo bg.StructInfo)

SetStructInfo sets new value of StructInfo to the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*BPMH) StructInfoOffset

func (s *BPMH) StructInfoOffset() uint64

StructInfoOffset returns the offset in bytes of field StructInfo

func (*BPMH) StructInfoTotalSize

func (s *BPMH) StructInfoTotalSize() uint64

StructInfoSize returns the size in bytes of the value of field StructInfo

func (*BPMH) TotalSize

func (s *BPMH) TotalSize() uint64

Size returns the total size of the BPMH.

func (*BPMH) Validate

func (s *BPMH) Validate() error

Validate (recursively) checks the structure if there are any unexpected values. It returns an error if so.

func (*BPMH) WriteTo

func (s *BPMH) WriteTo(w io.Writer) (int64, error)

WriteTo writes the BPMH into 'w' in format defined in the document #575623.

type CachingType

type CachingType uint8

func (CachingType) PrettyString

func (v CachingType) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the bits of the flags in an easy-to-read format.

func (CachingType) ReadFrom

func (v CachingType) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the CachingType from 'r' in binary format.

func (CachingType) String

func (c CachingType) String() string

String implements fmt.Stringer.

func (CachingType) TotalSize

func (v CachingType) TotalSize() uint64

TotalSize returns the total size measured through binary.Size.

func (CachingType) WriteTo

func (v CachingType) WriteTo(w io.Writer) (int64, error)

WriteTo writes the CachingType into 'w' in binary format.

type IBBSegment

type IBBSegment struct {
	Reserved [2]byte `require:"0" json:"ibbSegReserved"`
	Flags    uint16  `json:"ibbSegFlags"`
	Base     uint32  `json:"ibbSegBase"`
	Size     uint32  `json:"ibbSegSize"`
}

func NewIBBSegment

func NewIBBSegment() *IBBSegment

NewIBBSegment returns a new instance of IBBSegment with all default values set.

func (*IBBSegment) BaseOffset

func (s *IBBSegment) BaseOffset() uint64

BaseOffset returns the offset in bytes of field Base

func (*IBBSegment) BaseTotalSize

func (s *IBBSegment) BaseTotalSize() uint64

BaseSize returns the size in bytes of the value of field Base

func (*IBBSegment) FlagsOffset

func (s *IBBSegment) FlagsOffset() uint64

FlagsOffset returns the offset in bytes of field Flags

func (*IBBSegment) FlagsTotalSize

func (s *IBBSegment) FlagsTotalSize() uint64

FlagsSize returns the size in bytes of the value of field Flags

func (*IBBSegment) PrettyString

func (s *IBBSegment) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the content of the structure in an easy-to-read format.

func (*IBBSegment) ReadFrom

func (s *IBBSegment) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the IBBSegment from 'r' in format defined in the document #575623.

func (*IBBSegment) Rehash

func (s *IBBSegment) Rehash()

Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.

func (*IBBSegment) RehashRecursive

func (s *IBBSegment) RehashRecursive()

RehashRecursive calls Rehash (see below) recursively.

func (*IBBSegment) ReservedOffset

func (s *IBBSegment) ReservedOffset() uint64

ReservedOffset returns the offset in bytes of field Reserved

func (*IBBSegment) ReservedTotalSize

func (s *IBBSegment) ReservedTotalSize() uint64

ReservedSize returns the size in bytes of the value of field Reserved

func (*IBBSegment) SizeOffset

func (s *IBBSegment) SizeOffset() uint64

SizeOffset returns the offset in bytes of field Size

func (*IBBSegment) SizeTotalSize

func (s *IBBSegment) SizeTotalSize() uint64

SizeSize returns the size in bytes of the value of field Size

func (*IBBSegment) TotalSize

func (s *IBBSegment) TotalSize() uint64

Size returns the total size of the IBBSegment.

func (*IBBSegment) Validate

func (s *IBBSegment) Validate() error

Validate (recursively) checks the structure if there are any unexpected values. It returns an error if so.

func (*IBBSegment) WriteTo

func (s *IBBSegment) WriteTo(w io.Writer) (int64, error)

WriteTo writes the IBBSegment into 'w' in format defined in the document #575623.

type Manifest

type Manifest struct {
	// PrettyString: BPMH: Header
	BPMH `rehashValue:"rehashedBPMH()" json:"bpmHeader"`
	// PrettyString: SE: Header
	SE []SE `json:"bpmSE"`
	// PrettyString: PME: Platform Manufacturer
	PME *PM `json:"bpmPME,omitempty"`
	// PrettyString: PMSE: Signature
	PMSE Signature `json:"bpmSignature"`
}

PrettyString: Boot Policy Manifest

func NewManifest

func NewManifest() *Manifest

NewManifest returns a new instance of Manifest with all default values set.

func (*Manifest) BPMHOffset

func (s *Manifest) BPMHOffset() uint64

BPMHOffset returns the offset in bytes of field BPMH

func (*Manifest) BPMHTotalSize

func (s *Manifest) BPMHTotalSize() uint64

BPMHSize returns the size in bytes of the value of field BPMH

func (*Manifest) IBBDataRanges

func (bpm *Manifest) IBBDataRanges(firmwareSize uint64) pkgbytes.Ranges

IBBDataRanges returns data ranges of IBB.

func (*Manifest) PMEOffset

func (s *Manifest) PMEOffset() uint64

PMEOffset returns the offset in bytes of field PME

func (*Manifest) PMETotalSize

func (s *Manifest) PMETotalSize() uint64

PMESize returns the size in bytes of the value of field PME

func (*Manifest) PMSEOffset

func (s *Manifest) PMSEOffset() uint64

PMSEOffset returns the offset in bytes of field PMSE

func (*Manifest) PMSETotalSize

func (s *Manifest) PMSETotalSize() uint64

PMSESize returns the size in bytes of the value of field PMSE

func (*Manifest) PrettyString

func (s *Manifest) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the content of the structure in an easy-to-read format.

func (Manifest) Print

func (bpm Manifest) Print()

Print prints the Manifest

func (*Manifest) ReadFrom

func (s *Manifest) ReadFrom(r io.Reader) (returnN int64, returnErr error)

ReadFrom reads the Manifest from 'r' in format defined in the document #575623.

func (*Manifest) Rehash

func (s *Manifest) Rehash()

Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.

func (*Manifest) RehashRecursive

func (s *Manifest) RehashRecursive()

RehashRecursive calls Rehash (see below) recursively.

func (*Manifest) SEOffset

func (s *Manifest) SEOffset() uint64

SEOffset returns the offset in bytes of field SE

func (*Manifest) SETotalSize

func (s *Manifest) SETotalSize() uint64

SESize returns the size in bytes of the value of field SE

func (Manifest) StructInfo

func (bpm Manifest) StructInfo() StructInfo

StructInfo is the information about how to parse the structure.

func (*Manifest) TotalSize

func (s *Manifest) TotalSize() uint64

Size returns the total size of the Manifest.

func (*Manifest) Validate

func (s *Manifest) Validate() error

Validate (recursively) checks the structure if there are any unexpected values. It returns an error if so.

func (*Manifest) ValidateIBB

func (bpm *Manifest) ValidateIBB(firmware uefi.Firmware) error

ValidateIBB returns an error if IBB segments does not match the signature

func (*Manifest) WriteTo

func (s *Manifest) WriteTo(w io.Writer) (int64, error)

WriteTo writes the Manifest into 'w' in format defined in the document #575623.

type PBETValue

type PBETValue uint8

func (PBETValue) Duration

func (pbet PBETValue) Duration() time.Duration

Duration returns the value as time.Duration.

func (PBETValue) PBETValue

func (pbet PBETValue) PBETValue() uint8

PBETValue returns the raw value of the timer setting.

func (PBETValue) PrettyString

func (v PBETValue) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the bits of the flags in an easy-to-read format.

func (PBETValue) ReadFrom

func (v PBETValue) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the PBETValue from 'r' in binary format.

func (*PBETValue) SetDuration

func (pbet *PBETValue) SetDuration(duration time.Duration) time.Duration

func (PBETValue) TotalSize

func (v PBETValue) TotalSize() uint64

TotalSize returns the total size measured through binary.Size.

func (PBETValue) WriteTo

func (v PBETValue) WriteTo(w io.Writer) (int64, error)

WriteTo writes the PBETValue into 'w' in binary format.

type PM

type PM struct {
	StructInfo `id:"__PMDA__" version:"0x10"`
	DataSize   uint16 `json:"pcDataSize"`
	Data       []byte `json:"pcData"`
}

func NewPM

func NewPM() *PM

NewPM returns a new instance of PM with all default values set.

func (*PM) DataOffset

func (s *PM) DataOffset() uint64

DataOffset returns the offset in bytes of field Data

func (*PM) DataSizeOffset

func (s *PM) DataSizeOffset() uint64

DataSizeOffset returns the offset in bytes of field DataSize

func (*PM) DataSizeTotalSize

func (s *PM) DataSizeTotalSize() uint64

DataSizeSize returns the size in bytes of the value of field DataSize

func (*PM) DataTotalSize

func (s *PM) DataTotalSize() uint64

DataSize returns the size in bytes of the value of field Data

func (*PM) GetStructInfo

func (s *PM) GetStructInfo() bg.StructInfo

GetStructInfo returns current value of StructInfo of the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*PM) PrettyString

func (s *PM) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the content of the structure in an easy-to-read format.

func (*PM) ReadDataFrom

func (s *PM) ReadDataFrom(r io.Reader) (int64, error)

ReadDataFrom reads the PM from 'r' excluding StructInfo, in format defined in the document #575623.

func (*PM) ReadFrom

func (s *PM) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the PM from 'r' in format defined in the document #575623.

func (*PM) Rehash

func (s *PM) Rehash()

Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.

func (*PM) RehashRecursive

func (s *PM) RehashRecursive()

RehashRecursive calls Rehash (see below) recursively.

func (*PM) SetStructInfo

func (s *PM) SetStructInfo(newStructInfo bg.StructInfo)

SetStructInfo sets new value of StructInfo to the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*PM) StructInfoOffset

func (s *PM) StructInfoOffset() uint64

StructInfoOffset returns the offset in bytes of field StructInfo

func (*PM) StructInfoTotalSize

func (s *PM) StructInfoTotalSize() uint64

StructInfoSize returns the size in bytes of the value of field StructInfo

func (*PM) TotalSize

func (s *PM) TotalSize() uint64

Size returns the total size of the PM.

func (*PM) Validate

func (s *PM) Validate() error

Validate (recursively) checks the structure if there are any unexpected values. It returns an error if so.

func (*PM) WriteTo

func (s *PM) WriteTo(w io.Writer) (int64, error)

WriteTo writes the PM into 'w' in format defined in the document #575623.

type SE

type SE struct {
	StructInfo `id:"__IBBS__" version:"0x10"`
	Reserved0  [1]byte   `require:"0" json:"seReserved0,omitempty"`
	Reserved1  [1]byte   `require:"0" json:"seReserved1,omitempty"`
	PBETValue  PBETValue `json:"sePBETValue"`
	Flags      SEFlags   `json:"seFlags"`
	// PrettyString: IBB MCHBAR
	IBBMCHBAR uint64 `json:"seIBBMCHBAR"`
	// PrettyString: VT-d BAR
	VTdBAR uint64 `json:"seVTdBAR"`
	// PrettyString: DMA Protection 0 Base Address
	PMRLBase uint32 `json:"seDMAProtBase0"`
	// PrettyString: DMA Protection 0 Limit Address
	PMRLLimit uint32 `json:"seDMAProtLimit0"`
	// PrettyString: DMA Protection 1 Base Address
	Reserved2 [8]byte `json:"seDMAProtBase1"`
	// PrettyString: DMA Protection 2 Limit Address
	Reserved3 [8]byte `json:"seDMAProtLimit1"`

	PostIBBHash bg.HashStructureFill `json:"sePostIBBHash"`

	IBBEntryPoint uint32 `json:"seIBBEntry"`

	Digest bg.HashStructure `json:"seDigestList"`

	IBBSegments []IBBSegment `countType:"uint8" json:"seIBBSegments,omitempty"`
}

PrettyString: IBB Segments Element

func NewSE

func NewSE() *SE

NewSE returns a new instance of SE with all default values set.

func (*SE) DigestOffset

func (s *SE) DigestOffset() uint64

DigestOffset returns the offset in bytes of field Digest

func (*SE) DigestTotalSize

func (s *SE) DigestTotalSize() uint64

DigestSize returns the size in bytes of the value of field Digest

func (*SE) FlagsOffset

func (s *SE) FlagsOffset() uint64

FlagsOffset returns the offset in bytes of field Flags

func (*SE) FlagsTotalSize

func (s *SE) FlagsTotalSize() uint64

FlagsSize returns the size in bytes of the value of field Flags

func (*SE) GetStructInfo

func (s *SE) GetStructInfo() bg.StructInfo

GetStructInfo returns current value of StructInfo of the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*SE) IBBEntryPointOffset

func (s *SE) IBBEntryPointOffset() uint64

IBBEntryPointOffset returns the offset in bytes of field IBBEntryPoint

func (*SE) IBBEntryPointTotalSize

func (s *SE) IBBEntryPointTotalSize() uint64

IBBEntryPointSize returns the size in bytes of the value of field IBBEntryPoint

func (*SE) IBBMCHBAROffset

func (s *SE) IBBMCHBAROffset() uint64

IBBMCHBAROffset returns the offset in bytes of field IBBMCHBAR

func (*SE) IBBMCHBARTotalSize

func (s *SE) IBBMCHBARTotalSize() uint64

IBBMCHBARSize returns the size in bytes of the value of field IBBMCHBAR

func (*SE) IBBSegmentsOffset

func (s *SE) IBBSegmentsOffset() uint64

IBBSegmentsOffset returns the offset in bytes of field IBBSegments

func (*SE) IBBSegmentsTotalSize

func (s *SE) IBBSegmentsTotalSize() uint64

IBBSegmentsSize returns the size in bytes of the value of field IBBSegments

func (*SE) PBETValueOffset

func (s *SE) PBETValueOffset() uint64

PBETValueOffset returns the offset in bytes of field PBETValue

func (*SE) PBETValueTotalSize

func (s *SE) PBETValueTotalSize() uint64

PBETValueSize returns the size in bytes of the value of field PBETValue

func (*SE) PMRLBaseOffset

func (s *SE) PMRLBaseOffset() uint64

PMRLBaseOffset returns the offset in bytes of field PMRLBase

func (*SE) PMRLBaseTotalSize

func (s *SE) PMRLBaseTotalSize() uint64

PMRLBaseSize returns the size in bytes of the value of field PMRLBase

func (*SE) PMRLLimitOffset

func (s *SE) PMRLLimitOffset() uint64

PMRLLimitOffset returns the offset in bytes of field PMRLLimit

func (*SE) PMRLLimitTotalSize

func (s *SE) PMRLLimitTotalSize() uint64

PMRLLimitSize returns the size in bytes of the value of field PMRLLimit

func (*SE) PostIBBHashOffset

func (s *SE) PostIBBHashOffset() uint64

PostIBBHashOffset returns the offset in bytes of field PostIBBHash

func (*SE) PostIBBHashTotalSize

func (s *SE) PostIBBHashTotalSize() uint64

PostIBBHashSize returns the size in bytes of the value of field PostIBBHash

func (*SE) PrettyString

func (s *SE) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the content of the structure in an easy-to-read format.

func (*SE) ReadDataFrom

func (s *SE) ReadDataFrom(r io.Reader) (int64, error)

ReadDataFrom reads the SE from 'r' excluding StructInfo, in format defined in the document #575623.

func (*SE) ReadFrom

func (s *SE) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the SE from 'r' in format defined in the document #575623.

func (*SE) Rehash

func (s *SE) Rehash()

Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.

func (*SE) RehashRecursive

func (s *SE) RehashRecursive()

RehashRecursive calls Rehash (see below) recursively.

func (*SE) Reserved0Offset

func (s *SE) Reserved0Offset() uint64

Reserved0Offset returns the offset in bytes of field Reserved0

func (*SE) Reserved0TotalSize

func (s *SE) Reserved0TotalSize() uint64

Reserved0Size returns the size in bytes of the value of field Reserved0

func (*SE) Reserved1Offset

func (s *SE) Reserved1Offset() uint64

Reserved1Offset returns the offset in bytes of field Reserved1

func (*SE) Reserved1TotalSize

func (s *SE) Reserved1TotalSize() uint64

Reserved1Size returns the size in bytes of the value of field Reserved1

func (*SE) Reserved2Offset

func (s *SE) Reserved2Offset() uint64

Reserved2Offset returns the offset in bytes of field Reserved2

func (*SE) Reserved2TotalSize

func (s *SE) Reserved2TotalSize() uint64

Reserved2Size returns the size in bytes of the value of field Reserved2

func (*SE) Reserved3Offset

func (s *SE) Reserved3Offset() uint64

Reserved3Offset returns the offset in bytes of field Reserved3

func (*SE) Reserved3TotalSize

func (s *SE) Reserved3TotalSize() uint64

Reserved3Size returns the size in bytes of the value of field Reserved3

func (*SE) SetStructInfo

func (s *SE) SetStructInfo(newStructInfo bg.StructInfo)

SetStructInfo sets new value of StructInfo to the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*SE) StructInfoOffset

func (s *SE) StructInfoOffset() uint64

StructInfoOffset returns the offset in bytes of field StructInfo

func (*SE) StructInfoTotalSize

func (s *SE) StructInfoTotalSize() uint64

StructInfoSize returns the size in bytes of the value of field StructInfo

func (*SE) TotalSize

func (s *SE) TotalSize() uint64

Size returns the total size of the SE.

func (*SE) VTdBAROffset

func (s *SE) VTdBAROffset() uint64

VTdBAROffset returns the offset in bytes of field VTdBAR

func (*SE) VTdBARTotalSize

func (s *SE) VTdBARTotalSize() uint64

VTdBARSize returns the size in bytes of the value of field VTdBAR

func (*SE) Validate

func (s *SE) Validate() error

Validate (recursively) checks the structure if there are any unexpected values. It returns an error if so.

func (*SE) WriteTo

func (s *SE) WriteTo(w io.Writer) (int64, error)

WriteTo writes the SE into 'w' in format defined in the document #575623.

type SEFlags

type SEFlags uint32

func (SEFlags) AuthorityMeasure

func (flags SEFlags) AuthorityMeasure() bool

PrettyString-true: Extend Authority Measurements into the Authority PCR 7 PrettyString-false: Do not extend into the Authority PCR 7

func (SEFlags) DMAProtection

func (flags SEFlags) DMAProtection() bool

PrettyString-true: Enable DMA Protection PrettyString-false: Disable DMA Protection

func (SEFlags) Locality3Startup

func (flags SEFlags) Locality3Startup() bool

PrettyString-true: Issue TPM Start-up from Locality 3 PrettyString-false: Disabled

func (SEFlags) PrettyString

func (v SEFlags) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the bits of the flags in an easy-to-read format.

func (SEFlags) ReadFrom

func (v SEFlags) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the SEFlags from 'r' in binary format.

func (SEFlags) Reserved0

func (flags SEFlags) Reserved0() uint32

func (SEFlags) SupportsTopSwapRemediation

func (flags SEFlags) SupportsTopSwapRemediation() bool

PrettyString-true: BIOS supports Top Swap remediation action PrettyString-false: BIOS does not support Top Swap remediation action

func (SEFlags) TPMFailureLeavesHierarchiesEnabled

func (flags SEFlags) TPMFailureLeavesHierarchiesEnabled() bool

PrettyString-true: Leave Hierarchies enabled. Cap all PCRs on failure. PrettyString-false: Do not leave enabled. Disable all Hierarchies or deactivate on failure.

func (SEFlags) TotalSize

func (v SEFlags) TotalSize() uint64

TotalSize returns the total size measured through binary.Size.

func (SEFlags) WriteTo

func (v SEFlags) WriteTo(w io.Writer) (int64, error)

WriteTo writes the SEFlags into 'w' in binary format.

type Signature

type Signature struct {
	StructInfo      `id:"__PMSG__" version:"0x10"`
	bg.KeySignature `json:"sigKeySignature"`
}

Signature contains the signature of the BPM.

func NewSignature

func NewSignature() *Signature

NewSignature returns a new instance of Signature with all default values set.

func (*Signature) GetStructInfo

func (s *Signature) GetStructInfo() bg.StructInfo

GetStructInfo returns current value of StructInfo of the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*Signature) KeySignatureOffset

func (s *Signature) KeySignatureOffset() uint64

KeySignatureOffset returns the offset in bytes of field KeySignature

func (*Signature) KeySignatureTotalSize

func (s *Signature) KeySignatureTotalSize() uint64

KeySignatureSize returns the size in bytes of the value of field KeySignature

func (*Signature) PrettyString

func (s *Signature) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the content of the structure in an easy-to-read format.

func (*Signature) ReadDataFrom

func (s *Signature) ReadDataFrom(r io.Reader) (int64, error)

ReadDataFrom reads the Signature from 'r' excluding StructInfo, in format defined in the document #575623.

func (*Signature) ReadFrom

func (s *Signature) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the Signature from 'r' in format defined in the document #575623.

func (*Signature) Rehash

func (s *Signature) Rehash()

Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.

func (*Signature) RehashRecursive

func (s *Signature) RehashRecursive()

RehashRecursive calls Rehash (see below) recursively.

func (*Signature) SetStructInfo

func (s *Signature) SetStructInfo(newStructInfo bg.StructInfo)

SetStructInfo sets new value of StructInfo to the structure.

StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).

func (*Signature) StructInfoOffset

func (s *Signature) StructInfoOffset() uint64

StructInfoOffset returns the offset in bytes of field StructInfo

func (*Signature) StructInfoTotalSize

func (s *Signature) StructInfoTotalSize() uint64

StructInfoSize returns the size in bytes of the value of field StructInfo

func (*Signature) TotalSize

func (s *Signature) TotalSize() uint64

Size returns the total size of the Signature.

func (*Signature) Validate

func (s *Signature) Validate() error

Validate (recursively) checks the structure if there are any unexpected values. It returns an error if so.

func (*Signature) WriteTo

func (s *Signature) WriteTo(w io.Writer) (int64, error)

WriteTo writes the Signature into 'w' in format defined in the document #575623.

type Size4K

type Size4K uint16

Size4K is a size in units of 4096 bytes.

func NewSize4K

func NewSize4K(size uint32) Size4K

NewSize4K returns the given size as multiple of 4K

func (Size4K) InBytes

func (s Size4K) InBytes() uint32

InBytes returns the size in bytes.

func (Size4K) PrettyString

func (v Size4K) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string

PrettyString returns the bits of the flags in an easy-to-read format.

func (Size4K) ReadFrom

func (v Size4K) ReadFrom(r io.Reader) (int64, error)

ReadFrom reads the Size4K from 'r' in binary format.

func (Size4K) TotalSize

func (v Size4K) TotalSize() uint64

TotalSize returns the total size measured through binary.Size.

func (Size4K) WriteTo

func (v Size4K) WriteTo(w io.Writer) (int64, error)

WriteTo writes the Size4K into 'w' in binary format.

type StructInfo

type StructInfo = bg.StructInfo

StructInfo is the common header of any element.

Jump to

Keyboard shortcuts

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