Documentation ¶
Overview ¶
Package abi provides Go representations and conversions for TDX attestation data structures
Index ¶
- Constants
- Variables
- func CheckQuoteV4(quote *pb.QuoteV4) error
- func EnclaveReportToAbiBytes(report *pb.EnclaveReport) ([]byte, error)
- func HeaderToAbiBytes(header *pb.Header) ([]byte, error)
- func QuoteToAbiBytes(quote any) ([]byte, error)
- func QuoteToProto(b []uint8) (any, error)
- func SignatureToDER(x []byte) ([]byte, error)
- func TdQuoteBodyToAbiBytes(tdQuoteBody *pb.TDQuoteBody) ([]byte, error)
Constants ¶
const ( // QuoteMinSize is the minimum specified size of TDX generated quote QuoteMinSize = 0x3FC // QuoteVersion currently in support QuoteVersion = 4 // AttestationKeyType supported value AttestationKeyType = 2 // (ECDSA-256-with-P-256 curve) // TeeTDX for Attestation TeeTDX = 0x00000081 // TeeTcbSvnSize is the size of TEE_TCB_SVN field in TdQuoteBody TeeTcbSvnSize = 0x10 // MrSeamSize is the size of MR_SEAM field in TdQuoteBody MrSeamSize = 0x30 // TdAttributesSize is the size of TD_ATTRIBUTES field in TdQuoteBody TdAttributesSize = 0x08 // XfamSize is the size of XFAM field in TdQuoteBody XfamSize = 0x08 // MrTdSize is the size of MR_TD field in TdQuoteBody MrTdSize = 0x30 // MrConfigIDSize is the size of MR_CONFIG_ID field in TdQuoteBody MrConfigIDSize = 0x30 // MrOwnerSize is the size of MR_OWNER field in TdQuoteBody MrOwnerSize = 0x30 // MrOwnerConfigSize is the size of MR_OWNER_CONFIG field in TdQuoteBody MrOwnerConfigSize = 0x30 // RtmrSize is the size of Runtime extendable measurement register RtmrSize = 0x30 // ReportDataSize is the size of ReportData field in TdQuoteBody ReportDataSize = 0x40 // QeVendorIDSize is the size of QeVendorID field in Header QeVendorIDSize = 0x10 )
Variables ¶
var ( // ErrQuoteNil error returned when Quote is nil ErrQuoteNil = errors.New("quote is nil") // ErrQuoteV4Nil error returned when QuoteV4 is nil ErrQuoteV4Nil = errors.New("QuoteV4 is nil") // ErrQuoteV4AuthDataNil error returned when QuoteV4 Auth Data is nil ErrQuoteV4AuthDataNil = errors.New("QuoteV4 authData is nil") // ErrCertificationDataNil error returned when Certification Data is nil ErrCertificationDataNil = errors.New("certification data is nil") // ErrQeReportCertificationDataNil error returned when QE report certification data is nil ErrQeReportCertificationDataNil = errors.New("QE Report certification data is nil") // ErrQeAuthDataNil error returned when QE Auth Data is nil ErrQeAuthDataNil = errors.New("QE AuthData is nil") // ErrQeReportNil error returned when QE Report is nil ErrQeReportNil = errors.New("QE Report is nil") // ErrPckCertChainNil error returned when PCK Certificate Chain is nil ErrPckCertChainNil = errors.New("PCK certificate chain is nil") // ErrTDQuoteBodyNil error returned when TD quote body is nil ErrTDQuoteBodyNil = errors.New("TD quote body is nil") // ErrTeeType error returned when TEE type is not TDX ErrTeeType = errors.New("TEE type is not TDX") // ErrAttestationKeyType error returned when attestation key is not of expected type ErrAttestationKeyType = errors.New("attestation key type not supported") // ErrHeaderNil error returned when header is nil ErrHeaderNil = errors.New("header is nil") )
Functions ¶
func CheckQuoteV4 ¶
CheckQuoteV4 validates a quote protobuf by ensuring all parameters meet their required size
func EnclaveReportToAbiBytes ¶
func EnclaveReportToAbiBytes(report *pb.EnclaveReport) ([]byte, error)
EnclaveReportToAbiBytes translates the EnclaveReport back into its little-endian ABI format
func HeaderToAbiBytes ¶
HeaderToAbiBytes translates the Header back into its little-endian ABI format
func QuoteToAbiBytes ¶
QuoteToAbiBytes translates the Quote back into its little-endian ABI format. Supported quote formats - QuoteV4.
func QuoteToProto ¶
QuoteToProto creates a Quote from the Intel's attestation quote byte array in Intel's ABI format. Supported quote formats - QuoteV4.
func SignatureToDER ¶
SignatureToDER converts the signature to DER format
func TdQuoteBodyToAbiBytes ¶
func TdQuoteBodyToAbiBytes(tdQuoteBody *pb.TDQuoteBody) ([]byte, error)
TdQuoteBodyToAbiBytes translates the TDQuoteBody back into its little-endian ABI format
Types ¶
This section is empty.