# Functions
CreateTpm2EventLog generates a sample event log that is based on gceConfidentialTechnology.
GetSimulatorWithLog returns a simulated TPM with PCRs that match the events of the passed in eventlog.
GetTPM is a cross-platform testing helper function that retrives the appropriate TPM device from the flags passed into "go test".
LoadRandomExternalKey loads a randomly generated external key into the TPM simulator and returns its' handle.
SkipForRealTPM causes a test or benchmark to be skipped if we are not using a test TPM.
SkipOnUnsupportedAlg skips the test if the algorithm is not found in the TPM capability.
# Variables
PCR registers that are OK to use in tests (can be reset without reboot).
go:embed eventlogs/arch-linux-workstation.bin.
Kernel command lines from event logs.
go:embed eventlogs/cos-101-amd-sev.bin.
Kernel command lines from event logs.
go:embed eventlogs/cos-85-amd-sev.bin.
go:embed attestations/gce-cos-85-nonce9009.pb.
go:embed attestations/gce-cos-85-no-nonce.pb.
Kernel command lines from event logs.
go:embed eventlogs/cos-93-amd-sev.bin.
go:embed eventlogs/debian-10.bin.
PCR registers that are OK to use in tests (can be reset without reboot).
GCECertPEMs provides a variety of GCE test certificates, including AK/EK, RSA/ECC, and PCA/UCA.
go:embed certificates/pca_tpm_ecc_enc_cert.pem.
go:embed certificates/uca_tpm_ecc_enc_cert.pem.
go:embed certificates/pca_tpm_rsa_enc_cert.pem.
go:embed certificates/uca_tpm_rsa_enc_cert.pem.
go:embed certificates/pca_tpm_ecc_sign_cert.pem.
go:embed certificates/uca_tpm_ecc_sign_cert.pem.
go:embed certificates/pca_tpm_rsa_sign_cert.pem.
go:embed certificates/uca_tpm_rsa_sign_cert.pem.
go:embed eventlogs/glinux-alex.bin.
go:embed eventlogs/rhel8-uefi.bin.
Use as tdx nonce.
go:embed eventlogs/ubuntu-1804-amd-sev.bin.
go:embed eventlogs/ubuntu-2104-no-dbx.bin.
go:embed eventlogs/ubuntu-2104-no-secure-boot.bin.