From 336ba6bc34252ee2c48cca2d52c2b07bfcdc628f Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:04:12 +0100 Subject: [PATCH] attestation: add Azure TDX variant Only a stub for now. --- internal/attestation/variant/variant.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/internal/attestation/variant/variant.go b/internal/attestation/variant/variant.go index 82fd1f1c99..c33ee1262f 100644 --- a/internal/attestation/variant/variant.go +++ b/internal/attestation/variant/variant.go @@ -44,6 +44,7 @@ const ( awsNitroTPM = "aws-nitro-tpm" awsSEVSNP = "aws-sev-snp" gcpSEVES = "gcp-sev-es" + azureTDX = "azure-tdx" azureSEVSNP = "azure-sev-snp" azureTrustedLaunch = "azure-trustedlaunch" qemuVTPM = "qemu-vtpm" @@ -206,6 +207,24 @@ func (GCPSEVES) Equal(other Getter) bool { return other.OID().Equal(GCPSEVES{}.OID()) } +// AzureTDX holds the OID for Azure TDX CVMs. +type AzureTDX struct{} + +// OID returns the struct's object identifier. +func (AzureTDX) OID() asn1.ObjectIdentifier { + return asn1.ObjectIdentifier{1, 3, 9900, 4, 3} +} + +// String returns the string representation of the OID. +func (AzureTDX) String() string { + return azureTDX +} + +// Equal returns true if the other variant is also AzureTDX. +func (AzureTDX) Equal(other Getter) bool { + return other.OID().Equal(AzureTDX{}.OID()) +} + // AzureSEVSNP holds the OID for Azure SNP CVMs. type AzureSEVSNP struct{}