Documentation ¶
Index ¶
- Constants
- func AddressRangesIsDMAProtected(first, end uint64) (bool, error)
- func AllowsVMXInSMX() (bool, error)
- func ArchitectureTXTSupport() (bool, error)
- func CPUSignature() uint32
- func GetFitPointer(data []byte) (uint64, error)
- func HasMTRR() bool
- func HasSMRR() (bool, error)
- func HasSMX() bool
- func HasVMX() bool
- func IA32FeatureControlIsLocked() (bool, error)
- func IA32PlatformID() (uint64, error)
- func IsReservedInE810(start uint64, end uint64) (bool, error)
- func LookupIOAddress(addr uint64, regs VTdRegisters) ([]uint64, error)
- func LookupSize(header []byte) (int64, error)
- func NVReadAll(conn io.ReadWriteCloser, index uint32) []byte
- func ParseACM(data []byte) (*ACM, *Chipsets, *Processors, *TPMs, error)
- func ProcessorBrandName() string
- func ReadPhys(addr int64, data UintN) error
- func ReadPhysBuf(addr int64, buf []byte) error
- func TXTLeavesAreEnabled() (bool, error)
- func VersionString() string
- func WritePhys(addr int64, data UintN) error
- type ACM
- type ACMInfo
- type ACMStatus
- type ChipsetID
- type Chipsets
- type DMAProtectedRange
- type FitEntry
- type FitEntryType
- type LCPHash
- type LCPList
- type LCPPolicy
- type LCPPolicyCustom
- type LCPPolicyData
- type LCPPolicyElement
- type LCPPolicyList
- type LCPPolicyList2
- type LCPPolicyMLE
- type LCPPolicyPCONF
- type LCPPolicySBIOS
- type LCPSignature
- type LCPUUID
- type ProcessorID
- type Processors
- type SMRR
- type TPMPCRInfoShort
- type TPMs
- type TXTBiosData
- type TXTBiosMLEFlags
- type TXTErrorCode
- type TXTRegisterSpace
- type TXTStatus
- type UUID
- type Uint16
- type Uint32
- type Uint64
- type Uint8
- type UintN
- type VTdRegisters
Constants ¶
View Source
const ( ACMChipsetTypeBios uint8 = 0x00 ACMChipsetTypeSinit uint8 = 0x01 ACMChipsetTypeBiosRevoc uint8 = 0x08 ACMChipsetTypeSinitRevoc uint8 = 0x09 ACMTypeChipset uint16 = 0x02 ACMSubTypeReset uint16 = 0x01 ACMVendorIntel uint32 = 0x8086 TPMExtPolicyIllegal uint8 = 0x00 TPMExtPolicyAlgAgile uint8 = 0x01 TPMExtPolicyEmbeddedAlgs uint8 = 0x10 TPMExtPolicyBoth uint8 = 0x11 TPMFamilyIllegal uint16 = 0x0000 TPMFamilyDTPM12 uint16 = 0x0001 TPMFamilyDTPM20 uint16 = 0x0010 TPMFamilyDTPMBoth uint16 = 0x0011 TPMFamilyPTT20 uint16 = 0x1000 ACMUUIDV3 string = "7fc03aaa-46a7-18db-ac2e-698f8d417f5a" ACMSizeOffset int64 = 24 TPMAlgoSHA1 uint16 = 0x0004 TPMAlgoSHA256 uint16 = 0x000b TPMAlgoSHA384 uint16 = 0x000c TPMAlgoSHA512 uint16 = 0x000d TPMAlgoNULL uint16 = 0x0010 TPMAlgoSM3_256 uint16 = 0x0012 TPMAlgoRSASSA uint16 = 0x0014 TPMAlgoECDSA uint16 = 0x0018 TPMAlgoSM2 uint16 = 0x001B )
View Source
const ( LCPMaxLists uint = 8 SHA1DigestSize uint = 20 SHA256DigestSize uint = 32 SHA384DigestSize uint = 48 SHA512DigestSize uint = 64 SM3DigestSize uint = 32 LCPDataFileSignature string = "Intel(R) TXT LCP_POLICY_DATA\x00\x00\x00\x00" LCPSignatureAlgNone uint8 = 0 LCPSignatureAlgRSAPKCS15 uint8 = 1 LCPPolicyElementMLE uint32 = 0 LCPPolicyElementPCONF uint32 = 1 LCPPolicyElementSBIOS uint32 = 2 LCPPolicyElementCustom uint32 = 3 LCPPolicyElementMLE2 uint32 = 0x10 LCPPolicyElementPCONF2 uint32 = 0x11 LCPPolicyElementSBIOS2 uint32 = 0x12 LCPPolicyElementSTM2 uint32 = 0x14 LCPPolHAlgSHA1 uint8 = 0 )
View Source
const (
FourGiB uint64 = 0x100000000
)
Variables ¶
This section is empty.
Functions ¶
func AllowsVMXInSMX ¶
func CPUSignature ¶
func CPUSignature() uint32
func GetFitPointer ¶
getFitPointer returns the ROM-Address of FitPointer
func IA32PlatformID ¶
func IsReservedInE810 ¶
Reads the e820 table exported via /sys/firmware/memmap and checks whether the range [start; end] is marked as reserved. Returns true if it is reserved, false if not.
func LookupIOAddress ¶
func LookupIOAddress(addr uint64, regs VTdRegisters) ([]uint64, error)
func LookupSize ¶
func ProcessorBrandName ¶
func ProcessorBrandName() string
func ReadPhys ¶
Read reads data from physical memory at address addr. On x86 platforms, this uses the seek+read syscalls. On arm platforms, this uses mmap.
func ReadPhysBuf ¶
func TXTLeavesAreEnabled ¶
func VersionString ¶
func VersionString() string
Types ¶
type ACM ¶
type ACM struct { ModuleType uint16 ModuleSubType uint16 HeaderLen uint32 HeaderVersion uint32 ChipsetID uint16 Flags uint16 ModuleVendor uint32 Date uint32 Size uint32 TxtSVN uint16 SeSVN uint16 CodeControl uint32 ErrorEntryPoint uint32 GDTLimit uint32 GDTBase uint32 SegSel uint32 EntryPoint uint32 Reserved2 [64]uint8 KeySize uint32 ScratchSize uint32 PubKey [256]uint8 PubExp uint32 Signatur [256]uint8 Scratch [143]uint32 Info ACMInfo }
func (*ACM) PrettyPrint ¶
func (a *ACM) PrettyPrint()
type ACMStatus ¶
type ACMStatus struct { Valid bool MinorErrorCode uint16 ACMStarted bool MajorErrorCode uint8 ClassCode uint8 ModuleType uint8 }
func ReadACMStatus ¶
type Chipsets ¶
func (*Chipsets) PrettyPrint ¶
func (c *Chipsets) PrettyPrint()
type DMAProtectedRange ¶
type FitEntry ¶
type FitEntry struct { Address uint64 OrigSize [3]uint8 Version uint16 CVType uint8 CheckSum uint8 // contains filtered or unexported fields }
FitEntry defines the structure of FitEntries in the Firmware Interface Table
func ExtractFit ¶
ExtractFit Gets the bios file blob and extracts the FIT-Part
func GetFitHeader ¶
func (*FitEntry) CheckSumValid ¶
func (*FitEntry) Type ¶
func (fit *FitEntry) Type() FitEntryType
type FitEntryType ¶
type FitEntryType uint16
const ( FitHeader FitEntryType = 0x00 MCUpdate FitEntryType = 0x01 StartUpACMod FitEntryType = 0x02 BIOSStartUpMod FitEntryType = 0x07 TPMPolicyRec FitEntryType = 0x08 BIOSPolicyRec FitEntryType = 0x09 TXTPolicyRec FitEntryType = 0x0A KeyManifestRec FitEntryType = 0x0B BootPolicyManifest FitEntryType = 0x0C CSESecBoot FitEntryType = 0x10 FeaturePolicyDelRec FitEntryType = 0x2D JumpDebugPol FitEntryType = 0x2F UnusedEntry FitEntryType = 0x7F )
FitEntryTypes for distiction of Entries
type LCPHash ¶
type LCPHash struct {
// contains filtered or unexported fields
}
func (*LCPHash) PrettyPrint ¶
type LCPList ¶
type LCPList struct {
TPM12PolicyList LCPPolicyList
}
type LCPPolicy ¶
type LCPPolicy struct { Version uint16 // < 0x0300 HashAlg uint8 PolicyType uint8 SINITMinVersion uint8 Reserved1 uint8 DataRevocationCounters [LCPMaxLists]uint16 PolicyControl uint32 MaxSINITMinVersion uint8 // v2.0 MaxBIOSACMinVersion uint8 // v2.0 Reserved2 uint16 Reserved3 uint32 PolicyHash [20]byte }
func ParsePolicy ¶
func (*LCPPolicy) PrettyPrint ¶
func (p *LCPPolicy) PrettyPrint()
type LCPPolicyCustom ¶
type LCPPolicyData ¶
type LCPPolicyData struct { FileSignature [32]uint8 Reserved [3]uint8 NumLists uint8 PolicyLists []LCPList }
func ParsePolicyData ¶
func ParsePolicyData(policyData []byte) (*LCPPolicyData, error)
func (*LCPPolicyData) PrettyPrint ¶
func (pd *LCPPolicyData) PrettyPrint()
type LCPPolicyElement ¶
type LCPPolicyElement struct { Size uint32 Type uint32 PolicyEltControl uint32 MLE *LCPPolicyMLE SBIOS *LCPPolicySBIOS PCONF *LCPPolicyPCONF Custom *LCPPolicyCustom }
type LCPPolicyList ¶
type LCPPolicyList struct { Version uint16 Reserved uint8 SignaturAlg uint8 PolicyElementSize uint32 PolicyElements []LCPPolicyElement Signature *LCPSignature }
type LCPPolicyList2 ¶
type LCPPolicyList2 struct { Version uint16 SignaturAlg uint16 PolicyElementSize uint32 PolicyElements []LCPPolicyElement }
type LCPPolicyMLE ¶
type LCPPolicyPCONF ¶
type LCPPolicyPCONF struct { NumPCRInfos uint16 PCRInfos []TPMPCRInfoShort }
type LCPPolicySBIOS ¶
type LCPSignature ¶
type ProcessorID ¶
type Processors ¶
type Processors struct { Count uint32 IDList []ProcessorID }
func (*Processors) PrettyPrint ¶
func (p *Processors) PrettyPrint()
type TPMPCRInfoShort ¶
type TPMs ¶
func (*TPMs) PrettyPrint ¶
func (t *TPMs) PrettyPrint()
type TXTBiosData ¶
type TXTBiosData struct { Version uint32 BiosSinitSize uint32 Reserved1 uint64 Reserved2 uint64 NumLogProcs uint32 SinitFlags *uint32 MleFlags *TXTBiosMLEFlags }
func ParseBIOSDataRegion ¶
func ParseBIOSDataRegion(heap []byte) (TXTBiosData, error)
type TXTBiosMLEFlags ¶
type TXTErrorCode ¶
type TXTRegisterSpace ¶
type TXTRegisterSpace struct { Sts TXTStatus // TXT.STS (0x0) TxtReset bool // TXT.ESTS (0x8) ErrorCode TXTErrorCode // TXT.ERRORCODE ErrorCodeRaw uint32 AcmStatus uint64 // TXT.ACMSTATUS FsbIf uint32 // TXT.VER.FSBIF Vid uint16 // TXT.DIDVID.VID Did uint16 // TXT.DIDVID.DID Rid uint16 // TXT.DIDVID.RID IdExt uint16 // TXT.DIDVID.ID-EXT QpiIf uint32 // TXT.VER.QPIIF SinitBase uint32 // TXT.SINIT.BASE SinitSize uint32 // TXT.SINIT.SIZE MleJoin uint32 // TXT.MLE.JOIN HeapBase uint32 // TXT.HEAP.BASE HeapSize uint32 // TXT.HEAP.SIZE Dpr DMAProtectedRange // TXT.DPR PublicKey [4]uint64 // TXT.PUBLIC.KEY E2Sts uint64 // TXT.E2STS }
func ReadTXTRegs ¶
func ReadTXTRegs() (TXTRegisterSpace, error)
type TXTStatus ¶
type TXTStatus struct { SenterDone bool // SENTER.DONE.STS (0) SexitDone bool // SEXIT.DONE.STS (1) // Reserved (2-5) MemConfigLock bool // MEM-CONFIG-LOCK (6) PrivateOpen bool // PRIVATE-OPEN.STS (7) // Reserved (8-14) Locality1Open bool // TXT.LOCALITY1.OPEN.STS (15) Locality2Open bool // TXT.LOCALITY1.OPEN.STS (16) }
type UintN ¶
type UintN interface { // Return size in bytes. Size() int64 // Return string formatted in hex. String() string // contains filtered or unexported methods }
UintN is a wrapper around uint types and provides a few io-related functions.
type VTdRegisters ¶
type VTdRegisters struct { Version uint32 // Architecture version supported by the implementation. Reserved1 uint32 // Reserved Capabilities uint64 // Hardware reporting of capabilities. ExtendedCapabilities uint64 // Hardware reporting of extended capabilities. GlobalCommand uint32 // Register controlling general functions. GlobalStatus uint32 // Register reporting general status. RootTableAddress uint64 // Register to set up location of root table. ContextCommand uint64 // Register to manage context-entry cache. Reserved2 uint32 // Reserved FaultStatus uint32 // Register to report Fault/Error status FaultEventControl uint32 // Interrupt control register for fault events. FaultEventData uint32 // Interrupt message data register for fault events. FaultEventAddress uint32 // Interrupt message address register for fault event messages. FaultEventUpperAddress uint32 // Interrupt message upper address register for fault event messages. Reserved3 uint64 // Reserved Reserved4 uint64 // Reserved AdvancedFaultLog uint64 // Register to configure and manage advanced fault logging. Reserved5 uint32 // Reserved ProtectedMemoryEnable uint32 // Register to enable DMA-protected memory region(s). ProtectedLowMemoryBase uint32 // Register pointing to base of DMA-protected low memory region. ProtectedLowMemoryLimit uint32 // Register pointing to last address (limit) of the DMA-protected low memory region. ProtectedHighMemoryBase uint64 // Register pointing to base of DMA-protected high memory region. ProtectedHighMemoryLimit uint64 // Register pointing to last address (limit) of the DMA-protected high memory region. InvalidationQueueHead uint64 // Offset to the invalidation queue entry that will be read next by hardware. InvalidationQueueTail uint64 // Offset to the invalidation queue entry that will be written next by software. InvalidationQueueAddress uint64 // Base address of memory-resident invalidation queue. Reserved6 uint32 // Reserved InvalidationCompletionStatus uint32 // Register to indicate the completion of an Invalidation Wait Descriptor with IF=1. InvalidationCompletionEventControl uint32 // Register to control Invalidation Queue Events InvalidationCompletionEventData uint32 // Invalidation Queue Event message data register for Invalidation Queue events. InvalidationCompletionEventAddress uint32 // Invalidation Queue Event message address register for Invalidation Queue events. InvalidationCompletionEventUpperAddress uint32 // Invalidation Queue Event message upper address register for Invalidation Queue events. Reserved7 uint64 // Reserved. InterruptRemappingTableAddress uint64 // Register indicating Base Address of Interrupt Remapping Table. PageRequestQueueHead uint64 // Offset to the page request queue entry that will be processed next by software. PageRequestQueueTail uint64 // Offset to the page request queue entry that will be written next by hardware. PageRequestQueueAddress uint64 // Base address of memory-resident page request queue. Reserved8 uint32 // Reserved PageRequestStatus uint32 // Register to indicate one or more pending page requests in page request queue. PageRequestEventControl uint32 // Register to control page request events. PageRequestEventData uint32 // Page request event message data register. PageRequestEventAddress uint32 // Page request event message address register PageRequestEventUpperAddress uint32 // Page request event message upper address register. MTRRCapability uint64 // Register for MTRR capability reporting. MTRRDefaultType uint64 // Register to configure MTRR default type. FixedRangeMTRR64K_00000 uint64 // Fixed-range memory type range register for 64K range starting at 00000h. FixedRangeMTRR16K_80000 uint64 // Fixed-range memory type range register for 16K range starting at 80000h. FixedRangeMTRR16K_A0000 uint64 // Fixed-range memory type range register for 16K range starting at A0000h. FixedRangeMTRR4K_C0000 uint64 // Fixed-range memory type range register for 4K range starting at C0000h. FixedRangeMTRR4K_C8000 uint64 // Fixed-range memory type range register for 4K range starting at C8000h. FixedRangeMTRR4K_D0000 uint64 // Fixed-range memory type range register for 4K range starting at D0000h. FixedRangeMTRR4K_D8000 uint64 // Fixed-range memory type range register for 4K range starting at D8000h. FixedRangeMTRR4K_E0000 uint64 // Fixed-range memory type range register for 4K range starting at E0000h. FixedRangeMTRR4K_E8000 uint64 // Fixed-range memory type range register for 4K range starting at E8000h. FixedRangeMTRR4K_F0000 uint64 // Fixed-range memory type range register for 4K range starting at F0000h. FixedRangeMTRR4K_F8000 uint64 // Fixed-range memory type range register for 4K range starting at F8000h. VariableRangeMTRRBase0 uint64 // Variable-range memory type range0 base register. VariableRangeMTRRMask0 uint64 // Variable-range memory type range0 mask register. VariableRangeMTRRBase1 uint64 // Variable-range memory type range1 base register. VariableRangeMTRRMask1 uint64 // Variable-range memory type range1 mask register. VariableRangeMTRRBase2 uint64 // Variable-range memory type range2 base register. VariableRangeMTRRMask2 uint64 // Variable-range memory type range2 mask register. VariableRangeMTRRBase3 uint64 // Variable-range memory type range3 base register. VariableRangeMTRRMask3 uint64 // Variable-range memory type range3 mask register. VariableRangeMTRRBase4 uint64 // Variable-range memory type range4 base register. VariableRangeMTRRMask4 uint64 // Variable-range memory type range4 mask register. VariableRangeMTRRBase5 uint64 // Variable-range memory type range5 base register. VariableRangeMTRRMask5 uint64 // Variable-range memory type range5 mask register. VariableRangeMTRRBase6 uint64 // Variable-range memory type range6 base register. VariableRangeMTRRMask6 uint64 // Variable-range memory type range6 mask register. VariableRangeMTRRBase7 uint64 // Variable-range memory type range7 base register. VariableRangeMTRRMask7 uint64 // Variable-range memory type range7 mask register. VariableRangeMTRRBase8 uint64 // Variable-range memory type range8 base register. VariableRangeMTRRMask8 uint64 // Variable-range memory type range8 mask register. VariableRangeMTRRBase9 uint64 // Variable-range memory type range9 base register. VariableRangeMTRRMask9 uint64 // Variable-range memory type range9 mask register. VirtualCommandCapability uint64 // Hardware reporting of commands supported by virtual-DMA Remapping hardware. Reserved10 uint64 // Reserved for future expansion of Virtual Command Capability Register. VirtualCommand uint64 // Register to submit commands to virtual DMA Remapping hardware. Reserved11 uint64 // Reserved for future expansion of Virtual Command Register. VirtualCommandResponse uint64 // Register to receive responses from virtual DMA Remapping hardware. Reserved12 uint64 // Reserved for future expansion of Virtual Command Response Register. }
Click to show internal directories.
Click to hide internal directories.