analyze

package
v0.0.0-...-f44e450 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: BSD-3-Clause Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

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

Command is the implementation of `commands.Command`.

func (Command) Description

func (cmd Command) Description() string

Description explains what this verb commands to do

func (Command) DumpRequestFormat

func (cmd Command) DumpRequestFormat() (DumpFormat, error)

DumpRequestFormat returns required Analyze request dump format or an error

func (Command) EventLog

func (cmd Command) EventLog() (*tpmeventlog.TPMEventLog, error)

EventLog returns a parsed TPM Event Log defined by path through flag '-event-log'.

func (Command) Execute

func (cmd Command) Execute(ctx context.Context, cfg commands.Config, args []string) error

Execute is the main function here. It is responsible to start the execution of the command.

`args` are the arguments left unused by verb itself and options.

func (Command) ExpectPCR0

func (cmd Command) ExpectPCR0() ([]byte, bool, error)

ExpectPCR0 returns a PCR0 defined by path flag '-expect-pcr0' and '-localhost'

func (Command) FirmwareVersion

func (cmd Command) FirmwareVersion(ctx context.Context, actualFirmware []byte, actualImageMetaData *afas.FirmwareImageMetadata) ([]afas.FirmwareVersion, error)

FirmwareVersion returns information about firmware version based on flags '-firmware-version' and '-localhost' as well as optional input args

func (Command) FirmwarewandOptions

func (cmd Command) FirmwarewandOptions() []firmwarewand.Option

FirmwarewandOptions returns firmwarewand.Option slice which should be used according to passed flags.

func (Command) FlagFlow

func (cmd Command) FlagFlow() (pcr.Flow, error)

FlagFlow returns the value of the flag "flow"

func (Command) FlagUseRequest

func (cmd Command) FlagUseRequest(ctx context.Context) (*afas.AnalyzeRequest, error)

FlagUseRequest parses the file defined in `-use-request` as the AnalyzeRequest to be sent. Returns nil (without error) if the flag is empty. TODO: consider splitting `analyze` to `scan` and `analyze`

func (Command) OutputTemplate

func (cmd Command) OutputTemplate() (*template.Template, error)

OutputTemplate returns the template for output (or nil if it is not set).

func (Command) Registers

func (cmd Command) Registers() (registers.Registers, bool, error)

Registers returns status registers according to flag '-registers' and '-localhost'

func (*Command) SetupFlagSet

func (cmd *Command) SetupFlagSet(flag *flag.FlagSet)

SetupFlagSet is called to allow the command implementation to setup which option flags it has.

func (Command) TPMDevice

func (cmd Command) TPMDevice() (tpmdetection.Type, bool, error)

TPMDevice returns TPM device according to flag '-tpm-device' and '-localhost'

func (Command) Usage

func (cmd Command) Usage() string

Usage prints the syntax of arguments for this command

type DumpFormat

type DumpFormat string

DumpFormat specifies dump options

const (
	// DumpFormatNone means do not dump
	DumpFormatNone DumpFormat = ""
	// DumpFormatJSON means to dump in json format
	DumpFormatJSON DumpFormat = "json"
	// DumpFormatBinary means to dump in binary (base64 encoded) format
	DumpFormatBinary DumpFormat = "binary"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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