client

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package client provides the library functions to get a TDX quote from the TDX guest device

Package client provides an interface to the Intel TDX guest device commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQuote

func GetQuote(quoteProvider any, reportData [64]byte) (any, error)

GetQuote uses Quote provider or Device(deprecated) to get the quote in byte array and convert it into proto. Supported quote formats - QuoteV4.

func GetRawQuote

func GetRawQuote(quoteProvider any, reportData [64]byte) ([]uint8, error)

GetRawQuote uses Quote provider or Device(deprecated) to get the quote in byte array.

func UseDefaultTdxGuestDevice

func UseDefaultTdxGuestDevice() bool

UseDefaultTdxGuestDevice returns true if tdxGuestPath=default.

Types

type Device

type Device interface {
	Open(path string) error
	Close() error
	Ioctl(command uintptr, argument any) (uintptr, error)
}

Device encapsulates the possible commands to the TDX guest device. Deprecated: The Device interface is deprecated, and use of quote provider interface is recommended for fetching attestation quote.

type LinuxConfigFsQuoteProvider added in v0.3.0

type LinuxConfigFsQuoteProvider struct{}

LinuxConfigFsQuoteProvider implements the QuoteProvider interface to fetch attestation quote via ConfigFS.

func GetQuoteProvider added in v0.3.0

func GetQuoteProvider() (*LinuxConfigFsQuoteProvider, error)

GetQuoteProvider returns an instance of LinuxConfigFsQuoteProvider.

func (*LinuxConfigFsQuoteProvider) GetRawQuote added in v0.3.0

func (p *LinuxConfigFsQuoteProvider) GetRawQuote(reportData [64]byte) ([]uint8, error)

GetRawQuote returns byte format attestation quote via ConfigFS.

func (*LinuxConfigFsQuoteProvider) IsSupported added in v0.3.0

func (p *LinuxConfigFsQuoteProvider) IsSupported() error

IsSupported checks if TSM client can be created to use ConfigFS system.

type LinuxDevice

type LinuxDevice struct {
	// contains filtered or unexported fields
}

LinuxDevice implements the Device interface with Linux ioctls.

func OpenDevice

func OpenDevice() (*LinuxDevice, error)

OpenDevice opens the TDX guest device.

func (*LinuxDevice) Close

func (d *LinuxDevice) Close() error

Close closes the TDX guest device.

func (*LinuxDevice) Ioctl

func (d *LinuxDevice) Ioctl(command uintptr, req any) (uintptr, error)

Ioctl sends a command with its wrapped request and response values to the Linux device.

func (*LinuxDevice) Open

func (d *LinuxDevice) Open(path string) error

Open opens the TDX guest device from a given path

type QuoteProvider added in v0.3.0

type QuoteProvider interface {
	IsSupported() error
	GetRawQuote(reportData [64]byte) ([]uint8, error)
}

QuoteProvider encapsulates calls to attestation quote.

Directories

Path Synopsis
Package linuxabi describes the ABI required for the TDX ioctl commands
Package linuxabi describes the ABI required for the TDX ioctl commands

Jump to

Keyboard shortcuts

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