attest

package
v0.0.0-...-3430805 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NUM_RTMRS = 4
)

Variables

This section is empty.

Functions

func GetRtmrValue

func GetRtmrValue(logs []string) []byte

func VerifyQuote

func VerifyQuote(verifier, quote string) (bool, error)

func VerifyRtmr

func VerifyRtmr(quote []byte, logs []string) (bool, error)

func WriteQuote

func WriteQuote(filename string, quote []byte) error

Types

type AttestData

type AttestData struct {
	ApiVersion      string                                `json:"api_version"`
	RequestorNonce  []byte                                `json:"requestor_nonce"`
	AcondNonce      []byte                                `json:"acond_nonce"`
	AttestationData map[string]map[uint32]AttestDataValue `json:"attestation_data"`
}

func ParseAttestData

func ParseAttestData(data []byte) (*AttestData, error)

type AttestDataValue

type AttestDataValue struct {
	Type int32  `json:"type"`
	Data string `json:"data"`
}

type ReportMac

type ReportMac struct {
	ReportType
	Reserved0      [12]byte
	CpuSvn         [16]byte
	TeeTcbInfoHash TeeMeasurement
	TeeInfoHash    TeeMeasurement
	ReportData     TeeReportData
	Reserved1      [32]byte
	Mac            [32]byte
}

type ReportType

type ReportType struct {
	Type     byte
	Subtype  byte
	Version  byte
	Reserved byte
}

type SGXQuote4

type SGXQuote4 struct {
	Header     SGXQuote4Header `json:"header"`
	ReportBody SGXReport2Body  `json:"reportBody"`
	SigDataLen uint32          `json:"-"`
}

func ParseQuote

func ParseQuote(quote []byte) (*SGXQuote4, error)

type SGXQuote4Header

type SGXQuote4Header struct {
	Version    uint16   `json:"version"`
	AttKeyType uint16   `json:"-"`
	TeeType    uint32   `json:"teeType"`
	Reserved   uint32   `json:"-"`
	VendorId   [16]byte `json:"-"`
	UserData   [20]byte `json:"-"`
}

type SGXReport2Body

type SGXReport2Body struct {
	TeeTcbSvn      [16]byte                  `json:"-"`
	MrSeam         TeeMeasurement            `json:"-"`
	MrSignerSeam   TeeMeasurement            `json:"-"`
	SeamAttributes TeeAttributes             `json:"-"`
	TdAttributes   TeeAttributes             `json:"-"`
	Xfam           TeeAttributes             `json:"-"`
	MrTd           TeeMeasurement            `json:"-"`
	MrConfigId     TeeMeasurement            `json:"-"`
	MrOwner        TeeMeasurement            `json:"-"`
	MrOwnerConfig  TeeMeasurement            `json:"-"`
	Rtmr           [NUM_RTMRS]TeeMeasurement `json:"rtmr"`
	ReportData     TeeReportData             `json:"reportData"`
}

type TdInfo

type TdInfo struct {
	Attributes    TeeAttributes             // TD's attributes
	Xfam          TeeAttributes             // TD's XFAM
	Mrtd          TeeMeasurement            // Measurement of initial contents of the TD
	MrConfigId    TeeMeasurement            // Software-defined ID for non-owner-defined configuration of the guest TD
	MrOwner       TeeMeasurement            // Software-defined ID for the guest TD's owner
	MrOwnerConfig TeeMeasurement            // Software-defined ID for owner-defined configuration of the guest TD
	Rtmr          [NUM_RTMRS]TeeMeasurement // Array of NUM_RTMRS(4) run-time extendable measurement registers
	ServTdHash    TeeMeasurement
	Reserved      [64]byte
}

type TdReport

type TdReport struct {
	ReportMac
	TeeTcbInfo
	Reserved [17]byte
	TdInfo
}

type TeeAttributes

type TeeAttributes struct {
	A [2]uint32
}

func (TeeAttributes) String

func (a TeeAttributes) String() string

type TeeMeasurement

type TeeMeasurement struct {
	M [48]byte
}

func (TeeMeasurement) MarshalJSON

func (m TeeMeasurement) MarshalJSON() ([]byte, error)

func (TeeMeasurement) String

func (m TeeMeasurement) String() string

type TeeReportData

type TeeReportData struct {
	D [64]byte
}

func (TeeReportData) MarshalJSON

func (r TeeReportData) MarshalJSON() ([]byte, error)

type TeeTcbInfo

type TeeTcbInfo struct {
	Data [239]byte
}

Jump to

Keyboard shortcuts

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