Documentation ¶
Index ¶
- Constants
- func EntrySACMParseSize(b []byte) (uint32, error)
- func EntrySACMParseSizeFrom(r io.ReadSeeker, offset uint64) (uint32, error)
- func GetHeadersTableRange(firmware []byte) (startIdx, endIdx uint64, err error)
- func GetPointerCoordinates(firmware []byte) (startIdx, endIdx uint64)
- type ACChipsetID
- type ACFlags
- type ACModuleHeaderVersion
- type ACModuleSubType
- type ACModuleType
- type ACModuleVendor
- type Address64
- type BCDDate
- type CodeControl
- type EntriesByType
- type Entry
- type EntryBIOSPolicyRecord
- type EntryBIOSStartupModuleEntry
- type EntryBase
- type EntryBootPolicyManifestRecord
- type EntryCSESecureBoot
- type EntryDiagnosticACM
- type EntryFITHeaderEntry
- type EntryFeaturePolicyDeliveryRecord
- type EntryHeaders
- func (hdr *EntryHeaders) DataSize() uint32
- func (hdr EntryHeaders) GetEntry(firmware []byte) Entry
- func (hdr EntryHeaders) GetEntryFrom(firmware io.ReadSeeker, firmwareLength uint64) Entry
- func (hdr *EntryHeaders) GoString() string
- func (hdr *EntryHeaders) IsChecksumValid() bool
- func (hdr *EntryHeaders) String() string
- func (hdr *EntryHeaders) Type() EntryType
- type EntryJMPDebugPolicy
- type EntryKeyManifestRecord
- type EntryMicrocodeUpdateEntry
- type EntryPoint
- type EntrySACM
- type EntrySACMData
- type EntrySACMData0
- type EntrySACMData3
- type EntrySACMDataCommon
- func (entryData EntrySACMDataCommon) DateBinaryOffset() uint
- func (entryData *EntrySACMDataCommon) GetChipsetID() ACChipsetID
- func (entryData *EntrySACMDataCommon) GetCodeControl() CodeControl
- func (entryData *EntrySACMDataCommon) GetDate() BCDDate
- func (entryData *EntrySACMDataCommon) GetEntryPoint() EntryPoint
- func (entryData *EntrySACMDataCommon) GetErrorEntryPoint() ErrorEntryPoint
- func (entryData *EntrySACMDataCommon) GetFlags() ACFlags
- func (entryData *EntrySACMDataCommon) GetGDTBasePtr() GDTBasePtr
- func (entryData *EntrySACMDataCommon) GetGDTLimit() GDTLimit
- func (entryData *EntrySACMDataCommon) GetHeaderLen() SizeM4
- func (entryData *EntrySACMDataCommon) GetHeaderVersion() ACModuleHeaderVersion
- func (entryData *EntrySACMDataCommon) GetKeySize() SizeM4
- func (entryData *EntrySACMDataCommon) GetModuleSubType() ACModuleSubType
- func (entryData *EntrySACMDataCommon) GetModuleType() ACModuleType
- func (entryData *EntrySACMDataCommon) GetModuleVendor() ACModuleVendor
- func (entryData *EntrySACMDataCommon) GetRSAPubExp() uint32
- func (entryData *EntrySACMDataCommon) GetRSAPubKey() rsa.PublicKey
- func (entryData *EntrySACMDataCommon) GetRSASig() []byte
- func (entryData *EntrySACMDataCommon) GetReserved2() [64]byte
- func (entryData *EntrySACMDataCommon) GetSESVN() SESVN
- func (entryData *EntrySACMDataCommon) GetScratch() []byte
- func (entryData *EntrySACMDataCommon) GetScratchSize() SizeM4
- func (entryData *EntrySACMDataCommon) GetSegSel() SegSel
- func (entryData *EntrySACMDataCommon) GetSize() SizeM4
- func (entryData *EntrySACMDataCommon) GetTXTSVN() TXTSVN
- func (entryData EntrySACMDataCommon) HeaderVersionBinaryOffset() uint
- func (entryData EntrySACMDataCommon) KeySizeBinaryOffset() uint
- func (entryData *EntrySACMDataCommon) RSASigBinaryOffset() uint64
- func (entryData EntrySACMDataCommon) SizeBinaryOffset() uint
- func (entryData *EntrySACMDataCommon) TXTSVNBinaryOffset() uint64
- type EntrySACMDataInterface
- type EntrySkip
- type EntryTPMPolicyRecord
- type EntryTXTPolicyRecord
- type EntryTXTPolicyRecordDataFlatPointer
- type EntryTXTPolicyRecordDataIndexedIO
- type EntryTXTPolicyRecordDataInterface
- type EntryType
- type EntryUnknown
- type EntryVersion
- type ErrACMInvalidKeySize
- type ErrExpectedFITHeadersMagic
- type ErrInvalidTXTPolicyRecordVersion
- type ErrNotFound
- type ErrUnknownACMHeaderVersion
- type ErrorEntryPoint
- type Firmware
- type GDTBasePtr
- type GDTLimit
- type SESVN
- type SegSel
- type SizeM16
- type SizeM4
- type TXTSVN
- type Table
- func (table Table) First(entryType EntryType) *EntryHeaders
- func (table Table) GetEntries(firmware []byte) (result []Entry)
- func (table Table) ParseBootPolicyManifest(firmware []byte) (*bootpolicy.Manifest, error)
- func (table Table) ParseKeyManifest(firmware []byte) (*key.Manifest, error)
- func (table Table) String() string
- type TypeAndIsChecksumValid
- type Uint24
Constants ¶
const ( // ACHeaderVersion0 is version "0.0 – for SINIT ACM before 2017" ACHeaderVersion0 = ACModuleHeaderVersion(0x0000) // ACHeaderVersion3 is version "3.0 – for SINIT ACM of converge of BtG and TXT" ACHeaderVersion3 = ACModuleHeaderVersion(0x0300) )
const ( EntryTypeFITHeaderEntry = EntryType(0x00) EntryTypeMicrocodeUpdateEntry = EntryType(0x01) EntryTypeStartupACModuleEntry = EntryType(0x02) EntryTypeDiagnosticACModuleEntry = EntryType(0x03) EntryTypeBIOSStartupModuleEntry = EntryType(0x07) EntryTypeTPMPolicyRecord = EntryType(0x08) EntryTypeBIOSPolicyRecord = EntryType(0x09) EntryTypeTXTPolicyRecord = EntryType(0x0A) EntryTypeKeyManifestRecord = EntryType(0x0B) EntryTypeBootPolicyManifest = EntryType(0x0C) EntryTypeCSESecureBoot = EntryType(0x10) EntryTypeFeaturePolicyDeliveryRecord = EntryType(0x2D) EntryTypeJMPDebugPolicy = EntryType(0x2F) EntryTypeSkip = EntryType(0x7F) )
noinspection GoSnakeCaseUsage
Variables ¶
This section is empty.
Functions ¶
func EntrySACMParseSize ¶
EntrySACMParseSize parses SACM structure size
func EntrySACMParseSizeFrom ¶
func EntrySACMParseSizeFrom(r io.ReadSeeker, offset uint64) (uint32, error)
EntrySACMParseSizeFrom parses SACM structure size
func GetHeadersTableRange ¶
GetHeadersTableRange returns the starting and ending indexes of the FIT headers table within the firmware image.
func GetPointerCoordinates ¶
GetPointerCoordinates returns the position of the FIT pointer within the firmware.
Types ¶
type ACModuleHeaderVersion ¶
type ACModuleHeaderVersion uint32
ACModuleHeaderVersion defines module format version: * 0.0 – for SINIT ACM before 2017 * 3.0 – for SINIT ACM of converge of BtG and TXT
type ACModuleSubType ¶
type ACModuleSubType uint16
ACModuleSubType defines the subtype of AC module (0 - TXT ACM; 1 - S-ACM)
type ACModuleVendor ¶
type ACModuleVendor uint32
ACModuleVendor defines the module vendor identifier
type Address64 ¶
type Address64 uint64
Address64 is a 64bit address type
type EntriesByType ¶
type EntriesByType []Entry
EntriesByType is a helper to sort a slice of `Entry`-ies by their type/class.
func (EntriesByType) Len ¶
func (entries EntriesByType) Len() int
func (EntriesByType) Less ¶
func (entries EntriesByType) Less(i, j int) bool
func (EntriesByType) Swap ¶
func (entries EntriesByType) Swap(i, j int)
type Entry ¶
type Entry interface { fmt.GoStringer // GetType returns the type of the FIT entry GetType() EntryType // GetHeaders returns the FIT entry headers. // // See "Table 1-1" in "1.2 Firmware Interface Table" in "Firmware Interface Table" specification: // * https://www.intel.com/content/dam/www/public/us/en/documents/guides/fit-bios-specification.pdf GetHeaders() *EntryHeaders // GetDataOffset returns the offset of the data of the entry // relatively to the beginning of the firmware image. GetDataOffset() uint64 // GetDataBytes returns the data of the entry. GetDataBytes() []byte // GetHeadersErrors returns the errors were received while processing // the headers of the entry. GetHeadersErrors() []error }
Entry is the interface common to any FIT entry
func GetEntries ¶
GetEntries returns parsed FIT-entries
type EntryBIOSPolicyRecord ¶
type EntryBIOSPolicyRecord struct{ EntryBase }
EntryBIOSPolicyRecord represents a FIT entry of type "BIOS Policy Record" (0x09)
type EntryBIOSStartupModuleEntry ¶
type EntryBIOSStartupModuleEntry struct{ EntryBase }
EntryBIOSStartupModuleEntry represents a FIT entry of type "BIOS Startup Module Entry" (0x07)
type EntryBase ¶
type EntryBase struct { Headers *EntryHeaders DataOffset *uint64 `json:",omitempty"` DataBytes []byte `json:",omitempty"` HeadersErrors []error `json:",omitempty"` }
EntryBase is the common information for any FIT entry
func (*EntryBase) GetDataBytes ¶
GetDataBytes returns the data of the entry.
func (*EntryBase) GetDataOffset ¶
GetDataOffset returns the offset of the data of the entry relatively to the beginning of the firmware image.
func (*EntryBase) GetHeaders ¶
func (entry *EntryBase) GetHeaders() *EntryHeaders
GetHeaders returns the FIT entry headers.
See "Table 1-1" in "1.2 Firmware Interface Table" in "Firmware Interface Table" specification:
func (*EntryBase) GetHeadersErrors ¶
GetHeadersErrors returns the errors were received while processing the headers of the entry.
type EntryBootPolicyManifestRecord ¶
type EntryBootPolicyManifestRecord struct{ EntryBase }
EntryBootPolicyManifestRecord represents a FIT entry of type "Boot Policy Manifest" (0x0C)
func (*EntryBootPolicyManifestRecord) ParseData ¶
func (entry *EntryBootPolicyManifestRecord) ParseData() (*bootpolicy.Manifest, error)
ParseData creates EntryKeyManifestRecord from EntryKeyManifest
type EntryCSESecureBoot ¶
type EntryCSESecureBoot struct{ EntryBase }
EntryCSESecureBoot represents a FIT entry of type "CSE Secure Boot" (0x10)
type EntryDiagnosticACM ¶
type EntryDiagnosticACM struct{ EntryBase }
EntryDiagnosticACM represents a FIT entry of type "Diagnostic ACM" (0x03)
type EntryFITHeaderEntry ¶
type EntryFITHeaderEntry struct{ EntryBase }
EntryFITHeaderEntry represents a FIT entry of type "FIT Header Entry" (0x00)
type EntryFeaturePolicyDeliveryRecord ¶
type EntryFeaturePolicyDeliveryRecord struct{ EntryBase }
EntryFeaturePolicyDeliveryRecord represents a FIT entry of type "Feature Policy Delivery Record" (0x2D)
type EntryHeaders ¶
type EntryHeaders struct { // Address is the base address of the firmware component. // Must be aligned on 16 byte boundary. Address Address64 Size Uint24 `json:"Size"` // Reserved should always be equal to zero. Reserved uint8 `json:",omitempty"` Version EntryVersion TypeAndIsChecksumValid TypeAndIsChecksumValid Checksum uint8 `json:",omitempty"` }
EntryHeaders implements a "FIT Entry Format".
See "Table 1-1" in "1.2 Firmware Interface Table" in "Firmware Interface Table" specification:
Descriptions of the fields are adapted descriptions from the document by the link above.
func ParseEntryHeadersFrom ¶
func ParseEntryHeadersFrom(r io.Reader) (*EntryHeaders, error)
ParseEntryHeadersFrom parses a single entry headers entry.
func (*EntryHeaders) DataSize ¶
func (hdr *EntryHeaders) DataSize() uint32
DataSize returns the size of the data referenced by the FIT entry.
Panics if the entry type does not allow to know the size without parsing the data itself.
func (EntryHeaders) GetEntry ¶
func (hdr EntryHeaders) GetEntry(firmware []byte) Entry
GetEntry returns a full entry (headers + data)
func (EntryHeaders) GetEntryFrom ¶
func (hdr EntryHeaders) GetEntryFrom(firmware io.ReadSeeker, firmwareLength uint64) Entry
GetEntryFrom returns a full entry (headers + data)
func (*EntryHeaders) GoString ¶
func (hdr *EntryHeaders) GoString() string
GoString implements fmt.GoStringer.
func (*EntryHeaders) IsChecksumValid ¶
func (hdr *EntryHeaders) IsChecksumValid() bool
IsChecksumValid returns if bit "C_V" has value "1".
func (*EntryHeaders) String ¶
func (hdr *EntryHeaders) String() string
func (*EntryHeaders) Type ¶
func (hdr *EntryHeaders) Type() EntryType
Type returns the type of the FIT entry
type EntryJMPDebugPolicy ¶
type EntryJMPDebugPolicy struct{ EntryBase }
EntryJMPDebugPolicy represents a FIT entry of type "JMP $ Debug Policy" (0x2F)
type EntryKeyManifestRecord ¶
type EntryKeyManifestRecord struct{ EntryBase }
EntryKeyManifestRecord represents a FIT entry of type "Key Manifest Record" (0x0B)
type EntryMicrocodeUpdateEntry ¶
type EntryMicrocodeUpdateEntry struct{ EntryBase }
EntryMicrocodeUpdateEntry represents a FIT entry of type "Microcode Update Entry" (0x01)
type EntryPoint ¶
type EntryPoint uint32
EntryPoint is the authenticated code entry point offset (bytes)
type EntrySACM ¶
type EntrySACM struct{ EntryBase }
EntrySACM represents a FIT entry of type "Startup AC Module Entry" (0x02)
func (*EntrySACM) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*EntrySACM) ParseData ¶
func (entry *EntrySACM) ParseData() (*EntrySACMData, error)
ParseData parses SACM entry and returns EntrySACMData.
func (*EntrySACM) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaller
type EntrySACMData ¶
type EntrySACMData struct { EntrySACMDataInterface UserArea []byte }
EntrySACMData combines the structure for ACM and the user area.
func (*EntrySACMData) GetCommon ¶
func (entryData *EntrySACMData) GetCommon() *EntrySACMDataCommon
GetCommon returns the common part of the structures for different ACM versions.
type EntrySACMData0 ¶
type EntrySACMData0 struct { EntrySACMDataCommon RSAPubKey [256]byte RSAPubExp [4]byte RSASig [256]byte Scratch [572]byte }
EntrySACMData0 is the structure for ACM of version 0.0.
func (*EntrySACMData0) GetRSAPubExp ¶
func (entryData *EntrySACMData0) GetRSAPubExp() uint32
GetRSAPubExp returns the RSA exponent
func (*EntrySACMData0) GetRSAPubKey ¶
func (entryData *EntrySACMData0) GetRSAPubKey() rsa.PublicKey
GetRSAPubKey returns the RSA public key
func (*EntrySACMData0) GetRSASig ¶
func (entryData *EntrySACMData0) GetRSASig() []byte
GetRSASig returns the RSA signature.
func (*EntrySACMData0) GetScratch ¶
func (entryData *EntrySACMData0) GetScratch() []byte
GetScratch returns the Scratch field value
func (*EntrySACMData0) RSASigBinaryOffset ¶
func (entryData *EntrySACMData0) RSASigBinaryOffset() uint64
RSASigBinaryOffset returns the RSA signature offset
type EntrySACMData3 ¶
type EntrySACMData3 struct { EntrySACMDataCommon RSAPubKey [384]byte RSASig [384]byte Scratch [832]byte }
EntrySACMData3 is the structure for ACM of version 3.0
func (*EntrySACMData3) GetRSAPubKey ¶
func (entryData *EntrySACMData3) GetRSAPubKey() rsa.PublicKey
GetRSAPubKey returns the RSA public key
func (*EntrySACMData3) GetRSASig ¶
func (entryData *EntrySACMData3) GetRSASig() []byte
GetRSASig returns the RSA signature.
func (*EntrySACMData3) GetScratch ¶
func (entryData *EntrySACMData3) GetScratch() []byte
GetScratch returns the Scratch field value
func (*EntrySACMData3) RSASigBinaryOffset ¶
func (entryData *EntrySACMData3) RSASigBinaryOffset() uint64
RSASigBinaryOffset returns the RSA signature offset
type EntrySACMDataCommon ¶
type EntrySACMDataCommon struct { ModuleType ACModuleType ModuleSubType ACModuleSubType HeaderLen SizeM4 HeaderVersion ACModuleHeaderVersion ChipsetID ACChipsetID Flags ACFlags ModuleVendor ACModuleVendor Date BCDDate Size SizeM4 TXTSVN TXTSVN SESVN SESVN CodeControl CodeControl ErrorEntryPoint ErrorEntryPoint GDTLimit GDTLimit GDTBasePtr GDTBasePtr SegSel SegSel EntryPoint EntryPoint Reserved2 [64]byte KeySize SizeM4 ScratchSize SizeM4 }
EntrySACMDataCommon is the common part from the beginning of a startup AC module entry of any version.
func (EntrySACMDataCommon) DateBinaryOffset ¶
func (entryData EntrySACMDataCommon) DateBinaryOffset() uint
DateBinaryOffset returns the offset of the field 'Date' relatively to the beginning of the structure in the binary format (see 'encoding/binary').
func (*EntrySACMDataCommon) GetChipsetID ¶
func (entryData *EntrySACMDataCommon) GetChipsetID() ACChipsetID
GetChipsetID returns ChipsetID field value
func (*EntrySACMDataCommon) GetCodeControl ¶
func (entryData *EntrySACMDataCommon) GetCodeControl() CodeControl
GetCodeControl returns the authenticated code control flags
func (*EntrySACMDataCommon) GetDate ¶
func (entryData *EntrySACMDataCommon) GetDate() BCDDate
GetDate returns Date field value ("year.month.day")
func (*EntrySACMDataCommon) GetEntryPoint ¶
func (entryData *EntrySACMDataCommon) GetEntryPoint() EntryPoint
GetEntryPoint returns the authenticated code entry point offset (bytes)
func (*EntrySACMDataCommon) GetErrorEntryPoint ¶
func (entryData *EntrySACMDataCommon) GetErrorEntryPoint() ErrorEntryPoint
GetErrorEntryPoint returns error entry point field value
func (*EntrySACMDataCommon) GetFlags ¶
func (entryData *EntrySACMDataCommon) GetFlags() ACFlags
GetFlags returns Flags field value (the module-specific flags)
func (*EntrySACMDataCommon) GetGDTBasePtr ¶
func (entryData *EntrySACMDataCommon) GetGDTBasePtr() GDTBasePtr
GetGDTBasePtr returns the GDT base pointer offset (bytes)
func (*EntrySACMDataCommon) GetGDTLimit ¶
func (entryData *EntrySACMDataCommon) GetGDTLimit() GDTLimit
GetGDTLimit returns GDTLimit field value
func (*EntrySACMDataCommon) GetHeaderLen ¶
func (entryData *EntrySACMDataCommon) GetHeaderLen() SizeM4
GetHeaderLen returns HeaderLen field value
func (*EntrySACMDataCommon) GetHeaderVersion ¶
func (entryData *EntrySACMDataCommon) GetHeaderVersion() ACModuleHeaderVersion
GetHeaderVersion returns module format version: * 0.0 – for SINIT ACM before 2017 * 3.0 – for SINIT ACM of converge of BtG and TXT
func (*EntrySACMDataCommon) GetKeySize ¶
func (entryData *EntrySACMDataCommon) GetKeySize() SizeM4
GetKeySize returns the KeySize field value (the size in multiples of four bytes)
func (*EntrySACMDataCommon) GetModuleSubType ¶
func (entryData *EntrySACMDataCommon) GetModuleSubType() ACModuleSubType
GetModuleSubType returns the subtype of AC module (0 - TXT ACM; 1 - S-ACM)
func (*EntrySACMDataCommon) GetModuleType ¶
func (entryData *EntrySACMDataCommon) GetModuleType() ACModuleType
GetModuleType returns the type of AC module
func (*EntrySACMDataCommon) GetModuleVendor ¶
func (entryData *EntrySACMDataCommon) GetModuleVendor() ACModuleVendor
GetModuleVendor returns ModuleVendor field value
func (*EntrySACMDataCommon) GetRSAPubExp ¶
func (entryData *EntrySACMDataCommon) GetRSAPubExp() uint32
GetRSAPubExp returns the RSA exponent
func (*EntrySACMDataCommon) GetRSAPubKey ¶
func (entryData *EntrySACMDataCommon) GetRSAPubKey() rsa.PublicKey
GetRSAPubKey returns the RSA public key
func (*EntrySACMDataCommon) GetRSASig ¶
func (entryData *EntrySACMDataCommon) GetRSASig() []byte
GetRSASig returns the RSA signature.
func (*EntrySACMDataCommon) GetReserved2 ¶
func (entryData *EntrySACMDataCommon) GetReserved2() [64]byte
GetReserved2 returns the Reserved2 field value
func (*EntrySACMDataCommon) GetSESVN ¶
func (entryData *EntrySACMDataCommon) GetSESVN() SESVN
GetSESVN returns Software Guard Extensions (Secure Enclaves) Security Version Number
func (*EntrySACMDataCommon) GetScratch ¶
func (entryData *EntrySACMDataCommon) GetScratch() []byte
GetScratch returns the Scratch field value
func (*EntrySACMDataCommon) GetScratchSize ¶
func (entryData *EntrySACMDataCommon) GetScratchSize() SizeM4
GetScratchSize returns the ScratchSize field value (the size in multiples of four bytes)
func (*EntrySACMDataCommon) GetSegSel ¶
func (entryData *EntrySACMDataCommon) GetSegSel() SegSel
GetSegSel the segment selector initializer
func (*EntrySACMDataCommon) GetSize ¶
func (entryData *EntrySACMDataCommon) GetSize() SizeM4
GetSize returns Size field value (the size in multiples of four bytes)
func (*EntrySACMDataCommon) GetTXTSVN ¶
func (entryData *EntrySACMDataCommon) GetTXTSVN() TXTSVN
GetTXTSVN returns TXT security version number
func (EntrySACMDataCommon) HeaderVersionBinaryOffset ¶
func (entryData EntrySACMDataCommon) HeaderVersionBinaryOffset() uint
HeaderVersionBinaryOffset returns the offset of the field 'HeaderVersion' relatively to the beginning of the structure in the binary format (see 'encoding/binary').
func (EntrySACMDataCommon) KeySizeBinaryOffset ¶
func (entryData EntrySACMDataCommon) KeySizeBinaryOffset() uint
KeySizeBinaryOffset returns the offset of the field 'KeySize' relatively to the beginning of the structure in the binary format (see 'encoding/binary').
func (*EntrySACMDataCommon) RSASigBinaryOffset ¶
func (entryData *EntrySACMDataCommon) RSASigBinaryOffset() uint64
RSASigBinaryOffset returns the RSA signature offset
func (EntrySACMDataCommon) SizeBinaryOffset ¶
func (entryData EntrySACMDataCommon) SizeBinaryOffset() uint
SizeBinaryOffset returns the offset of the field 'Size' relatively to the beginning of the structure in the binary format (see 'encoding/binary').
func (*EntrySACMDataCommon) TXTSVNBinaryOffset ¶
func (entryData *EntrySACMDataCommon) TXTSVNBinaryOffset() uint64
TXTSVNBinaryOffset returns the offset of the field 'TXTSVN' relatively to the beginning of the structure in the binary format (see 'encoding/binary').
type EntrySACMDataInterface ¶
type EntrySACMDataInterface interface { GetModuleType() ACModuleType GetModuleSubType() ACModuleSubType GetHeaderLen() SizeM4 GetHeaderVersion() ACModuleHeaderVersion GetChipsetID() ACChipsetID GetFlags() ACFlags GetModuleVendor() ACModuleVendor GetDate() BCDDate GetSize() SizeM4 GetTXTSVN() TXTSVN GetSESVN() SESVN GetCodeControl() CodeControl GetErrorEntryPoint() ErrorEntryPoint GetGDTLimit() GDTLimit GetGDTBasePtr() GDTBasePtr GetSegSel() SegSel GetEntryPoint() EntryPoint GetReserved2() [64]byte GetKeySize() SizeM4 GetScratchSize() SizeM4 GetRSAPubKey() rsa.PublicKey GetRSAPubExp() uint32 GetRSASig() []byte GetScratch() []byte // Auxiliary methods: RSASigBinaryOffset() uint64 // DateBinaryOffset returns the offset of the field 'Date' // relatively to the beginning of the structure in the binary // format (see 'encoding/binary'). DateBinaryOffset() uint }
EntrySACMDataInterface is the interface of a startup AC module data (of any version)
type EntrySkip ¶
type EntrySkip struct{ EntryBase }
EntrySkip represents a FIT entry of type "Unused Entry (skip)" (0x7F)
type EntryTPMPolicyRecord ¶
type EntryTPMPolicyRecord struct{ EntryBase }
EntryTPMPolicyRecord represents a FIT entry of type "TPM Policy Record" (0x08)
type EntryTXTPolicyRecord ¶
type EntryTXTPolicyRecord struct{ EntryBase }
EntryTXTPolicyRecord represents a FIT entry of type "TXT Policy Record" (0x0A)
func (*EntryTXTPolicyRecord) Parse ¶
func (entry *EntryTXTPolicyRecord) Parse() (EntryTXTPolicyRecordDataInterface, error)
Parse parses TXT Policy Record entry
type EntryTXTPolicyRecordDataFlatPointer ¶
type EntryTXTPolicyRecordDataFlatPointer uint64
EntryTXTPolicyRecordDataFlatPointer is a parsed TXT Policy Record entry of version 0
func (EntryTXTPolicyRecordDataFlatPointer) IsTXTEnabled ¶
func (entryData EntryTXTPolicyRecordDataFlatPointer) IsTXTEnabled() bool
IsTXTEnabled returns true if TXT is enabled.
func (EntryTXTPolicyRecordDataFlatPointer) TPMPolicyPointer ¶
func (entryData EntryTXTPolicyRecordDataFlatPointer) TPMPolicyPointer() uint64
TPMPolicyPointer returns the TPM Policy pointer.
type EntryTXTPolicyRecordDataIndexedIO ¶
type EntryTXTPolicyRecordDataIndexedIO struct { IndexRegisterIOAddress uint16 DataRegisterIOAddress uint16 AccessWidth uint8 BitPosition uint8 Index uint16 }
EntryTXTPolicyRecordDataIndexedIO is a parsed TXT Policy Record entry of version 1.
func (*EntryTXTPolicyRecordDataIndexedIO) IsTXTEnabled ¶
func (entryData *EntryTXTPolicyRecordDataIndexedIO) IsTXTEnabled() bool
IsTXTEnabled returns true if TXT is enabled.
type EntryTXTPolicyRecordDataInterface ¶
type EntryTXTPolicyRecordDataInterface interface {
IsTXTEnabled() bool
}
EntryTXTPolicyRecordDataInterface is a parsed TXT Policy Record entry
type EntryType ¶
type EntryType uint8
EntryType is a 7 bit field containing the type code for the component registered in the FIT table.
type EntryUnknown ¶
type EntryUnknown struct{ EntryBase }
EntryUnknown represents an unknown FIT entry type.
type EntryVersion ¶
type EntryVersion uint16
EntryVersion contains the component's version number in binary coded decimal (BCD) format. For the FIT header entry, the value in this field will indicate the revision number of the FIT data structure. The upper byte of the revision field indicates the major revision and the lower byte indicates the minor revision. The format 0x1234 conveys the major number encoded in the first two digits and the minor number in the last two with a fixed point assumed in between
func (EntryVersion) Major ¶
func (ver EntryVersion) Major() uint8
Major returns the major part of the entry version
func (EntryVersion) MarshalJSON ¶
func (ver EntryVersion) MarshalJSON() ([]byte, error)
MarshalJSON just implements encoding/json.Marshaler
func (EntryVersion) Minor ¶
func (ver EntryVersion) Minor() uint8
Minor returns the minor part of the entry version
func (EntryVersion) String ¶
func (ver EntryVersion) String() string
func (*EntryVersion) UnmarshalJSON ¶
func (ver *EntryVersion) UnmarshalJSON(b []byte) error
UnmarshalJSON just implements encoding/json.Unmarshaler
type ErrACMInvalidKeySize ¶
ErrACMInvalidKeySize means ACM entry has invalid key size
func (*ErrACMInvalidKeySize) Error ¶
func (err *ErrACMInvalidKeySize) Error() string
type ErrExpectedFITHeadersMagic ¶
type ErrExpectedFITHeadersMagic struct {
Received []byte
}
ErrExpectedFITHeadersMagic means FIT magic string was not found where it was expected.
func (*ErrExpectedFITHeadersMagic) Error ¶
func (err *ErrExpectedFITHeadersMagic) Error() string
type ErrInvalidTXTPolicyRecordVersion ¶
type ErrInvalidTXTPolicyRecordVersion struct {
EntryVersion EntryVersion
}
ErrInvalidTXTPolicyRecordVersion means TXT Policy entry has invalid version.
func (*ErrInvalidTXTPolicyRecordVersion) Error ¶
func (err *ErrInvalidTXTPolicyRecordVersion) Error() string
type ErrNotFound ¶
type ErrNotFound struct{}
ErrNotFound literally means "not found".
func (ErrNotFound) Error ¶
func (ErrNotFound) Error() string
type ErrUnknownACMHeaderVersion ¶
type ErrUnknownACMHeaderVersion struct {
ACHeaderVersion ACModuleHeaderVersion
}
ErrUnknownACMHeaderVersion means ACM entry has invalid header version
func (*ErrUnknownACMHeaderVersion) Error ¶
func (err *ErrUnknownACMHeaderVersion) Error() string
type ErrorEntryPoint ¶
type ErrorEntryPoint uint32
ErrorEntryPoint is the error response entry point offset (bytes)
func (ErrorEntryPoint) Pointer ¶
func (ptr ErrorEntryPoint) Pointer() uint64
Pointer returns the value of ErrorEntryPoint as a pointer which could be used for pointer arithmetics.
type GDTBasePtr ¶
type GDTBasePtr uint32
GDTBasePtr is the GDT base pointer offset (bytes)
func (GDTBasePtr) Offset ¶
func (ptr GDTBasePtr) Offset() uint64
Offset returns the GDTBasePtr value as a pointer which could be used for pointer arithmetics.
type SESVN ¶
type SESVN uint16
SESVN is the Software Guard Extensions (Secure Enclaves) Security Version Number
type Table ¶
type Table []EntryHeaders
Table is the FIT entry headers table (located by the "FIT Pointer")
func (Table) First ¶
func (table Table) First(entryType EntryType) *EntryHeaders
First returns the first entry headers with selected entry type
func (Table) GetEntries ¶
GetEntries returns parsed FIT-entries
func (Table) ParseBootPolicyManifest ¶
func (table Table) ParseBootPolicyManifest(firmware []byte) (*bootpolicy.Manifest, error)
ParseBootPolicyManifest returns a boot policy manifest if it was able to parse one.
func (Table) ParseKeyManifest ¶
ParseKeyManifest returns a boot policy manifest if it was able to parse one.
type TypeAndIsChecksumValid ¶
type TypeAndIsChecksumValid uint8
TypeAndIsChecksumValid combines two fields:
- "C_V" -- Checksum Valid bit. This is a one bit field that indicates, whether component has a valid checksum. CPU must ignore "Checksum" field, if C_V bit is not set.
- EntryType (see "entry_type.go").
func (TypeAndIsChecksumValid) IsChecksumValid ¶
func (f TypeAndIsChecksumValid) IsChecksumValid() bool
IsChecksumValid returns bit "C_V" of the FIT entry.
A quote from the specification: Checksum Valid bit. This is a one bit field that indicates, whether component has a valid checksum. CPU must ignore CHKSUM field, if C_V bit is not set.
func (TypeAndIsChecksumValid) MarshalJSON ¶
func (f TypeAndIsChecksumValid) MarshalJSON() ([]byte, error)
MarshalJSON just implements encoding/json.Marshaler
func (TypeAndIsChecksumValid) String ¶
func (f TypeAndIsChecksumValid) String() string
func (TypeAndIsChecksumValid) Type ¶
func (f TypeAndIsChecksumValid) Type() EntryType
Type returns field EntryType ("TYPE" of the FIT entry in terms of the specification).
func (*TypeAndIsChecksumValid) UnmarshalJSON ¶
func (f *TypeAndIsChecksumValid) UnmarshalJSON(b []byte) error
UnmarshalJSON just implements encoding/json.Unmarshaler