response

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package response contains commonly used constructs for NSM responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	Document []byte `cbor:"document" json:"document,omitempty"`
}

An Attestation response.

type DescribeNSM

type DescribeNSM struct {
	VersionMajor uint16   `cbor:"version_major" json:"version_major,omitempty"`
	VersionMinor uint16   `cbor:"version_minor" json:"version_minor,omitempty"`
	VersionPatch uint16   `cbor:"version_patch" json:"version_patch,omitempty"`
	ModuleID     string   `cbor:"module_id" json:"module_id,omitempty"`
	MaxPCRs      uint16   `cbor:"max_pcrs" json:"max_pcrs,omitempty"`
	LockedPCRs   []uint16 `cbor:"locked_pcrs" json:"digest,omitempty"`
	Digest       Digest   `cbor:"digest" json:"digest,omitempty"`
}

A DescribeNSM response.

type DescribePCR

type DescribePCR struct {
	Lock bool   `cbor:"lock" json:"lock,omitempty"`
	Data []byte `cbor:"data" json:"data,omitempty"`
}

A DescribePCR response.

type Digest

type Digest string

A Digest name.

const (
	DigestSHA256 Digest = "SHA256"
	DigestSHA384 Digest = "SHA384"
	DigestSHA512 Digest = "SHA512"
)

Commonly ocurring digest names.

type ErrorCode

type ErrorCode string

An ErrorCode string.

const (
	ECSuccess          ErrorCode = "Success"
	ECInvalidArgument  ErrorCode = "InvalidArgument"
	ECInvalidResponse  ErrorCode = "InvalidResponse"
	ECReadOnlyIndex    ErrorCode = "ReadOnlyIndex"
	ECInvalidOperation ErrorCode = "InvalidOperation"
	ECBufferTooSmall   ErrorCode = "BufferTooSmall"
	ECInputTooLarge    ErrorCode = "InputTooLarge"
	ECInternalError    ErrorCode = "InternalError"
)

Commonly ocurring error codes.

type ExtendPCR

type ExtendPCR struct {
	Data []byte `cbor:"data" json:"data,omitempty"`
}

An ExtendPCR response.

type GetRandom

type GetRandom struct {
	Random []byte `cbor:"random" json:"random,omitempty"`
}

A GetRandom response.

type LockPCR

type LockPCR struct {
}

A LockPCR response. Presence on a `Request` confirms PCR has been locked.

type LockPCRs

type LockPCRs struct {
}

A LockPCRs response. Presence on a `Request` confirms PCRs have been locked.

type Response

type Response struct {
	DescribePCR *DescribePCR `json:"DescribePCR,omitempty"`
	ExtendPCR   *ExtendPCR   `json:"ExtendPCR,omitempty"`
	LockPCR     *LockPCR     `json:"LockPCR,omitempty"`
	LockPCRs    *LockPCRs    `json:"LockPCRs,omitempty"`
	DescribeNSM *DescribeNSM `json:"DescribeNSM,omitempty"`
	Attestation *Attestation `json:"Attestation,omitempty"`
	GetRandom   *GetRandom   `json:"GetRandom,omitempty"`

	Error ErrorCode `json:"Error,omitempty"`
}

A Response structure. One and only one field is set at any time. Always check the Error field first.

func (*Response) UnmarshalCBOR

func (res *Response) UnmarshalCBOR(data []byte) error

UnmarshalCBOR function to correctly unmarshal the CBOR encoding according to Rust's cbor serde implementation.

Jump to

Keyboard shortcuts

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