Documentation ¶
Index ¶
Constants ¶
const ( SNPSECMEM SectionType = iota + 1 SNPSecrets CPUID SNPKernelHashes SectionType = 0x10 FOUR_GB = 0x100000000 OVMF_TABLE_FOOTER_GUID = "96b582de-1fb2-45f7-baea-a366c55a082d" SEV_HASH_TABLE_RV_GUID = "7255371f-3a3b-4b04-927b-1da6efa8d454" SEV_ES_RESET_BLOCK_GUID = "00f771de-1a7e-4fcb-890e-68c77e2fb44e" OVMF_SEV_META_DATA_GUID = "dc886566-984a-4798-a75e-5585a7bf67cc" )
Variables ¶
This section is empty.
Functions ¶
func LittleEndianBytes ¶
Types ¶
type FooterTableEntry ¶
type FooterTableEntry struct {}
func NewFooterTableEntry ¶
func NewFooterTableEntry(data []byte) (*FooterTableEntry, error)
type MetadataHeader ¶
type MetadataHeader struct { Signature [4]uint8 // Size describes how big the metadata section is. Size uint32 Version uint32 // NumItems describes how many MetadataSection items there are. NumItems uint32 }
func NewMetadataHeader ¶
func NewMetadataHeader(data []byte) (*MetadataHeader, error)
func (*MetadataHeader) Verify ¶
func (h *MetadataHeader) Verify() error
type MetadataSection ¶
type MetadataSection struct { // GPA is the Guest Physical Adress of the page. The GPA becomes part of the launch digest. GPA uint32 Size uint32 // SectionTypeInt is the Section Type of the described page. The type becomes part of the launch digest. SectionTypeInt uint32 }
func NewMetadataSectionDesc ¶
func NewMetadataSectionDesc(data []byte) (*MetadataSection, error)
func (*MetadataSection) MarshalJSON ¶
func (m *MetadataSection) MarshalJSON() ([]byte, error)
MarshalJSON is a custom marshaller for MetadataSection. It converts the GPA and Size to hex strings.
func (*MetadataSection) SectionType ¶
func (o *MetadataSection) SectionType() (SectionType, error)
func (*MetadataSection) UnmarshalJSON ¶
func (m *MetadataSection) UnmarshalJSON(data []byte) error
UnmarshalJSON is a custom unmarshaller for MetadataSection. It converts the GPA and Size from hex strings.
type MetadataWrapper ¶
type MetadataWrapper struct { MetadataItems []MetadataSection ResetEIP uint32 OVMFHash []byte }
MetadataWrapper replaces the OVMF binary when using an OVMF hash. It contains the metadata items and the reset EIP that have been parsed from the binary before.
func NewMetadataWrapper ¶
func NewMetadataWrapper(ovmf OVMF, ovmfHash []byte) (*MetadataWrapper, error)
func (*MetadataWrapper) MarshalJSON ¶
func (m *MetadataWrapper) MarshalJSON() ([]byte, error)
MarshalJSON is a custom marshaller for MetadataSection. It converts the GPA and Size to hex strings.
func (*MetadataWrapper) UnmarshalJSON ¶
func (m *MetadataWrapper) UnmarshalJSON(data []byte) error
UnmarshalJSON is a custom unmarshaller for MetadataSection. It converts the GPA and Size from hex strings.
type OVMF ¶
type OVMF struct {
// contains filtered or unexported fields
}
func NewFromAPIObject ¶
func NewFromAPIObject(apiObject MetadataWrapper) (OVMF, error)
NewFromAPIObject creates an OVMF object from an APIObject. This OVMF object can only be used in conjunction with a OVMF Hash, as the data property is not
func (*OVMF) MetadataItems ¶
func (o *OVMF) MetadataItems() []MetadataSection
func (*OVMF) SevESResetEIP ¶
type SectionType ¶
type SectionType int