config

package
v0.0.0-...-cd6dd1c Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DatabasePath string
)

Functions

func HasConfigurationFile

func HasConfigurationFile(fs afero.Fs, file string) bool

func HasOldConfig

func HasOldConfig(fs afero.Fs, dir string) bool

Types

type Config

type Config struct {
	Landlock    bool          `json:"landlock"`
	Keydir      string        `json:"keydir"`
	GUID        string        `json:"guid"`
	FilesDb     string        `json:"files_db"`
	BundlesDb   string        `json:"bundles_db"`
	DbAdditions []string      `json:"db_additions,omitempty"`
	Files       []*FileConfig `json:"files,omitempty"`
	Keys        *Keys         `json:"keys"`
}

Note: Anything serialized as part of this struct will end up in a public debug dump at some point, probably.

func DefaultConfig

func DefaultConfig() *Config

func MkConfig

func MkConfig(dir string) *Config

func NewConfig

func NewConfig(b []byte) (*Config, error)

func OldConfig

func OldConfig(dir string) *Config

func (*Config) GetGUID

func (c *Config) GetGUID(vfs afero.Fs) (*util.EFIGUID, error)

type FileConfig

type FileConfig struct {
	Path   string `json:"path"`
	Output string `json:"output,omitempty"`
}

type KeyConfig

type KeyConfig struct {
	Privkey     string `json:"privkey"`
	Pubkey      string `json:"pubkey"`
	Type        string `json:"type"`
	Description string `json:"description,omitempty"`
}

type Keys

type Keys struct {
	PK  *KeyConfig `json:"pk"`
	KEK *KeyConfig `json:"kek"`
	Db  *KeyConfig `json:"db"`
}

func (*Keys) GetKeysConfigs

func (k *Keys) GetKeysConfigs() []*KeyConfig

type State

type State struct {
	Fs       afero.Fs
	TPM      func() transport.TPMCloser
	Config   *Config
	Efivarfs *efivarfs.Efivarfs
}

Key creation is going to require differen callbacks to we abstract them away

func (*State) HasLandlock

func (s *State) HasLandlock() bool

func (*State) HasTPM

func (s *State) HasTPM() bool

func (*State) IsInstalled

func (s *State) IsInstalled() bool

func (*State) MarshalJSON

func (s *State) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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