Documentation ¶
Index ¶
- Constants
- func CalculateOffsetFromPhysAddr(physAddr uint64, imageSize uint64) uint64
- func CalculatePhysAddrFromOffset(offset uint64, imageSize uint64) uint64
- func CalculateTailOffsetFromPhysAddr(physAddr uint64) uint64
- func EntryDataSegmentCoordinates(entry Entry, firmware io.ReadSeeker) (uint64, uint64, error)
- func EntryDataSegmentSize(entry Entry, firmware io.ReadSeeker) (uint64, error)
- func EntryRecalculateHeaders(entry Entry) error
- func EntrySACMParseSize(b []byte) (uint32, error)
- func EntrySACMParseSizeFrom(r io.ReadSeeker, offset uint64) (uint32, error)
- func GetHeadersTableRangeFrom(firmware io.ReadSeeker) (startIdx, endIdx uint64, err error)
- func GetPointerCoordinates(firmwareSize uint64) (startIdx, endIdx int64)
- func RegisterEntryType(entryTypeID EntryType, entryGoType Entry)
- type ACChipsetID
- type ACFlags
- type ACModuleHeaderVersion
- type ACModuleSubType
- type ACModuleType
- type ACModuleVendor
- type Address64
- type BCDDate
- type CodeControl
- type Entries
- type EntriesByType
- type Entry
- type EntryBIOSPolicyRecord
- type EntryBIOSStartupModuleEntry
- type EntryBase
- type EntryBootPolicyManifestRecord
- func (entry *EntryBootPolicyManifestRecord) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
- func (entry *EntryBootPolicyManifestRecord) CustomRecalculateHeaders() error
- func (entry *EntryBootPolicyManifestRecord) ParseData() (*bgbootpolicy.Manifest, *cbntbootpolicy.Manifest, error)
- func (entry *EntryBootPolicyManifestRecord) Reader() *bytes.Reader
- type EntryCSESecureBoot
- type EntryCustomGetDataSegmentSizer
- type EntryCustomRecalculateHeaderser
- type EntryDiagnosticACM
- type EntryFITHeaderEntry
- type EntryFeaturePolicyDeliveryRecord
- type EntryHeaders
- func (hdr *EntryHeaders) CalculateChecksum() uint8
- func (hdr EntryHeaders) GetEntry(firmware []byte) Entry
- func (hdr EntryHeaders) GetEntryFrom(firmware io.ReadSeeker) Entry
- func (hdr *EntryHeaders) GoString() string
- func (hdr *EntryHeaders) IsChecksumValid() bool
- func (hdr EntryHeaders) MarshalJSON() ([]byte, error)
- func (hdr *EntryHeaders) String() string
- func (hdr *EntryHeaders) Type() EntryType
- func (hdr *EntryHeaders) UnmarshalJSON(b []byte) error
- func (hdr *EntryHeaders) Write(b []byte) (int, error)
- func (hdr *EntryHeaders) WriteTo(w io.Writer) (int64, error)
- type EntryJMPDebugPolicy
- type EntryKeyManifestRecord
- func (entry *EntryKeyManifestRecord) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
- func (entry *EntryKeyManifestRecord) CustomRecalculateHeaders() error
- func (entry *EntryKeyManifestRecord) ParseData() (*bgkey.Manifest, *cbntkey.Manifest, error)
- func (entry *EntryKeyManifestRecord) Reader() *bytes.Reader
- type EntryMicrocodeUpdateEntry
- type EntryPoint
- type EntrySACM
- func (entry *EntrySACM) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
- func (entry *EntrySACM) CustomRecalculateHeaders() error
- func (entry *EntrySACM) MarshalJSON() ([]byte, error)
- func (entry *EntrySACM) ParseData() (*EntrySACMData, error)
- func (entry *EntrySACM) UnmarshalJSON(b []byte) error
- type EntrySACMData
- func (entryData *EntrySACMData) GetCommon() *EntrySACMDataCommon
- func (entryData *EntrySACMData) Read(b []byte) (int, error)
- func (entryData *EntrySACMData) ReadFrom(r io.Reader) (int64, error)
- func (entryData *EntrySACMData) Write(b []byte) (int, error)
- func (entryData *EntrySACMData) WriteTo(w io.Writer) (int64, error)
- type EntrySACMData0
- func (entryData *EntrySACMData0) GetRSAPubExp() uint32
- func (entryData *EntrySACMData0) GetRSAPubKey() rsa.PublicKey
- func (entryData *EntrySACMData0) GetRSASig() []byte
- func (entryData *EntrySACMData0) GetScratch() []byte
- func (entryData *EntrySACMData0) RSASigBinaryOffset() uint64
- func (entryData *EntrySACMData0) Read(b []byte) (int, error)
- func (entryData *EntrySACMData0) ReadFrom(r io.Reader) (int64, error)
- func (entryData *EntrySACMData0) Write(b []byte) (int, error)
- func (entryData *EntrySACMData0) WriteTo(w io.Writer) (int64, error)
- type EntrySACMData3
- func (entryData *EntrySACMData3) GetRSAPubKey() rsa.PublicKey
- func (entryData *EntrySACMData3) GetRSASig() []byte
- func (entryData *EntrySACMData3) GetScratch() []byte
- func (entryData *EntrySACMData3) RSASigBinaryOffset() uint64
- func (entryData *EntrySACMData3) Read(b []byte) (int, error)
- func (entryData *EntrySACMData3) ReadFrom(r io.Reader) (int64, error)
- func (entryData *EntrySACMData3) Write(b []byte) (int, error)
- func (entryData *EntrySACMData3) WriteTo(w io.Writer) (int64, error)
- 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) Read(b []byte) (int, error)
- func (entryData *EntrySACMDataCommon) ReadFrom(r io.Reader) (int64, error)
- func (entryData EntrySACMDataCommon) SizeBinaryOffset() uint
- func (entryData *EntrySACMDataCommon) TXTSVNBinaryOffset() uint64
- func (entryData *EntrySACMDataCommon) Write(b []byte) (int, error)
- func (entryData *EntrySACMDataCommon) WriteTo(w io.Writer) (int64, error)
- 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 Entries)
- func (table Table) GetEntriesFrom(firmware io.ReadSeeker) (result Entries)
- func (table Table) ParseBootPolicyManifest(firmware []byte) (*bgbootpolicy.Manifest, *cbntbootpolicy.Manifest, error)
- func (table Table) ParseKeyManifest(firmware []byte) (*bgkey.Manifest, *cbntkey.Manifest, error)
- func (table Table) String() string
- func (table Table) Write(b []byte) (n int, err error)
- func (table Table) WriteTo(w io.Writer) (n int64, err error)
- func (table Table) WriteToFirmwareImage(w io.ReadWriteSeeker) (n int64, err error)
- type TypeAndIsChecksumValid
- func (f TypeAndIsChecksumValid) IsChecksumValid() bool
- func (f TypeAndIsChecksumValid) MarshalJSON() ([]byte, error)
- func (f *TypeAndIsChecksumValid) SetIsChecksumValid(newValue bool)
- func (f *TypeAndIsChecksumValid) SetType(newType EntryType)
- func (f TypeAndIsChecksumValid) String() string
- func (f TypeAndIsChecksumValid) Type() EntryType
- func (f *TypeAndIsChecksumValid) UnmarshalJSON(b []byte) error
- type Uint24
Constants ¶
const ( // ACHeaderVersion0 is version "0.0 – for SINIT ACM before 2017" ACHeaderVersion0 = ACModuleHeaderVersion(0x00000000) // ACHeaderVersion3 is version "3.0 – for SINIT ACM of converge of BtG and TXT" ACHeaderVersion3 = ACModuleHeaderVersion(0x00030000) )
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 CalculateOffsetFromPhysAddr ¶
CalculateOffsetFromPhysAddr calculates the offset within an image of the physical address (address to a region mapped from the SPI chip).
Examples:
CalculateOffsetFromPhysAddr(0xffffffff, 0x1000) == 0xfff CalculateOffsetFromPhysAddr(0xffffffc0, 0x1000) == 0xfc0
func CalculatePhysAddrFromOffset ¶
CalculatePhysAddrFromOffset calculates the physical address (address to a region mapped from the SPI chip) using an offset withtin an image, relatively to BasePhysAddr.
Examples:
CalculatePhysAddrFromOffset(0x01, 0x2000) == 0xffffe001 CalculatePhysAddrFromOffset(0x40, 0x2000) == 0xffffe040
func CalculateTailOffsetFromPhysAddr ¶
CalculateTailOffsetFromPhysAddr calculates the offset (towards down, relatively to BasePhysAddr) of the physical address (address to a region mapped from the SPI chip).
Examples:
CalculateTailOffsetFromPhysAddr(0xffffffff) == 0x01 CalculateTailOffsetFromPhysAddr(0xffffffc0) == 0x40
func EntryDataSegmentCoordinates ¶
EntryDataSegmentCoordinates returns the coordinates of the data segment coordinates associates with the entry.
func EntryDataSegmentSize ¶
func EntryDataSegmentSize(entry Entry, firmware io.ReadSeeker) (uint64, error)
EntryDataSegmentSize returns the coordinates of the data segment size associates with the entry.
func EntryRecalculateHeaders ¶
EntryRecalculateHeaders recalculates headers of the entry based on its data.
func EntrySACMParseSize ¶
EntrySACMParseSize parses SACM structure size
func EntrySACMParseSizeFrom ¶
func EntrySACMParseSizeFrom(r io.ReadSeeker, offset uint64) (uint32, error)
EntrySACMParseSizeFrom parses SACM structure size
func GetHeadersTableRangeFrom ¶
func GetHeadersTableRangeFrom(firmware io.ReadSeeker) (startIdx, endIdx uint64, err error)
GetHeadersTableRangeFrom 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.
func RegisterEntryType ¶
RegisterEntryType adds a new FIT entry type to the registry of known entry types.
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
func (ACModuleHeaderVersion) GoString ¶ added in v1.1.1
func (ver ACModuleHeaderVersion) GoString() string
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
func (Address64) Offset ¶
Offset returns an offset from the beginning of a firmware of a defined size.
type Entries ¶
type Entries []Entry
Entries are a slice of multiple parsed FIT entries (headers + data)
func GetEntries ¶
GetEntries returns parsed FIT-entries
func GetEntriesFrom ¶
func GetEntriesFrom(firmware io.ReadSeeker) (Entries, error)
GetEntriesFrom returns parsed FIT-entries
func (Entries) Inject ¶
Inject writes complete FIT (headers + data + pointer) to a firmware image.
What will happen: 1. The FIT headers will be written by offset headersOffset. 2. The FIT pointer will be written at consts.FITPointerOffset offset from the end of the image. 3. Data referenced by FIT headers will be written at offsets accordingly to Address fields (in the headers).
Consider calling Rehash() before Inject()/InjectTo()
func (Entries) InjectTo ¶
func (entries Entries) InjectTo(w io.WriteSeeker, headersOffset uint64) error
InjectTo does the same as Inject, but for io.WriteSeeker.
func (Entries) RecalculateHeaders ¶
RecalculateHeaders recalculates metadata to be consistent with data. For example, it fixes checksum, data size, entry type and so on.
Supposed to be used before Inject or/and InjectTo. Since it is possible to prepare data in entries, then call Rehash (to prepare headers consistent with data).
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 { // GetEntryBase returns EntryBase (which contains metadata of the Entry). GetEntryBase() *EntryBase }
Entry is the interface common to any FIT entry
func NewEntry ¶
func NewEntry(hdr *EntryHeaders, firmware io.ReadSeeker) Entry
NewEntry returns a new entry using headers and firmware image
type EntryBIOSPolicyRecord ¶
type EntryBIOSPolicyRecord struct{ EntryBase }
EntryBIOSPolicyRecord represents a FIT entry of type "BIOS Policy Record" (0x09)
func (*EntryBIOSPolicyRecord) CustomGetDataSegmentSize ¶
func (entry *EntryBIOSPolicyRecord) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
func (*EntryBIOSPolicyRecord) CustomRecalculateHeaders ¶
func (entry *EntryBIOSPolicyRecord) CustomRecalculateHeaders() error
CustomRecalculateHeaders recalculates metadata to be consistent with data. For example, it fixes checksum, data size, entry type and so on.
type EntryBIOSStartupModuleEntry ¶
type EntryBIOSStartupModuleEntry struct{ EntryBase }
EntryBIOSStartupModuleEntry represents a FIT entry of type "BIOS Startup Module Entry" (0x07)
type EntryBase ¶
type EntryBase struct { // Headers is 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 Headers EntryHeaders // DataSegmentBytes is the raw bytes of the special data segment referenced by the headers. // // Is not nil only if FIT entry really references to a data segment. If FIT entry // stores data directly in headers then DataSegmentBytes is nil. DataSegmentBytes []byte `json:",omitempty"` // HeadersErrors is the list of errors occurred while parsing and interpreting FIT entry headers. HeadersErrors []error `json:",omitempty"` }
EntryBase is the common information for any FIT entry
func (*EntryBase) GetEntryBase ¶
GetEntryBase returns EntryBase (which contains metadata of the Entry).
type EntryBootPolicyManifestRecord ¶
type EntryBootPolicyManifestRecord struct{ EntryBase }
EntryBootPolicyManifestRecord represents a FIT entry of type "Boot Policy Manifest" (0x0C)
func (*EntryBootPolicyManifestRecord) CustomGetDataSegmentSize ¶
func (entry *EntryBootPolicyManifestRecord) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
func (*EntryBootPolicyManifestRecord) CustomRecalculateHeaders ¶
func (entry *EntryBootPolicyManifestRecord) CustomRecalculateHeaders() error
CustomRecalculateHeaders recalculates metadata to be consistent with data. For example, it fixes checksum, data size, entry type and so on.
func (*EntryBootPolicyManifestRecord) ParseData ¶
func (entry *EntryBootPolicyManifestRecord) ParseData() (*bgbootpolicy.Manifest, *cbntbootpolicy.Manifest, error)
ParseData creates EntryBootPolicyManifestRecord from EntryBootPolicyManifest
func (*EntryBootPolicyManifestRecord) Reader ¶ added in v1.2.0
func (entry *EntryBootPolicyManifestRecord) Reader() *bytes.Reader
Reader creates io.ReadSeeker from EntryBootPolicyManifestRecord
type EntryCSESecureBoot ¶
type EntryCSESecureBoot struct{ EntryBase }
EntryCSESecureBoot represents a FIT entry of type "CSE Secure Boot" (0x10)
type EntryCustomGetDataSegmentSizer ¶
type EntryCustomGetDataSegmentSizer interface { // CustomGetDataSegmentSize returns the size of the data segment associates with the entry. CustomGetDataSegmentSize(firmwareImage io.ReadSeeker) (uint64, error) }
EntryCustomGetDataSegmentSizer is an extension of Entry which overrides the default procedure of calculating the data segment size.
type EntryCustomRecalculateHeaderser ¶
type EntryCustomRecalculateHeaderser interface { // CustomRecalculateHeaders recalculates metadata to be consistent with data. // For example, it fixes checksum, data size, entry type and so on. CustomRecalculateHeaders() error }
CustomRecalculateHeaderser is an extension of Entry which overrides the default procedure of recalculating EntryHeaders.
type EntryDiagnosticACM ¶
type EntryDiagnosticACM struct{ EntryBase }
EntryDiagnosticACM represents a FIT entry of type "Diagnostic ACM" (0x03)
func (*EntryDiagnosticACM) CustomGetDataSegmentSize ¶
func (entry *EntryDiagnosticACM) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
Init initializes the entry using EntryHeaders and firmware image.
func (*EntryDiagnosticACM) CustomRecalculateHeaders ¶
func (entry *EntryDiagnosticACM) CustomRecalculateHeaders() error
CustomRecalculateHeaders recalculates metadata to be consistent with data. For example, it fixes checksum, data size, entry type and so on.
type EntryFITHeaderEntry ¶
type EntryFITHeaderEntry struct{ EntryBase }
EntryFITHeaderEntry represents a FIT entry of type "FIT Header Entry" (0x00)
func (*EntryFITHeaderEntry) CustomGetDataSegmentSize ¶
func (entry *EntryFITHeaderEntry) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
func (*EntryFITHeaderEntry) CustomRecalculateHeaders ¶
func (entry *EntryFITHeaderEntry) CustomRecalculateHeaders() error
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 // Reserved should always be equal to zero. Reserved uint8 Version EntryVersion TypeAndIsChecksumValid TypeAndIsChecksumValid Checksum uint8 }
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) CalculateChecksum ¶
func (hdr *EntryHeaders) CalculateChecksum() uint8
CalculateChecksum calculates the checksum ("CHKSUM") according to point 4.0 of the FIT specification.
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) 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) MarshalJSON ¶
func (hdr EntryHeaders) MarshalJSON() ([]byte, error)
MarshalJSON just implements encoding/json.Marshaler
func (*EntryHeaders) String ¶
func (hdr *EntryHeaders) String() string
func (*EntryHeaders) Type ¶
func (hdr *EntryHeaders) Type() EntryType
Type returns the type of the FIT entry
func (*EntryHeaders) UnmarshalJSON ¶
func (hdr *EntryHeaders) UnmarshalJSON(b []byte) error
UnmarshalJSON just implements encoding/json.Unmarshaler
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)
func (*EntryKeyManifestRecord) CustomGetDataSegmentSize ¶
func (entry *EntryKeyManifestRecord) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
func (*EntryKeyManifestRecord) CustomRecalculateHeaders ¶
func (entry *EntryKeyManifestRecord) CustomRecalculateHeaders() error
CustomRecalculateHeaders recalculates metadata to be consistent with data. For example, it fixes checksum, data size, entry type and so on.
func (*EntryKeyManifestRecord) ParseData ¶
ParseData creates EntryKeyManifestRecord from EntryKeyManifest
func (*EntryKeyManifestRecord) Reader ¶ added in v1.2.0
func (entry *EntryKeyManifestRecord) Reader() *bytes.Reader
Reader creates io.ReadSeeker from EntryKeyManifestRecord
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) CustomGetDataSegmentSize ¶
func (entry *EntrySACM) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
func (*EntrySACM) CustomRecalculateHeaders ¶
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 ParseSACMData ¶ added in v1.1.0
func ParseSACMData(r io.Reader) (*EntrySACMData, error)
ParseSACMData parses SACM entry and returns EntrySACMData.
func (*EntrySACMData) GetCommon ¶
func (entryData *EntrySACMData) GetCommon() *EntrySACMDataCommon
GetCommon returns the common part of the structures for different ACM versions.
func (*EntrySACMData) Read ¶ added in v1.1.0
func (entryData *EntrySACMData) Read(b []byte) (int, error)
Read parses the ACM
func (*EntrySACMData) ReadFrom ¶ added in v1.1.0
func (entryData *EntrySACMData) ReadFrom(r io.Reader) (int64, error)
ReadFrom parses the ACM
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
func (*EntrySACMData0) Read ¶ added in v1.1.0
func (entryData *EntrySACMData0) Read(b []byte) (int, error)
Read parses the ACM v0 headers
func (*EntrySACMData0) ReadFrom ¶ added in v1.1.0
func (entryData *EntrySACMData0) ReadFrom(r io.Reader) (int64, error)
ReadFrom parses the ACM v0 headers
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
func (*EntrySACMData3) Read ¶ added in v1.1.0
func (entryData *EntrySACMData3) Read(b []byte) (int, error)
Read parses the ACM v3 headers
func (*EntrySACMData3) ReadFrom ¶ added in v1.1.0
func (entryData *EntrySACMData3) ReadFrom(r io.Reader) (int64, error)
ReadFrom parses the ACM v3 headers
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) Read ¶ added in v1.1.0
func (entryData *EntrySACMDataCommon) Read(b []byte) (int, error)
Read parses the ACM common headers
func (*EntrySACMDataCommon) ReadFrom ¶ added in v1.1.0
func (entryData *EntrySACMDataCommon) ReadFrom(r io.Reader) (int64, error)
ReadFrom parses the ACM common headers
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 { io.ReadWriter io.ReaderFrom io.WriterTo 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)
func (*EntryTPMPolicyRecord) CustomGetDataSegmentSize ¶
func (entry *EntryTPMPolicyRecord) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
Init initializes the entry using EntryHeaders and firmware image.
func (*EntryTPMPolicyRecord) CustomRecalculateHeaders ¶
func (entry *EntryTPMPolicyRecord) CustomRecalculateHeaders() error
CustomRecalculateHeaders recalculates metadata to be consistent with data. For example, it fixes checksum, data size, entry type and so on.
type EntryTXTPolicyRecord ¶
type EntryTXTPolicyRecord struct{ EntryBase }
EntryTXTPolicyRecord represents a FIT entry of type "TXT Policy Record" (0x0A)
func (*EntryTXTPolicyRecord) CustomGetDataSegmentSize ¶
func (entry *EntryTXTPolicyRecord) CustomGetDataSegmentSize(firmware io.ReadSeeker) (uint64, error)
Init initializes the entry using EntryHeaders and firmware image.
func (*EntryTXTPolicyRecord) CustomRecalculateHeaders ¶
func (entry *EntryTXTPolicyRecord) CustomRecalculateHeaders() error
CustomRecalculateHeaders recalculates metadata to be consistent with data. For example, it fixes checksum, data size, entry type and so on.
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.
func AllEntryTypes ¶
func AllEntryTypes() []EntryType
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"), without data this headers reference to.
func GetTableFrom ¶
func GetTableFrom(firmware io.ReadSeeker) (Table, error)
GetTableFrom returns the table of FIT entries of the firmware image.
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) GetEntriesFrom ¶
func (table Table) GetEntriesFrom(firmware io.ReadSeeker) (result Entries)
GetEntriesFrom returns parsed FIT-entries
func (Table) ParseBootPolicyManifest ¶
func (table Table) ParseBootPolicyManifest(firmware []byte) (*bgbootpolicy.Manifest, *cbntbootpolicy.Manifest, error)
ParseBootPolicyManifest returns a boot policy manifest if it was able to parse one.
func (Table) ParseKeyManifest ¶
ParseKeyManifest returns a key manifest if it was able to parse one.
func (Table) Write ¶
Write compiles FIT headers into a binary representation and writes to "b". If len(b) is less than required, then io.ErrUnexpectedEOF is returned.
func (Table) WriteToFirmwareImage ¶
func (table Table) WriteToFirmwareImage(w io.ReadWriteSeeker) (n int64, err error)
WriteToFirmwareImage finds the position of FIT in a firmware image and writes the table there.
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) SetIsChecksumValid ¶
func (f *TypeAndIsChecksumValid) SetIsChecksumValid(newValue bool)
SetIsChecksumValid sets the value of field IsChecksumValid ("C_V" of the FIT entry in terms of the specification).
func (*TypeAndIsChecksumValid) SetType ¶
func (f *TypeAndIsChecksumValid) SetType(newType EntryType)
SetType sets the value of field EntryType ("TYPE" of the FIT entry in terms of the specification).
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
type Uint24 ¶
type Uint24 struct {
Value [3]byte
}
Uint24 is a 24 bit unsigned little-endian integer value.
func (Uint24) MarshalJSON ¶
MarshalJSON just implements encoding/json.Marshaler
func (Uint24) Uint32 ¶
Uint32 returns the value as parsed uint32.
If the value is used in "Size" then in the most cases the value should be shifted with "<< 4" to get the real size value.
See also the code of EntryHeaders.getDataCoordinates()
func (*Uint24) UnmarshalJSON ¶
UnmarshalJSON just implements encoding/json.Unmarshaler
Source Files ¶
- calc_offset.go
- ent_bios_policy_record.go
- ent_bios_startup_module_entry.go
- ent_boot_policy_manifest.go
- ent_cse_secure_boot.go
- ent_diagnostic_acm.go
- ent_feature_policy_delivery_record.go
- ent_fit_header_entry.go
- ent_jmp_debug_policy.go
- ent_key_manifest_record.go
- ent_microcode_update_entry.go
- ent_skip.go
- ent_startup_ac_module_entry.go
- ent_tpm_policy_record.go
- ent_txt_policy_record.go
- ent_unknown.go
- entry.go
- entry_base.go
- entry_headers.go
- entry_type.go
- errors.go
- firmware.go
- get_entries.go
- table.go