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 ¶
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.
Click to show internal directories.
Click to hide internal directories.