tools

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: BSD-3-Clause Imports: 16 Imported by: 13

Documentation

Index

Constants

View Source
const (
	//ACMChipsetTypeBios as defined in Document 315168-016 Chapter A.1 Table 8. Authenticated Code Module Format
	ACMChipsetTypeBios uint8 = 0x00
	//ACMChipsetTypeSinit as defined in Document 315168-016 Chapter A.1 Table 8. Authenticated Code Module Format
	ACMChipsetTypeSinit uint8 = 0x01
	//ACMChipsetTypeBiosRevoc as defined in Document 315168-016 Chapter A.1 Table 10. Chipset AC Module Information Table
	ACMChipsetTypeBiosRevoc uint8 = 0x08
	//ACMChipsetTypeSinitRevoc as defined in Document 315168-016 Chapter A.1 Table 10. Chipset AC Module Information Table
	ACMChipsetTypeSinitRevoc uint8 = 0x09
	//ACMTypeChipset as defined in Document 315168-016 Chapter A.1 Table 8. Authenticated Code Module Format
	ACMTypeChipset fit.ACModuleType = 0x02
	//ACMSubTypeReset FIXME
	ACMSubTypeReset uint16 = 0x01
	//ACMVendorIntel as defined in Document 315168-016 Chapter A.1 Table 8. Authenticated Code Module Format
	ACMVendorIntel fit.ACModuleVendor = 0x8086

	//TPMExtPolicyIllegal as defined in Document 315168-016 Chapter A.1 Table 16. TPM Capabilities Field
	TPMExtPolicyIllegal uint8 = 0x00
	//TPMExtPolicyAlgAgile as defined in Document 315168-016 Chapter A.1 Table 16. TPM Capabilities Field
	TPMExtPolicyAlgAgile uint8 = 0x01
	//TPMExtPolicyEmbeddedAlgs as defined in Document 315168-016 Chapter A.1 Table 16. TPM Capabilities Field
	TPMExtPolicyEmbeddedAlgs uint8 = 0x10
	//TPMExtPolicyBoth as defined in Document 315168-016 Chapter A.1 Table 16. TPM Capabilities Field
	TPMExtPolicyBoth uint8 = 0x11

	//TPMFamilyIllegal as defined in Document 315168-016 Chapter A.1 Table 16. TPM Capabilities Field
	TPMFamilyIllegal uint16 = 0x0000
	//TPMFamilyDTPM12 as defined in Document 315168-016 Chapter A.1 Table 16. TPM Capabilities Field
	TPMFamilyDTPM12 uint16 = 0x0001
	//TPMFamilyDTPM20 as defined in Document 315168-016 Chapter A.1 Table 16. TPM Capabilities Field
	TPMFamilyDTPM20 uint16 = 0x0010
	//TPMFamilyDTPMBoth combination out of TPMFamilyDTPM12 and TPMFamilyDTPM20
	TPMFamilyDTPMBoth uint16 = 0x0011
	//TPMFamilyPTT20 as defined in Document 315168-016 Chapter A.1 Table 16. TPM Capabilities Field
	TPMFamilyPTT20 uint16 = 0x1000

	//ACMUUIDV3 as defined in Document 315168-016 Chapter A.1 Table 10. Chipset AC Module Information Table
	ACMUUIDV3 string = "7fc03aaa-46a7-18db-ac2e-698f8d417f5a"
	//ACMSizeOffset as defined in Document 315168-016 Chapter A.1 Table 8. Authenticated Code Module Format
	ACMSizeOffset int64 = 24

	//ACMheaderLen as defined in Document 315168-016 Chapter A.1 Table 8. Authenticated Code Module Format (Version 0.0)
	ACMheaderLen uint32 = 161

	//ACMModuleSubtypeSinitACM is an enum
	ACMModuleSubtypeSinitACM fit.ACModuleSubType = 0
	//ACMModuleSubtypeCapableOfExecuteAtReset is a flag and enum Based on EDK2 Silicon/Intel/Tools/FitGen/FitGen.c
	ACMModuleSubtypeCapableOfExecuteAtReset fit.ACModuleSubType = 1
	//ACMModuleSubtypeAncModule is a flag Based on EDK2 Silicon/Intel/Tools/FitGen/FitGen.c
	ACMModuleSubtypeAncModule fit.ACModuleSubType = 2
)
View Source
const (
	// LCPPol2HashMaskSHA1 exports SHA1 definition for LCPPolicy2.LcpHashMapAlg
	LCPPol2HashMaskSHA1 uint16 = 0x0001

	// LCPPol2HashMaskSHA256 exports SHA256 definition for LCPPolicy2.LcpHashMapAlg
	LCPPol2HashMaskSHA256 uint16 = 0x0008

	// LCPPol2HashMaskSHA384 exports SHA384 definition for LCPPolicy2.LcpHashMapAlg
	LCPPol2HashMaskSHA384 uint16 = 0x0040
)
View Source
const (
	//LCPPolicyVersion2 as defined in Document 315168-016 Chapter 3.2.1 LCP Policy
	LCPPolicyVersion2 uint16 = 0x0204
	//LCPPolicyVersion3 as defined in Document 315168-016 Chapter 3.2.1 LCP Policy
	LCPPolicyVersion3 uint16 = 0x0300
	//LCPPolicyTypeAny as defined in Document 315168-016 Chapter D LCP Data Structures
	LCPPolicyTypeAny LCPPolicyType = 1
	//LCPPolicyTypeList as defined in Document 315168-016 Chapter D LCP Data Structures
	LCPPolicyTypeList LCPPolicyType = 0
	//LCPMaxLists as defined in Document 315168-016 Chapter D LCP Data Structures
	LCPMaxLists uint = 8
	//SHA1DigestSize as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	SHA1DigestSize uint = 20
	//SHA256DigestSize as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	SHA256DigestSize uint = 32
	//SHA384DigestSize as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	SHA384DigestSize uint = 48
	//SHA512DigestSize FIXME
	SHA512DigestSize uint = 64
	//SM3DigestSize as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	SM3DigestSize uint = 32
	//LCPDataFileSignature as defined in Document 315168-016 Chapter D.2 LCP_POLICY_DATA
	LCPDataFileSignature string = "Intel(R) TXT LCP_POLICY_DATA\x00\x00\x00\x00"

	//LCPSignatureAlgNone FIXME
	LCPSignatureAlgNone uint8 = 0
	//LCPSignatureAlgRSAPKCS15 FIXME
	LCPSignatureAlgRSAPKCS15 uint8 = 1

	//LCPPolicyElementMLE as defined in Document 315168-016 Chapter D.4.4 LCP_MLE_ELEMENT
	LCPPolicyElementMLE uint32 = 0
	//LCPPolicyElementPCONF as defined in Document 315168-016 Chapter D.4.5 LCP_PCONF_ELEMENT
	LCPPolicyElementPCONF uint32 = 1
	//LCPPolicyElementSBIOS FIXME
	LCPPolicyElementSBIOS uint32 = 2
	//LCPPolicyElementCustom as defined in Document 315168-016 Chapter D.4.6 LCP_CUSTOM_ELEMENT
	LCPPolicyElementCustom uint32 = 3
	//LCPPolicyElementMLE2 as defined in Document 315168-016 Chapter D.4.7 LCP_MLE_ELEMENT2
	LCPPolicyElementMLE2 uint32 = 0x10
	//LCPPolicyElementPCONF2 as defined in Document 315168-016 Chapter D.4.8 LCP_PCONF_ELEMENT2
	LCPPolicyElementPCONF2 uint32 = 0x11
	//LCPPolicyElementSBIOS2 FIXME
	LCPPolicyElementSBIOS2 uint32 = 0x12
	//LCPPolicyElementSTM2 as defined in Document 315168-016 Chapter D.4.9 LCP_STM_ELEMENT2
	LCPPolicyElementSTM2 uint32 = 0x14

	// LCPPolHAlgSHA1 Document 315168-016 Chapter D.1 LCP_POLICY
	LCPPolHAlgSHA1 uint8 = 0

	// LCPPolicyControlNPW as defined in Document 315168-013 Chapter 3.2.2 PolicyControl Field for LCP_POLTYPE_LIST
	LCPPolicyControlNPW uint32 = 0x00000001
	//LCPPolicyControlSinitCaps as defined in Document 315168-013 Chapter 3.2.2 PolicyControl Field for LCP_POLTYPE_LIST
	LCPPolicyControlSinitCaps uint32 = 0x00000002
	//LCPPolicyControlOwnerEnforced as defined in Document 315168-013 Chapter 3.2.2 PolicyControl Field for LCP_POLTYPE_LIST
	LCPPolicyControlOwnerEnforced uint32 = 0x00000004
	//LCPPolicyControlAuxDelete as defined in Document 315168-013 Chapter 3.3.2 LCP Policy 2
	LCPPolicyControlAuxDelete uint32 = 0x80000000
)
View Source
const (
	// TxtTPMDecode for external use
	TxtTPMDecode = 0xFED40000
	// TxtTPMDecodeSize is the size of the TCG defined TIS MMIO space
	TxtTPMDecodeSize = 0x5000
	// TxtPublicSpace for external test
	TxtPublicSpace = 0xFED30000
	// TxtPublicSpaceSize exports the size of TXTPublicSpace in memory map
	TxtPublicSpaceSize = 0x10000
	// TxtPrivateSpace for external test
	TxtPrivateSpace = 0xFED20000
	// TxtPrivateSpaceSize for external test
	TxtPrivateSpaceSize = 0x10000
)

Variables

View Source
var HashAlgMap = map[crypto.Hash]tpm2.Algorithm{
	crypto.SHA1:   0x04,
	crypto.SHA256: 0x0B,
	crypto.SHA384: 0x0C,
}

HashAlgMap exports map from crypto.Hash to LCPPol2Hash for parsing manual input to LCPPolicy2

View Source
var HashMaskMap = map[string]uint16{
	"SHA1":   LCPPol2HashMaskSHA1,
	"SHA256": LCPPol2HashMaskSHA256,
	"SHA384": LCPPol2HashMaskSHA384,
}

HashMaskMap exports map to convert string to type LCPPol2HashMask for file parsing

View Source
var PolicyControlMap = map[string]uint32{
	"NPW":           0x00000001,
	"SinitCaps":     0x00000002,
	"OwnerEnforced": 0x00000004,
	"AuxDelete":     0x80000000,
}

PolicyControlMap exports map to convert string to type PoliyControl for file parsing

View Source
var SignMaskMap = map[string]LCPPol2Sig{
	"RSA2048SHA1":     RSA2048SHA1,
	"RSA2048SHA256":   RSA2048SHA256,
	"RSA3072SHA256":   RSA3072SHA256,
	"RSA3072SHA384":   RSA3072SHA384,
	"ECDSAP256SHA256": ECDSAP256SHA256,
	"ECDSAP384SHA384": ECDSAP384SHA384,
}

SignMaskMap exports map to convert string to type LCPPol2Sig for file parsing

Functions

func CalcImageOffset added in v2.6.0

func CalcImageOffset(image []byte, addr uint64) (uint64, error)

CalcImageOffset returns the offset of a given uefi flash image

func FetchTXTRegs

func FetchTXTRegs(txtAPI hwapi.LowLevelHardwareInterfaces) ([]byte, error)

FetchTXTRegs returns a raw copy of the TXT config space

func GetRegion added in v2.7.0

func GetRegion(image []byte, regionType uefi.FlashRegionType) (uint32, uint32, error)

GetRegion returns offset and size of the given region type.

func LookupACMSize added in v2.6.0

func LookupACMSize(header []byte) (int64, error)

func ParsePolicy

func ParsePolicy(policy []byte) (*LCPPolicy, *LCPPolicy2, error)

ParsePolicy generates one of LCPPolicy or LCPPolicy2

func PrintLcpHashAlgMask

func PrintLcpHashAlgMask(mask uint16) string

PrintLcpHashAlgMask prints LcpHashAlgMask in human readable format

func PrintPolicyControl

func PrintPolicyControl(pc uint32) string

PrintPolicyControl can print PolicyControl field

func ReadACMPolicyStatusRaw added in v2.6.0

func ReadACMPolicyStatusRaw(data []byte) (uint64, error)

ReadACMPolicyStatusRaw decodes the raw ACM status register bits

func ShowVersion

func ShowVersion(toolName, tag, commit string)

ShowVersion shows progam version

Types

type ACM

type ACM struct {
	Header     *fit.EntrySACMData
	Info       ACMInfo
	Chipsets   Chipsets
	Processors Processors
	TPMs       TPMs
}

func ParseACM

func ParseACM(r io.Reader) (*ACM, error)

ParseACM deconstructs a byte array containing the raw ACM into it's components

func (*ACM) ParseACMFlags added in v2.7.0

func (a *ACM) ParseACMFlags() *ACMFlags

ParseACMFlags parses the ACM Header flags

func (*ACM) ParseACMInfo added in v2.7.0

func (a *ACM) ParseACMInfo() error

func (*ACM) PrettyPrint

func (a *ACM) PrettyPrint()

PrettyPrint prints a human readable representation of the ACM

func (*ACM) PrettyPrintHeader added in v2.7.0

func (a *ACM) PrettyPrintHeader()

PrettyPrint prints a human readable representation of the ACMHeader

func (*ACM) UUID added in v2.7.0

func (a *ACM) UUID() string

func (*ACM) ValidateACMHeader added in v2.7.0

func (a *ACM) ValidateACMHeader() (bool, error)

ValidateACMHeader validates an ACM Header found in the Firmware Interface Table (FIT)

type ACMFlags

type ACMFlags struct {
	Production    bool
	PreProduction bool
	DebugSigned   bool
}

ACMFlags exports the ACM header flags

type ACMInfo

type ACMInfo struct {
	UUID                UUID
	ChipsetACMType      uint8
	Version             uint8
	Length              uint16
	ChipsetIDList       uint32
	OSSinitDataVersion  uint32
	MinMleHeaderVersion uint32
	TxtCaps             uint32
	ACMVersion          uint8
	ACMRevision         ACMRevision
	ProcessorIDList     uint32
	TPMInfoList         uint32
}

ACMInfo holds the metadata extracted from the ACM header

type ACMRevision added in v2.7.0

type ACMRevision [3]uint8

ACMRevision is the version of the ACM module in format <major>.<minor>.<build>

func (ACMRevision) String added in v2.7.0

func (r ACMRevision) String() string

String implements fmt.Stringer

type ACMStatus

type ACMStatus struct {
	Valid          bool
	MinorErrorCode uint16
	ACMStarted     bool
	MajorErrorCode uint8
	ClassCode      uint8
	ModuleType     uint8
}

ACMStatus holds the decoded ACM run state

func ReadACMStatus

func ReadACMStatus(data []byte) (ACMStatus, error)

ReadACMStatus decodes the raw ACM status register bits

type ApprovedHashAlgorithm

type ApprovedHashAlgorithm struct {
	SHA1   bool
	SHA256 bool
	SHA384 bool
	SM3    bool
}

ApprovedHashAlgorithm as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2

type ApprovedSignatureAlogrithm

type ApprovedSignatureAlogrithm struct {
	RSA2048SHA1     bool
	RSA2048SHA256   bool
	RSA3072SHA256   bool
	RSA3072SHA384   bool
	ECDSAP256SHA256 bool
	ECDSAP384SHA384 bool
	SM2SM2CurveSM3  bool
}

ApprovedSignatureAlogrithm as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2

type ChipsetID

type ChipsetID struct {
	Flags      uint32
	VendorID   uint16
	DeviceID   uint16
	RevisionID uint16
	Reserved   [3]uint16
}

ChipsetID describes the chipset ID found in the ACM header

type Chipsets

type Chipsets struct {
	Count  uint32
	IDList []ChipsetID
}

Chipsets hold a list of supported chipset IDs as found in the ACM header

func (Chipsets) PrettyPrint

func (c Chipsets) PrettyPrint()

PrettyPrint prints a human readable representation of the Chipsets

type LCPHash

type LCPHash struct {
	Sha1   *[SHA1DigestSize]uint8
	Sha256 *[SHA256DigestSize]uint8
	Sha384 *[SHA384DigestSize]uint8
	Sha512 *[SHA512DigestSize]uint8
	SM3    *[SM3DigestSize]uint8
}

LCPHash holds one of the supported hashes

func (*LCPHash) PrettyPrint

func (p *LCPHash) PrettyPrint() string

PrettyPrint prints the LCPHash in a human readable format

type LCPList

type LCPList struct {
	TPM12PolicyList LCPPolicyList
	TPM20PolicyList LCPPolicyList2
}

LCPList as defined in Document 315168-016 Chapter D.3.2.3 LCP_LIST

type LCPPol2Sig

type LCPPol2Sig uint32

LCPPol2Sig represents LCPPol2.LcpSignAlgMask options

const (
	// RSA2048SHA1 as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	RSA2048SHA1 LCPPol2Sig = 0x00000004
	// RSA2048SHA256 as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	RSA2048SHA256 LCPPol2Sig = 0x00000008
	// RSA3072SHA256 as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	RSA3072SHA256 LCPPol2Sig = 0x00000040
	// RSA3072SHA384 as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	RSA3072SHA384 LCPPol2Sig = 0x00000080
	// ECDSAP256SHA256 as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	ECDSAP256SHA256 LCPPol2Sig = 0x00001000
	// ECDSAP384SHA384 as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	ECDSAP384SHA384 LCPPol2Sig = 0x00002000
	// SM2SM2CurveSM3 as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2
	SM2SM2CurveSM3 LCPPol2Sig = 0x00010000
)

func (LCPPol2Sig) String

func (ls LCPPol2Sig) String() string

type LCPPolicy

type LCPPolicy struct {
	Version                uint16 // < 0x0204
	HashAlg                uint8
	PolicyType             LCPPolicyType
	SINITMinVersion        uint8
	Reserved               uint8
	DataRevocationCounters [LCPMaxLists]uint16
	PolicyControl          uint32
	MaxSINITMinVersion     uint8
	Reserved1              uint8
	Reserved2              uint16
	Reserved3              uint32
	PolicyHash             [20]byte
}

LCPPolicy as defined in Document 315168-016 Chapter D.1.2 LCP_POLICY

func (*LCPPolicy) ParsePolicyControl

func (p *LCPPolicy) ParsePolicyControl() PolicyControl

ParsePolicyControl TODO needs to be reverse engineered

type LCPPolicy2

type LCPPolicy2 struct {
	Version                uint16 // < 0x0302
	HashAlg                tpm2.Algorithm
	PolicyType             LCPPolicyType
	SINITMinVersion        uint8
	DataRevocationCounters [LCPMaxLists]uint16
	PolicyControl          uint32
	MaxSINITMinVersion     uint8 // v2.0 - Only PO index, reserved for PS
	Reserved               uint8 // v2.0 - Only PO index, reserved for PS
	LcpHashAlgMask         uint16
	LcpSignAlgMask         LCPPol2Sig
	Reserved2              uint32
	PolicyHash             [32]byte
}

LCPPolicy2 as defined in Document 315168-016 Chapter D.1.3 LCP_POLICY2

func GenLCPPolicyV2

func GenLCPPolicyV2(version uint16, hashAlg crypto.Hash, hash []byte, sinitmin uint8, pc PolicyControl,
	apprHashes ApprovedHashAlgorithm, apprSigs ApprovedSignatureAlogrithm) (*LCPPolicy2, error)

GenLCPPolicyV2 generates a LCPPolicyV2 structure with given hash algorithm

func (*LCPPolicy2) ParseApprovedHashAlgorithm

func (p *LCPPolicy2) ParseApprovedHashAlgorithm() ApprovedHashAlgorithm

ParseApprovedHashAlgorithm returns the supported hash algorithms

func (*LCPPolicy2) ParseApprovedSignatureAlgorithm

func (p *LCPPolicy2) ParseApprovedSignatureAlgorithm() ApprovedSignatureAlogrithm

ParseApprovedSignatureAlgorithm returns the supported signature algorithms

func (*LCPPolicy2) ParsePolicyControl2

func (p *LCPPolicy2) ParsePolicyControl2() PolicyControl

ParsePolicyControl2 TODO needs to be reverse engineered

func (*LCPPolicy2) PrettyPrint

func (p *LCPPolicy2) PrettyPrint()

PrettyPrint prints LCPPolicy2 Structure i a human readable format

type LCPPolicyCustom

type LCPPolicyCustom struct {
	UUID LCPUUID
	Data []byte
}

LCPPolicyCustom represents a custom policy element

type LCPPolicyData

type LCPPolicyData struct {
	FileSignature [32]uint8
	Reserved      [3]uint8
	NumLists      uint8
	PolicyLists   []LCPList
}

LCPPolicyData FIXME

func ParsePolicyData

func ParsePolicyData(policyData []byte) (*LCPPolicyData, error)

ParsePolicyData parses a raw copy of the LCP policy

func (*LCPPolicyData) PrettyPrint

func (pd *LCPPolicyData) PrettyPrint()

PrettyPrint prints the LCPPolicyData in a human readable format

type LCPPolicyElement

type LCPPolicyElement struct {
	Size             uint32
	Type             uint32
	PolicyEltControl uint32
	MLE              *LCPPolicyMLE
	SBIOS            *LCPPolicySBIOS
	PCONF            *LCPPolicyPCONF
	Custom           *LCPPolicyCustom
}

LCPPolicyElement represents a policy element as defined in Document 315168-016 Chapter D.4 LCP_POLICY_ELEMENT

type LCPPolicyList

type LCPPolicyList struct {
	Version           uint16
	Reserved          uint8
	SignaturAlg       uint8
	PolicyElementSize uint32
	PolicyElements    []LCPPolicyElement
	Signature         *LCPSignature
}

LCPPolicyList FIXME not in Document 315168-016

type LCPPolicyList2

type LCPPolicyList2 struct {
	Version           uint16
	SignaturAlg       uint16
	PolicyElementSize uint32
	PolicyElements    []LCPPolicyElement
}

LCPPolicyList2 as defined in Document 315168-016 Chapter D.3.2.1 LCP_POLICY_LIST2 Structure

type LCPPolicyMLE

type LCPPolicyMLE struct {
	SINITMinVersion uint8
	HashAlg         uint8
	NumHashes       uint16
	Hashes          [][20]byte
}

LCPPolicyMLE represents a MLE policy element as defined in Document 315168-016 Chapter D.4.4 LCP_MLE_ELEMENT

type LCPPolicyPCONF

type LCPPolicyPCONF struct {
	NumPCRInfos uint16
	PCRInfos    []TPMPCRInfoShort
}

LCPPolicyPCONF represents a PCONF policy element

type LCPPolicySBIOS

type LCPPolicySBIOS struct {
	HashAlg      uint8
	Reserved1    [3]uint8
	FallbackHash LCPHash
	Reserved2    uint16
	NumHashes    uint16
	Hashes       []LCPHash
}

LCPPolicySBIOS represents a SBIOS policy element

type LCPPolicyType

type LCPPolicyType uint8

LCPPolicyType exports the PolicyType type for external use

func (LCPPolicyType) String

func (pt LCPPolicyType) String() string

type LCPSignature

type LCPSignature struct {
	RevocationCounter uint16
	PubkeySize        uint16
	PubkeyValue       []byte
	SigBlock          []byte
}

LCPSignature as defined in Document 315168-016 Chapter D.3.2.1 LCP_POLICY_LIST2 Structure

type LCPUUID

type LCPUUID struct {
	// contains filtered or unexported fields
}

LCPUUID represents an UUID

type PolicyControl

type PolicyControl struct {
	NPW           bool
	OwnerEnforced bool
	AuxDelete     bool
	SinitCaps     bool
}

PolicyControl as defined in Document 315168-016 Chapter D.1.1 PolicyControl

type ProcessorID

type ProcessorID struct {
	FMS          uint32
	FMSMask      uint32
	PlatformID   uint64
	PlatformMask uint64
}

ProcessorID describes the processor ID found in the ACM header

type Processors

type Processors struct {
	Count  uint32
	IDList []ProcessorID
}

Processors hold a list of supported processor IDs as found in the ACM header

func (Processors) PrettyPrint

func (p Processors) PrettyPrint()

PrettyPrint prints a human readable representation of the Processors

type TPMPCRInfoShort

type TPMPCRInfoShort struct {
	// TPM_PCR_SELECTION
	PCRSelect []int
	// TPM_LOCALITY_SELECTION
	LocalityAtRelease uint8
	// TPM_COMPOSITE_HASH
	DigestAtRelease [20]byte
}

TPMPCRInfoShort rFIXME

type TPMs

type TPMs struct {
	Capabilities uint32
	Count        uint16
	AlgID        []tpm2.Algorithm
}

TPMs describes the required TPM capabilities and algorithm as found in the ACM header

func (TPMs) PrettyPrint

func (t TPMs) PrettyPrint()

PrettyPrint prints a human readable representation of the TPMs

type TXTBiosData

type TXTBiosData struct {
	Version       uint32
	BiosSinitSize uint32
	Reserved1     uint64
	Reserved2     uint64
	NumLogProcs   uint32
	SinitFlags    uint32
	MleFlags      *TXTBiosMLEFlags
}

TXTBiosData holds the decoded BIOSDATA regions as read from TXT config space

func ParseBIOSDataRegion

func ParseBIOSDataRegion(heap []byte) (TXTBiosData, error)

ParseBIOSDataRegion decodes a raw copy of the BIOSDATA region

type TXTBiosMLEFlags

type TXTBiosMLEFlags struct {
	SupportsACPIPPI bool
	IsLegacyState   bool
	IsServerState   bool
	IsClientState   bool
}

TXTBiosMLEFlags holds the decoded BIOSDATA region MLE flags as read from TXT config space

type TXTErrorCode

type TXTErrorCode struct {
	ModuleType        uint8 // 0: BIOS ACM, 1: Intel TXT
	ClassCode         uint8
	MajorErrorCode    uint8
	SoftwareSource    bool // 0: ACM, 1: MLE
	MinorErrorCode    uint16
	Type1Reserved     uint8
	ProcessorSoftware bool
	ValidInvalid      bool
}

TXTErrorCode holds the decoded ACM error code read from TXT config space

type TXTMode

type TXTMode uint8

TXTMode is the mode of operation for Intel TXT

const (
	AutoPromotion TXTMode = iota
	SignedPolicy
)

TXT modes

type TXTRegisterSpace

type TXTRegisterSpace struct {
	Sts          TXTStatus    // TXT.STS (0x0)
	TxtReset     bool         // TXT.ESTS (0x8)
	ErrorCode    TXTErrorCode // TXT.ERRORCODE
	ErrorCodeRaw uint32
	BootStatus   uint64                  // TXT.BOOTSTATUS
	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          hwapi.DMAProtectedRange // TXT.DPR
	PublicKey    [4]uint64               // TXT.PUBLIC.KEY
	E2Sts        uint64                  // TXT.E2STS
}

TXTRegisterSpace holds the decoded TXT config space

func ParseTXTRegs

func ParseTXTRegs(data []byte) (TXTRegisterSpace, error)

ParseTXTRegs decodes a raw copy of the TXT config space

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)

}

TXTStatus represents serveral configurations within the TXT config space

type UUID

type UUID struct {
	Field1 uint32
	Field2 uint16
	Field3 uint16
	Field4 uint16
	Field5 [6]uint8
}

UUID represents an UUID

Jump to

Keyboard shortcuts

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