integrity

package
v0.0.0-...-55306fc Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// For now that the header only includes a fixed-size string and a fixed-size hash,
	// the header size is always gonna be less than blockSize and will always get aligned
	// to blockSize.
	HeaderSize = 4096
)

Variables

This section is empty.

Functions

func GenerateAndAppend

func GenerateAndAppend(snapPath string) (err error)

GenerateAndAppend generates integrity data for a snap file and appends them to it. Integrity data are formed from a fixed-size header aligned to blockSize which includes the root hash followed by the generated dm-verity hash data.

Types

type IntegrityDataHeader

type IntegrityDataHeader struct {
	Type     string        `json:"type"`
	Size     uint64        `json:"size,string"`
	DmVerity dmverity.Info `json:"dm-verity"`
}

IntegrityDataHeader gets appended first at the end of a squashfs packed snap before the dm-verity data. Size field includes the header size

func (*IntegrityDataHeader) Decode

func (integrityDataHeader *IntegrityDataHeader) Decode(input []byte) error

Decode unserializes an null-terminated byte array containing JSON data to an IntegrityDataHeader struct.

func (IntegrityDataHeader) Encode

func (integrityDataHeader IntegrityDataHeader) Encode() ([]byte, error)

Encode serializes an IntegrityDataHeader struct to a null terminated json string.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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