native

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package native implements OS-specific methods required by Device Trust. Callers outside the devicetrust package should prefer one of the specialized subpackages, such as enroll or authn, instead of using this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectDeviceData

func CollectDeviceData(mode CollectDataMode) (*devicepb.DeviceCollectedData, error)

CollectDeviceData collects OS-specific device data for device enrollment or device authentication ceremonies.

func EnrollDeviceInit

func EnrollDeviceInit() (*devicepb.EnrollDeviceInit, error)

EnrollDeviceInit creates the initial enrollment data for the device. This includes fetching or creating a device credential, collecting device data and filling in any OS-specific fields.

func GetDeviceCredential

func GetDeviceCredential() (*devicepb.DeviceCredential, error)

GetDeviceCredential returns the current device credential, if it exists.

func GetDeviceOSType

func GetDeviceOSType() devicepb.OSType

GetDeviceOSType returns the devicepb.OSType for the current OS

func HandleTPMActivateCredential

func HandleTPMActivateCredential(encryptedCredential, encryptedCredentialSecret string) error

HandleTPMActivateCredential completes the credential activation part of an enrollment challenge. This is usually called in an elevated process that's created by SolveTPMEnrollChallenge.

func SignChallenge

func SignChallenge(chal []byte) (sig []byte, err error)

SignChallenge signs a device challenge for device enrollment or device authentication ceremonies.

func SolveTPMAuthnDeviceChallenge

SolveTPMAuthnDeviceChallenge completes a TPM device authetication challenge.

func SolveTPMEnrollChallenge

func SolveTPMEnrollChallenge(challenge *devicepb.TPMEnrollChallenge, debug bool) (*devicepb.TPMEnrollChallengeResponse, error)

SolveTPMEnrollChallenge completes a TPM enrollment challenge.

Types

type CollectDataMode

type CollectDataMode int

CollectDataMode is the mode of collection used by CollectDeviceData.

const (
	// CollectedDataNeverEscalate will never escalate privileges, even in the
	// absence of cached data.
	CollectedDataNeverEscalate CollectDataMode = iota
	// CollectedDataMaybeEscalate will attempt to use cached DMI data before
	// privilege escalation, but it may choose to escalate if no cached data is
	// available.
	//
	// Used by `tsh login` and similar operations (ie, device authn).
	CollectedDataMaybeEscalate
	// CollectedDataAlwaysEscalate avoids using cached DMI data and instead will
	// always escalate privileges if necessary.
	//
	// Used by `tsh device enroll`, `tsh device collect` and
	// `tsh device asset-tag`.
	CollectedDataAlwaysEscalate
)

Jump to

Keyboard shortcuts

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