launch

package
v0.0.0-...-32e759c Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrElfNoPie = fmt.Errorf("%w: ELF image is not a PIE or shared object", ErrOEInvalidImg)

ErrElfNoPie is an Open Enclave error where the ELF image is not a PIE or shared object. This likely occures if a binary is run which was not built with ego-go.

View Source
var ErrEnclIniFailInvalidMeasurement = fmt.Errorf("%w: enclave_initialize failed: ENCLAVE_INVALID_MEASUREMENT", ErrOEPlatform)

ErrEnclIniFailInvalidMeasurement is an Open Enclave error where enclave_initialize fails with error code 0x5. This likely occurs if the signature of the binary is invalid and the binary needs to be resigned.

View Source
var ErrEnclIniFailUnexpected = fmt.Errorf("%w: enclave_initialize failed: ENCLAVE_UNEXPECTED", ErrOEPlatform)

ErrEnclIniFailUnexpected is an Open Enclave error where enclave_initialize fails with error code 0x1001. On non-FLC systems this occurs if the libsgx-launch package is not installed.

View Source
var ErrExtUnknown = errors.New("unknown external error")

ErrExtUnknown is a unknown error from an external tool.

View Source
var ErrLoadDataFailUnexpected = fmt.Errorf("%w: enclave_load_data failed: ENCLAVE_UNEXPECTED", ErrOEPlatform)

ErrLoadDataFailUnexpected is an Open Enclave error where enclave_load_data fails with error code 0x1001.

View Source
var ErrOECrypto = errors.New("OE_CRYPTO_ERROR")

ErrOECrypto is a representation of Open Enclaves OE_CRYPTO_ERROR return code.

View Source
var ErrOEFailure = errors.New("OE_FAILURE")

ErrOEFailure is a representation of Open Enclaves OE_FAILURE return code.

View Source
var ErrOEInvalidImg = errors.New("OE_INVALID_IMAGE")

ErrOEInvalidImg is a representation of Open Enclaves OE_INVALID_IMAGE return code.

View Source
var ErrOEPlatform = errors.New("OE_PLATFORM_ERROR")

ErrOEPlatform is a representation of Open Enclaves OE_PLATFORM_ERROR return code.

View Source
var ErrSGXOpenFail = fmt.Errorf("%w: Failed to open Intel SGX device", ErrOEPlatform)

ErrSGXOpenFail is an Open Enclave error where OE failes to open the Intel SGX device. This likely occures if a system does not support SGX or the required module is missing.

View Source
var ErrValidAttr0 = fmt.Errorf("%w: oe_sgx_is_valid_attributes failed: attributes = 0", ErrOEFailure)

ErrValidAttr0 is an Open Enclave error where oe_sgx_is_valid_attributes fails. This likely occures if an unsigned binary is run.

Functions

func RunEnclave

func RunEnclave(filename string, args []string, egoHostFilename string, egoEnclaveFilename string, runner Runner) (int, error)

RunEnclave launches an user EGo enclave.

func RunEnclaveMarblerun

func RunEnclaveMarblerun(filename string, egoHostFilename string, egoEnclaveFilename string, runner Runner) (int, error)

RunEnclaveMarblerun launches an user EGo enclave in MarbleRun mode, calling into MarbleRun's premain before launching user code.

func UntarGzip

func UntarGzip(fs afero.Fs, r io.Reader, dst string) error

UntarGzip unpacks a gzip-packed tar archive to the given path. Adapted from: https://medium.com/@skdomino/taring-untaring-files-in-go-6b07cf56bc07

Types

type OsRunner

type OsRunner struct{}

OsRunner wraps Cmd objects from the real host system, not an unit test environment.

func (OsRunner) CombinedOutput

func (OsRunner) CombinedOutput(cmd *exec.Cmd) ([]byte, error)

CombinedOutput for OsRunner redirects to cmd.CombinedOutput()

func (OsRunner) ExitCode

func (OsRunner) ExitCode(cmd *exec.Cmd) int

ExitCode for OsRunner redirects to cmd.ProcessState.ExitCode()

func (OsRunner) Output

func (OsRunner) Output(cmd *exec.Cmd) ([]byte, error)

Output for OsRunner redirects to cmd.Output()

func (OsRunner) Run

func (OsRunner) Run(cmd *exec.Cmd) error

Run for OsRunner redirects to cmd.Run()

type Runner

type Runner interface {
	Run(cmd *exec.Cmd) error
	Output(cmd *exec.Cmd) ([]byte, error)
	CombinedOutput(cmd *exec.Cmd) ([]byte, error)
	ExitCode(cmd *exec.Cmd) int
}

Runner runs Cmd objects.

Jump to

Keyboard shortcuts

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