test

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//IntelFITSpecificationTitle the title of Intel FIT BIOS Specification
	IntelFITSpecificationTitle = "Firmware Interface Table BIOS Specification"
	//IntelFITSpecificationDocumentID the document ID of Intel FIT BIOS Specification
	IntelFITSpecificationDocumentID = "599500 Revision 1.2"

	//IntelTXTBGSBIOSSpecificationTitle the title of Intel TXT&BG Server BIOS Specification
	IntelTXTBGSBIOSSpecificationTitle = "Intel Trusted Execution Technology and Boot Guard Server BIOS Specification"
	//IntelTXTBGSBIOSSpecificationDocumentID the document ID of Intel TXT&BG Server BIOS Specification
	IntelTXTBGSBIOSSpecificationDocumentID = "558294 Revision 2.0"

	//IntelTXTSpecificationTitle the title of Intel TXT Specification
	IntelTXTSpecificationTitle = "Intel Trusted Execution Technology (Intel TXT)"
	//IntelTXTSpecificationDocumentID the document ID of Intel TXT Specification
	IntelTXTSpecificationDocumentID = "315168-016"

	//ServerGrantleyPlatformSpecificationTitle is the title of the ACM_Errors.xls
	ServerGrantleyPlatformSpecificationTitle = "TXT error description file for Server Grantley Platform"
	//ServerGrantleyPlatformDocumentID is an empty string
	ServerGrantleyPlatformDocumentID = ""

	//CBtGTXTPlatformSpecificationTitle is the title of the ACM_Errors.xls
	CBtGTXTPlatformSpecificationTitle = "TXT error description file for Converged BtG / TXT  platform"
	//CBtGTXTPlatformDocumentID is an empty string
	CBtGTXTPlatformDocumentID = ""

	//ACPISpecificationTitle is the title of the ACPI spec
	ACPISpecificationTitle = "Advanced Configuration and PowerInterface (ACPI) Specification 6.3"
	//ACPISpecificationDocumentID s an empty string
	ACPISpecificationDocumentID = ""
)
View Source
const FITSize int64 = 16 * 1024 * 1024

FITSize 16MiB

View Source
const FITVector = 0xFFFFFFC0

FITVector is the FIT Vector address

View Source
const FourGiB = 0x100000000

FourGiB 4Gigabyte

View Source
const ResetVector = 0xFFFFFFF0

ResetVector is the reset vector address

View Source
const ValidFitRange = 0xFF000000

ValidFitRange is the size of a correct FIT

Variables

View Source
var (

	// TestsACPI exports the Slice with ACPI tests
	TestsACPI = [...]*Test{
		&testRSDPChecksum,
		&testMCFGPresent,
		&testDMARPresent,
		&testDMARValid,
		&testMADTPresent,
		&testMADTValid,
		&testRSDTPresent,
		&testRSDTValid,
		&testXSDTPresent,
		&testXSDTValid,
		&testRSDTorXSDTValid,
	}
)

nolint

View Source
var (

	// TestsCPU exports slice with CPU related tests
	TestsCPU = [...]*Test{
		&testcheckforintelcpu,
		&testwaybridgeorlater,
		&testcpusupportstxt,
		&testtxtregisterspaceaccessible,
		&testsupportssmx,
		&testsupportvmx,
		&testia32featurectrl,
		&testtxtnotdisabled,
		&testibbmeasured,
		&testibbistrusted,
		&testtxtregisterslocked,
		&testia32debuginterfacelockeddisabled,
	}
)

nolint

View Source
var (

	// TestsFIT exports the Slice with FIT tests
	TestsFIT = [...]*Test{
		&testfitvectorisset,
		&testhasfit,
		&testhasmcupdate,
		&testhasbiosacm,
		&testhasibb,
		&testhaslcpTest,
		&testibbcoversresetvector,
		&testibbcoversfitvector,
		&testibbcoversfit,
		&testnoibboverlap,
		&testnobiosacmoverlap,
		&testnobiosacmisbelow4g,
		&testpolicyallowstxt,
		&testbiosacmvalid,
		&testbiosacmsizecorrect,
		&testbiosacmaligmentcorrect,
		&testbiosacmmatcheschipset,
		&testbiosacmmatchescpu,
		&testacmsfornpw,
		&testsinitacmupporttpm,
	}
)
View Source
var TestsLegacy = []*Test{

	&testcheckforintelcpu,
	&testwaybridgeorlater,
	&testcpusupportstxt,
	&testtxtregisterspaceaccessible,
	&testsupportssmx,
	&testsupportvmx,
	&testia32featurectrl,
	&testtxtnotdisabled,
	&testtxtregisterslocked,
	&testia32debuginterfacelockeddisabled,
	&testibbmeasured,

	&testtxtmemoryrangevalid,
	&testmemoryisreserved,
	&testtxtmemoryisdpr,
	&testtxtdprislocked,
	&testsinitintxt,
	&testsinitmatcheschipset,
	&testsinitmatchescpu,
	&testbiosdataregionpresent,
	&testbiosdataregionvalid,
	&testhasmtrr,
	&testhassmrr,
	&testvalidsmrr,
	&testactivesmrr,

	&testfitvectorisset,
	&testhasfit,
	&testhasbiosacm,
	&testhasibb,
	&testhaslcpTest,
	&testibbcoversresetvector,
	&testibbcoversfitvector,
	&testibbcoversfit,
	&testnoibboverlap,
	&testnobiosacmoverlap,
	&testnobiosacmisbelow4g,
	&testpolicyallowstxt,
	&testbiosacmvalid,
	&testbiosacmsizecorrect,
	&testbiosacmaligmentcorrect,
	&testbiosacmmatcheschipset,
	&testbiosacmmatchescpu,

	&testtpmconnection,
	&testtpmispresent,
	&testpsindexconfig,
	&testauxindexconfig,
	&testpsindexissvalid,
	&testpcr00valid,
}

TestsLegacy - Summarizes all test for TXT (not CBnT) platforms

View Source
var (

	// TestsMemory exposes the slice for memory related txt tests
	TestsMemory = [...]*Test{
		&testtxtmemoryrangevalid,
		&testtxtpublicisreserved,
		&testtxtprivateisreserved,
		&testmemoryisreserved,
		&testtpmdecodereserved,
		&testtxtmemoryisdpr,
		&testtxtdprislocked,
		&testhostbridgeDPRcorrect,
		&testhostbridgeDPRislocked,
		&testsinitintxt,
		&testsinitmatcheschipset,
		&testsinitmatchescpu,
		&testnosiniterrors,
		&testbiosdataregionpresent,
		&testbiosdataregionvalid,
		&testhasmtrr,
		&testhassmrr,
		&testvalidsmrr,
		&testactivesmrr,
		&testactiveiommu,
		&testservermodetext,
	}
)
View Source
var TestsTBoot = []*Test{
	&testactiveiommu,
	&testnosiniterrors,
	&testibbistrusted,
	&testhostbridgeDPRcorrect,
	&testhostbridgeDPRislocked,
}

TestsTBoot - Summarizes all test for the tboot hypervisor

View Source
var (

	// TestsTPM exposes the slice of pointers to tests regarding tpm functionality for txt
	TestsTPM = [...]*Test{
		&testtpmconnection,
		&testtpmispresent,
		&testtpmnvramislocked,
		&testpsindexconfig,
		&testauxindexconfig,
		&testauxindexhashdata,
		&testpoindexconfig,
		&testpsindexissvalid,
		&testpoindexissvalid,
		&testpcr00valid,
		&testpsnpwmodenotactive,
		&testtxtmodvalid,
	}
)
View Source
var TestsTXTReady = []*Test{

	&testcheckforintelcpu,
	&testwaybridgeorlater,
	&testcpusupportstxt,
	&testtxtregisterspaceaccessible,
	&testsupportssmx,
	&testsupportvmx,
	&testia32featurectrl,
	&testtxtnotdisabled,
	&testtxtregisterslocked,
	&testia32debuginterfacelockeddisabled,

	&testtxtmemoryrangevalid,
	&testmemoryisreserved,
	&testtxtmemoryisdpr,
	&testtxtdprislocked,
	&testhostbridgeDPRcorrect,
	&testhostbridgeDPRislocked,
	&testsinitintxt,
	&testsinitmatcheschipset,
	&testsinitmatchescpu,
	&testbiosdataregionpresent,
	&testbiosdataregionvalid,
	&testhasmtrr,
	&testhassmrr,
	&testvalidsmrr,
	&testactivesmrr,

	&testtpmconnection,
	&testtpmnvramislocked,
	&testauxindexconfig,
}

TestsTXTReady - Summarizes all test for TXT Ready platforms

View Source
var TestsUEFI = []*Test{

	&testRSDPChecksum,
	&testMCFGPresent,
	&testDMARPresent,
	&testDMARValid,
	&testMADTPresent,
	&testMADTValid,
	&testRSDTPresent,
	&testRSDTValid,
	&testXSDTPresent,
	&testXSDTValid,
	&testRSDTorXSDTValid,
}

TestsUEFI - Summarizes all test for TXT UEFI boot

Functions

func AUXIndexConfig added in v1.0.1

func AUXIndexConfig(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

AUXIndexConfig tests if the AUX Index has the correct configuration

func AUXTPM2IndexCheckHash added in v1.0.1

func AUXTPM2IndexCheckHash(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

AUXTPM2IndexCheckHash checks the PolicyHash of AUX index

func ActiveIOMMU added in v1.0.1

func ActiveIOMMU(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ActiveIOMMU checks if IOMMU is active

func ActiveSMRR added in v1.0.1

func ActiveSMRR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ActiveSMRR checks if SMMR is set active

func BIOSACMAlignmentCorrect added in v1.0.1

func BIOSACMAlignmentCorrect(txtAPI hwapi.LowLevelHardwareInterfaces, _ *tools.Configuration) (bool, error, error)

BIOSACMAlignmentCorrect checks if BIOS ACM alignment is correct

func BIOSACMIsBelow4G added in v1.0.1

func BIOSACMIsBelow4G(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSACMIsBelow4G checks if BIOS ACM is below 4Gb (has a valid address)

func BIOSACMMatchesCPU added in v1.0.1

func BIOSACMMatchesCPU(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSACMMatchesCPU checks if BIOS ACM matches CPU

func BIOSACMMatchesChipset added in v1.0.1

func BIOSACMMatchesChipset(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSACMMatchesChipset checks if BIOS ACM matches chipset

func BIOSACMSizeCorrect added in v1.0.1

func BIOSACMSizeCorrect(txtAPI hwapi.LowLevelHardwareInterfaces, _ *tools.Configuration) (bool, error, error)

BIOSACMSizeCorrect checks if BIOS ACM size is correct

func BIOSACMValid added in v1.0.1

func BIOSACMValid(txtAPI hwapi.LowLevelHardwareInterfaces, _ *tools.Configuration) (bool, error, error)

BIOSACMValid checks if BIOS ACM is valid

func BIOSDATAREGIONPresent added in v1.0.1

func BIOSDATAREGIONPresent(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSDATAREGIONPresent checks is the BIOSDATA Region is present in TXT Register Space

func BIOSDATAREGIONValid added in v1.0.1

func BIOSDATAREGIONValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

BIOSDATAREGIONValid checks if the BIOSDATA Region in TXT Register Space is valid

func CPUSupportsTXT added in v1.0.1

func CPUSupportsTXT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CPUSupportsTXT Check if the CPU supports TXT

func CheckDMARPresence added in v1.0.1

func CheckDMARPresence(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckDMARPresence tests if the MADT ACPI table exists

func CheckDMARValid added in v1.0.1

func CheckDMARValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckDMARValid tests if the DMAR ACPI table is valid

func CheckForIntelCPU added in v1.0.1

func CheckForIntelCPU(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckForIntelCPU Check we're running on a Intel CPU

func CheckMADTPresence added in v1.0.1

func CheckMADTPresence(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckMADTPresence tests if the MADT ACPI table exists

func CheckMADTValid added in v1.0.1

func CheckMADTValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckMADTValid tests if the MADT ACPI table is valid

func CheckMCFGPresence added in v1.0.1

func CheckMCFGPresence(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckMCFGPresence tests if the MCFG ACPI table exists

func CheckRSDPValid added in v1.0.1

func CheckRSDPValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckRSDPValid tests if the RSDP ACPI table is vaid

func CheckRSDTPresent added in v1.0.1

func CheckRSDTPresent(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckRSDTPresent tests if the RSDT ACPI table is present

func CheckRSDTValid added in v1.0.1

func CheckRSDTValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckRSDTValid tests if the RSDT ACPI table is valid

func CheckRSDTorXSDTValid added in v1.0.1

func CheckRSDTorXSDTValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckRSDTorXSDTValid tests if the RSDT or XSDT ACPI table is valid

func CheckXSDTPresent added in v1.0.1

func CheckXSDTPresent(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckXSDTPresent tests if the XSDT ACPI table is present

func CheckXSDTValid added in v1.0.1

func CheckXSDTValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

CheckXSDTValid tests if the XSDT ACPI table is valid

func FITVectorIsSet

func FITVectorIsSet(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

FITVectorIsSet checks if the FIT Vector is set

func HasBIOSACM added in v1.0.1

func HasBIOSACM(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasBIOSACM checks if FIT table has BIOSACM entry

func HasBIOSPolicy added in v1.0.1

func HasBIOSPolicy(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasBIOSPolicy checks if FIT table has ONE BIOS Policy Data Record Entry

func HasFIT added in v1.0.1

HasFIT checks if the FIT is present

func HasIBB added in v1.0.1

HasIBB checks if FIT table has BIOS Startup Module entry

func HasMTRR added in v1.0.1

func HasMTRR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasMTRR checks if MTRR is supported by CPU

func HasMicroCode added in v1.0.1

func HasMicroCode(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasMicroCode checks if FIT table indicates a Microcode update for the CPU

func HasSMRR added in v1.0.1

func HasSMRR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HasSMRR checks if SMRR is supported

func HostbridgeDPRCorrect added in v1.0.1

func HostbridgeDPRCorrect(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HostbridgeDPRCorrect checks if TXT DPR equals PCI Hostbridge DPR

func HostbridgeDPRisLocked added in v1.0.1

func HostbridgeDPRisLocked(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HostbridgeDPRisLocked checks if the Hostbridge DPR is marked as locked

func HostbridgeIsSupported added in v1.0.1

func HostbridgeIsSupported(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

HostbridgeIsSupported checks if the suite supports the hostbridge

func IA32DebugInterfaceLockedDisabled added in v1.0.1

func IA32DebugInterfaceLockedDisabled(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IA32DebugInterfaceLockedDisabled checks if IA32 debug interface is locked

func IBBCoversFIT

func IBBCoversFIT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBCoversFIT checks if BIOS Startup Module Entry covers FIT table

func IBBCoversFITVector

func IBBCoversFITVector(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBCoversFITVector checks if BIOS Startup Module Entry covers FIT vector

func IBBCoversResetVector added in v1.0.1

func IBBCoversResetVector(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBCoversResetVector checks if BIOS Startup Module Entry covers Reset Vector

func IBBIsTrusted added in v1.0.1

func IBBIsTrusted(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBIsTrusted Check that the IBB was deemed trusted Only set in Signed Policy mode

func IBBMeasured added in v1.0.1

func IBBMeasured(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

IBBMeasured Verify that the IBB has been measured

func Ia32FeatureCtrl added in v1.0.1

func Ia32FeatureCtrl(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

Ia32FeatureCtrl Check IA_32FEATURE_CONTROL

func NPWModeIsNotSetInPS added in v1.0.1

func NPWModeIsNotSetInPS(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NPWModeIsNotSetInPS checks if NPW is activated or not

func NoBIOSACMErrors added in v1.0.1

func NoBIOSACMErrors(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NoBIOSACMErrors Check that the BIOS ACM has no startup error

func NoBIOSACMOverlap added in v1.0.1

func NoBIOSACMOverlap(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NoBIOSACMOverlap checks if BIOS ACM Entries Overlap

func NoIBBOverlap added in v1.0.1

func NoIBBOverlap(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NoIBBOverlap checks if BIOS Startup Module Entries overlap

func NoSINITErrors added in v1.0.1

func NoSINITErrors(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

NoSINITErrors checks if the SINITACM was executed without any errors

func PCR0IsSet added in v1.0.1

func PCR0IsSet(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

PCR0IsSet Reads PCR-00 and checks whether if it's not the EmptyDigest

func POIndexConfig added in v1.0.1

func POIndexConfig(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

POIndexConfig checks the PO index configuration

func POIndexHasValidLCP added in v1.0.1

func POIndexHasValidLCP(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

POIndexHasValidLCP checks if PO Index holds a valid LCP

func PSIndexConfig added in v1.0.1

func PSIndexConfig(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

PSIndexConfig tests if PS Index has correct configuration

func PSIndexHasValidLCP added in v1.0.1

func PSIndexHasValidLCP(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

PSIndexHasValidLCP checks if PS Index has a valid LCP

func PolicyAllowsTXT added in v1.0.1

func PolicyAllowsTXT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

PolicyAllowsTXT checks if Record matches TXT requirements.

func ReleaseFusedFSBI added in v1.0.1

func ReleaseFusedFSBI(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ReleaseFusedFSBI checks if the FSBI is release fused

func RunTestsSilent added in v1.0.1

func RunTestsSilent(TxtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration, Tests []*Test) (bool, string, error)

RunTestsSilent Runs the specified tests and returns false on the first error encountered

func SINITACMcomplyTPMSpec added in v1.0.1

func SINITACMcomplyTPMSpec(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITACMcomplyTPMSpec tests if the SINIT ACM complys with used TPM

func SINITInTXT added in v1.0.1

func SINITInTXT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITInTXT checks the TXT region on containing a valid SINIT ACM.

func SINITMatchesCPU added in v1.0.1

func SINITMatchesCPU(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITMatchesCPU checks if the SINITACM matches the CPU

func SINITMatchesChipset added in v1.0.1

func SINITMatchesChipset(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITMatchesChipset checks if the SINIT ACM matches the chipset.

func SINITandBIOSACMnoNPW added in v1.0.1

func SINITandBIOSACMnoNPW(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SINITandBIOSACMnoNPW checks that in BIOS integrated ACMs (SINIT, BIOS) are production worthy

func SMXIsEnabled added in v1.0.1

func SMXIsEnabled(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SMXIsEnabled not implemented

func ServerModeTXT added in v1.0.1

func ServerModeTXT(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ServerModeTXT checks if TXT runs in Servermode

func SupportVMX added in v1.0.1

func SupportVMX(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SupportVMX Check if CPU supports VMX

func SupportsSMX added in v1.0.1

func SupportsSMX(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

SupportsSMX Check if CPU supports SMX

func TPMConnect added in v1.0.1

func TPMConnect(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TPMConnect Connects to a TPM device (virtual or real)

func TPMIsPresent added in v1.0.1

func TPMIsPresent(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TPMIsPresent validates if one of the two previous tests succeeded

func TPMNVRAMIsLocked added in v1.0.1

func TPMNVRAMIsLocked(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TPMNVRAMIsLocked Checks if NVRAM indexes are write protected

func TXTDPRisLock added in v1.0.1

func TXTDPRisLock(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTDPRisLock checks the TXTRegister in memory about the status of DPR if it's locked.

func TXTHeapSpaceValid added in v1.0.1

func TXTHeapSpaceValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTHeapSpaceValid checks if the registers indicates the correct sizes

func TXTMemoryIsDPR added in v1.0.1

func TXTMemoryIsDPR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTMemoryIsDPR checks if the TXT DPR protects TXT memory.

func TXTModeValid added in v1.0.1

func TXTModeValid(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTModeValid checks if TXT is in valid mode

func TXTNotDisabled added in v1.0.1

func TXTNotDisabled(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTNotDisabled Check TXT_DISABLED bit in TXT_ACM_STATUS

func TXTPrivateReservedInE820 added in v1.0.1

func TXTPrivateReservedInE820(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTPrivateReservedInE820 checks if TXTPrivate area is marked reserved in e820 map

func TXTPublicReservedInE820 added in v1.0.1

func TXTPublicReservedInE820(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTPublicReservedInE820 checks if TXTPublic area is marked reserved in e820 map

func TXTRegisterSpaceAccessible added in v1.0.1

func TXTRegisterSpaceAccessible(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTRegisterSpaceAccessible Check if the TXT register space is accessible

func TXTRegistersLocked added in v1.0.1

func TXTRegistersLocked(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTRegistersLocked Verify that the TXT register space is locked

func TXTReservedInE820 added in v1.0.1

func TXTReservedInE820(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTReservedInE820 checks if the HEAP/MSEG/SINIT TXT regions are marked reserved in e820 map.

func TXTTPMDecodeSpaceIn820 added in v1.0.1

func TXTTPMDecodeSpaceIn820(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

TXTTPMDecodeSpaceIn820 checks if TPMDecode area is marked as reserved in e820 map

func ValidSMRR added in v1.0.1

func ValidSMRR(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

ValidSMRR checks if SMRR is valid

func WeybridgeOrLater added in v1.0.1

func WeybridgeOrLater(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (bool, error, error)

WeybridgeOrLater Check we're running on Weybridge

Types

type ACPIHeader added in v1.0.1

type ACPIHeader struct {
	Signature       [4]uint8
	Length          uint32
	Revision        uint8
	Checksum        uint8
	OEMID           [6]uint8
	OEMTableID      [8]uint8
	OEMRevision     uint32
	CreatorID       uint32
	CreatorRevision uint32
}

ACPIHeader represent the table header as defined in ACPI Spec 6.2 "5.2.6 System Description Table Header"

type ACPIMADT added in v1.0.1

type ACPIMADT struct {
	ACPIHeader
	LapicAddress uint32
	Flags        uint32
}

ACPIMADT represent the table header as defined in ACPI Spec 6.2 "Multiple APIC Description Table (MADT) Format"

type ACPIMADTDecoded added in v1.0.1

type ACPIMADTDecoded struct {
	LapicAddress   uint32
	Flags          uint32
	DecodedEntries []interface{}
}

ACPIMADTDecoded holds the decoded variable size MADT fields

func CheckMADTValidAndDecode added in v1.0.1

func CheckMADTValidAndDecode(txtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) (ACPIMADTDecoded, bool, error, error)

CheckMADTValidAndDecode tests if the MADT ACPI table is valid

type ACPIMADTEntryHeader added in v1.0.1

type ACPIMADTEntryHeader struct {
	Type   uint8
	Length uint8
}

ACPIMADTEntryHeader represent the table header for one MADT entry

type ACPIMADTIOAPIC added in v1.0.1

type ACPIMADTIOAPIC struct {
	IOAPICID                  uint8
	Reserved                  uint8
	Address                   uint32
	GlobalSystemInterruptBase uint32
}

ACPIMADTIOAPIC type 1

type ACPIMADTInterruptSourceOverride added in v1.0.1

type ACPIMADTInterruptSourceOverride struct {
	BusSource             uint8
	IRQSource             uint8
	GlobalSystemInterrupt uint32
	Flags                 uint16
}

ACPIMADTInterruptSourceOverride type 2

type ACPIMADTLocalAPICAddressOverwrite added in v1.0.1

type ACPIMADTLocalAPICAddressOverwrite struct {
	Reserved uint16
	Address  uint64
}

ACPIMADTLocalAPICAddressOverwrite type 5

type ACPIMADTLocalNonMaskableInterrupts added in v1.0.1

type ACPIMADTLocalNonMaskableInterrupts struct {
	APICID uint8
	Flags  uint16
	LINT   uint8
}

ACPIMADTLocalNonMaskableInterrupts type 4

type ACPIMADTLocalSAPIC added in v1.0.1

type ACPIMADTLocalSAPIC struct {
	ACPIProcessorID   uint8
	LocalSAPICID      uint8
	LocalSAPICEID     uint8
	Reserved          [3]uint8
	Flags             uint32
	ACPIProcessorUUID uint32
}

ACPIMADTLocalSAPIC type 7

type ACPIMADTLocalx2APIC added in v1.0.1

type ACPIMADTLocalx2APIC struct {
	Reserved          uint16
	X2ApicID          uint32
	Flags             uint32
	ACPIProcessorUUID uint32
}

ACPIMADTLocalx2APIC type 9

type ACPIMADTLocalx2APICNMI added in v1.0.1

type ACPIMADTLocalx2APICNMI struct {
	Flags             uint16
	ACPIProcessorUUID uint32
	Localx2APICLint   uint8
	Reserved          [3]uint8
}

ACPIMADTLocalx2APICNMI type 10

type ACPIMADTNMISource added in v1.0.1

type ACPIMADTNMISource struct {
	Flags                 uint16
	GlobalSystemInterrupt uint32
}

ACPIMADTNMISource type 3

type ACPIMADTProcessorLocalAPIC added in v1.0.1

type ACPIMADTProcessorLocalAPIC struct {
	APICProcessorID uint8
	APICID          uint8
	Flags           uint32
}

ACPIMADTProcessorLocalAPIC type 0

type ACPIMADTSAPIC added in v1.0.1

type ACPIMADTSAPIC struct {
	IOAPICID                  uint8
	Reserved                  uint8
	GlobalSystemInterruptBase uint32
	IOSAPICAddress            uint64
}

ACPIMADTSAPIC type 6

type ACPIRsdp added in v1.0.1

type ACPIRsdp struct {
	Signature        [8]uint8
	Checksum         uint8
	OEMID            [6]uint8
	Revision         uint8
	RSDTPtr          uint32
	RSDPLen          uint32
	XSDTPtr          uint64
	ExtendedChecksum uint8
	Reserved         [3]uint8
}

ACPIRsdp as defined in ACPI Spec 6.2 "5.2.5.3 Root System Description Pointer (RSDP) Structure"

type Result added in v1.0.1

type Result int

Result exposes the type for test results

const (
	// ResultNotRun indicates that a test was skipped
	ResultNotRun Result = iota

	// ResultDependencyFailed indicates that the previous dependency test failed
	ResultDependencyFailed

	// ResultInternalError indicates that a library function failed at some point in the test
	ResultInternalError

	// ResultFail indicates that the test failed
	ResultFail

	// ResultPass indicates that the test succeeded.
	ResultPass
)

func (Result) String added in v1.0.1

func (t Result) String() string

type Status added in v1.0.1

type Status int

Status exposes the type for test status

const (
	// Implemented indicates that a test is implemented completly
	Implemented Status = iota

	// NotImplemented indicates that test is NOT implemented
	NotImplemented

	// PartlyImplemented indicates that a test implements a certain aspect
	PartlyImplemented
)

func (Status) String added in v1.0.1

func (t Status) String() string

type TXTSpec added in v1.0.1

type TXTSpec int

TXTSpec exposes the type to differentiate between TXT specs

const (
	// TXT indicates
	TXT TXTSpec = iota

	// CBnT indicates
	CBnT

	// Common indicates
	Common
)

func (TXTSpec) String added in v1.0.1

func (t TXTSpec) String() string

type Test

type Test struct {
	Name     string
	Required bool

	Result Result

	ErrorText     string
	ErrorTextSpec string
	Status        Status
	Spec          TXTSpec
	// The chapter inside the spec used for this test
	SpecificationChapter string
	// The specification used in this test
	SpecificiationTitle     string
	SpecificationDocumentID string
	// contains filtered or unexported fields
}

Test exposes the structure in which information about TXT tests are held

func (*Test) Run

func (t *Test) Run(TxtAPI hwapi.LowLevelHardwareInterfaces, config *tools.Configuration) bool

Run implements the genereal test function and exposes it.

Jump to

Keyboard shortcuts

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