Documentation
¶
Index ¶
- Constants
- type Hash
- func (s *Hash) DigestOffset() uint64
- func (s *Hash) DigestTotalSize() uint64
- func (s *Hash) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string
- func (s *Hash) ReadFrom(r io.Reader) (int64, error)
- func (s *Hash) Rehash()
- func (s *Hash) RehashRecursive()
- func (s *Hash) TotalSize() uint64
- func (s *Hash) UsageOffset() uint64
- func (s *Hash) UsageTotalSize() uint64
- func (s *Hash) Validate() error
- func (s *Hash) WriteTo(w io.Writer) (int64, error)
- type Manifest
- func (s *Manifest) GetStructInfo() cbnt.StructInfo
- func (s *Manifest) HashOffset() uint64
- func (s *Manifest) HashTotalSize() uint64
- func (s *Manifest) KMIDOffset() uint64
- func (s *Manifest) KMIDTotalSize() uint64
- func (s *Manifest) KMSVNOffset() uint64
- func (s *Manifest) KMSVNTotalSize() uint64
- func (s *Manifest) KeyAndSignatureOffset() uint64
- func (s *Manifest) KeyAndSignatureTotalSize() uint64
- func (s *Manifest) KeyManifestSignatureOffsetOffset() uint64
- func (s *Manifest) KeyManifestSignatureOffsetTotalSize() uint64
- func (s *Manifest) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string
- func (m *Manifest) Print()
- func (s *Manifest) PubKeyHashAlgOffset() uint64
- func (s *Manifest) PubKeyHashAlgTotalSize() uint64
- func (s *Manifest) ReadDataFrom(r io.Reader) (int64, error)
- func (s *Manifest) ReadFrom(r io.Reader) (int64, error)
- func (s *Manifest) Rehash()
- func (s *Manifest) RehashRecursive()
- func (s *Manifest) Reserved2Offset() uint64
- func (s *Manifest) Reserved2TotalSize() uint64
- func (s *Manifest) RevisionOffset() uint64
- func (s *Manifest) RevisionTotalSize() uint64
- func (m *Manifest) SetSignature(algo cbnt.Algorithm, hashAlgo cbnt.Algorithm, privKey crypto.Signer, ...) error
- func (s *Manifest) SetStructInfo(newStructInfo cbnt.StructInfo)
- func (s *Manifest) StructInfoOffset() uint64
- func (s *Manifest) StructInfoTotalSize() uint64
- func (s *Manifest) TotalSize() uint64
- func (s *Manifest) Validate() error
- func (m *Manifest) ValidateBPMKey(bpmKS cbnt.KeySignature) error
- func (s *Manifest) WriteTo(w io.Writer) (int64, error)
- type Usage
- func (u Usage) IsSet(f Usage) bool
- func (v Usage) PrettyString(depth uint, withHeader bool, opts ...pretty.Option) string
- func (v Usage) ReadFrom(r io.Reader) (int64, error)
- func (u *Usage) Set(f Usage, v bool)
- func (u Usage) String() string
- func (v Usage) TotalSize() uint64
- func (v Usage) WriteTo(w io.Writer) (int64, error)
Constants ¶
const ( // UsageBPMSigningPKD is the bit meaning the digest could be used as // Boot Policy Manifest signing pubkey digest. UsageBPMSigningPKD = Usage(1 << iota) // UsageFITPatchManifestSigningPKD is the bit meaning the digest could be used as // FIT Patch Manifest signing pubkey digest. UsageFITPatchManifestSigningPKD // UsageACMManifestSigningPKD is the bit meaning the digest could be used as // ACM Manifest signing pubkey digest. UsageACMManifestSigningPKD // UsageSDEVSigningPKD is the bit meaning the digest could be used as // SDEV signing pubkey digest. UsageSDEVSigningPKD // UsageReserved is a reserved bit UsageReserved )
const StructureIDManifest = "__KEYM__"
StructureIDManifest is the StructureID (in terms of the document #575623) of element 'Manifest'.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hash ¶
type Hash struct { // Usage is the digest usage bitmask. // // More than one bit can be set to indicate shared digest usage. // Usage of bit 0 is normative; other usages are informative. Usage Usage `json:"hashUsage"` // Digest is the actual digest. Digest cbnt.HashStructure `json:"hashStruct"` }
Hash is "KM hash Structure" defined in document #575623.
func NewHash ¶
func NewHash() *Hash
NewHash returns a new instance of Hash with all default values set.
func (*Hash) DigestOffset ¶
DigestOffset returns the offset in bytes of field Digest
func (*Hash) DigestTotalSize ¶
DigestSize returns the size in bytes of the value of field Digest
func (*Hash) PrettyString ¶
PrettyString returns the content of the structure in an easy-to-read format.
func (*Hash) Rehash ¶
func (s *Hash) Rehash()
Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.
func (*Hash) RehashRecursive ¶
func (s *Hash) RehashRecursive()
RehashRecursive calls Rehash (see below) recursively.
func (*Hash) UsageOffset ¶
UsageOffset returns the offset in bytes of field Usage
func (*Hash) UsageTotalSize ¶
UsageSize returns the size in bytes of the value of field Usage
type Manifest ¶
type Manifest struct { cbnt.StructInfo `id:"__KEYM__" version:"0x21" var0:"0" var1:"0"` // KeyManifestSignatureOffset is Key Manifest KeySignature offset. // // The original name is "KeySignatureOffset" (in #575623). KeyManifestSignatureOffset uint16 `rehashValue:"KeyAndSignatureOffset()" json:"kmSigOffset,omitempty"` // Reserved2 is an alignment. Reserved2 [3]byte `json:"kmReserved2,omitempty"` // Revision is the revision of the Key Manifest defined by the Platform // Manufacturer. Revision uint8 `json:"kmRevision"` // KMSVN is the Key Manifest Security Version Number. KMSVN cbnt.SVN `json:"kmSVN"` // KMID is the Key Manifest Identifier. KMID uint8 `json:"kmID"` // PubKeyHashAlg is the hash algorithm of OEM public key digest programmed // into the FPF. PubKeyHashAlg cbnt.Algorithm `json:"kmPubKeyHashAlg"` // Hash is the slice of KMHASH_STRUCT (KHS) structures (see table 5-3 // of the document #575623). Describes BPM pubkey digest (among other). Hash []Hash `json:"kmHash"` // KeyAndSignature is the Key Manifest signature. KeyAndSignature cbnt.KeySignature `json:"kmKeySignature"` }
PrettyString: CBnT Key Manifest
func NewManifest ¶
func NewManifest() *Manifest
NewManifest returns a new instance of Manifest with all default values set.
func (*Manifest) GetStructInfo ¶
func (s *Manifest) GetStructInfo() cbnt.StructInfo
GetStructInfo returns current value of StructInfo of the structure.
StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).
func (*Manifest) HashOffset ¶
HashOffset returns the offset in bytes of field Hash
func (*Manifest) HashTotalSize ¶
HashSize returns the size in bytes of the value of field Hash
func (*Manifest) KMIDOffset ¶
KMIDOffset returns the offset in bytes of field KMID
func (*Manifest) KMIDTotalSize ¶
KMIDSize returns the size in bytes of the value of field KMID
func (*Manifest) KMSVNOffset ¶
KMSVNOffset returns the offset in bytes of field KMSVN
func (*Manifest) KMSVNTotalSize ¶
KMSVNSize returns the size in bytes of the value of field KMSVN
func (*Manifest) KeyAndSignatureOffset ¶
KeyAndSignatureOffset returns the offset in bytes of field KeyAndSignature
func (*Manifest) KeyAndSignatureTotalSize ¶
KeyAndSignatureSize returns the size in bytes of the value of field KeyAndSignature
func (*Manifest) KeyManifestSignatureOffsetOffset ¶
KeyManifestSignatureOffsetOffset returns the offset in bytes of field KeyManifestSignatureOffset
func (*Manifest) KeyManifestSignatureOffsetTotalSize ¶
KeyManifestSignatureOffsetSize returns the size in bytes of the value of field KeyManifestSignatureOffset
func (*Manifest) PrettyString ¶
PrettyString returns the content of the structure in an easy-to-read format.
func (*Manifest) PubKeyHashAlgOffset ¶
PubKeyHashAlgOffset returns the offset in bytes of field PubKeyHashAlg
func (*Manifest) PubKeyHashAlgTotalSize ¶
PubKeyHashAlgSize returns the size in bytes of the value of field PubKeyHashAlg
func (*Manifest) ReadDataFrom ¶
ReadDataFrom reads the Manifest from 'r' excluding StructInfo, in format defined in the document #575623.
func (*Manifest) ReadFrom ¶
ReadFrom reads the Manifest from 'r' in format defined in the document #575623.
func (*Manifest) Rehash ¶
func (s *Manifest) Rehash()
Rehash sets values which are calculated automatically depending on the rest data. It is usually about the total size field of an element.
func (*Manifest) RehashRecursive ¶
func (s *Manifest) RehashRecursive()
RehashRecursive calls Rehash (see below) recursively.
func (*Manifest) Reserved2Offset ¶
Reserved2Offset returns the offset in bytes of field Reserved2
func (*Manifest) Reserved2TotalSize ¶
Reserved2Size returns the size in bytes of the value of field Reserved2
func (*Manifest) RevisionOffset ¶
RevisionOffset returns the offset in bytes of field Revision
func (*Manifest) RevisionTotalSize ¶
RevisionSize returns the size in bytes of the value of field Revision
func (*Manifest) SetSignature ¶
func (*Manifest) SetStructInfo ¶
func (s *Manifest) SetStructInfo(newStructInfo cbnt.StructInfo)
SetStructInfo sets new value of StructInfo to the structure.
StructInfo is a set of standard fields with presented in any element ("element" in terms of document #575623).
func (*Manifest) StructInfoOffset ¶
StructInfoOffset returns the offset in bytes of field StructInfo
func (*Manifest) StructInfoTotalSize ¶
StructInfoSize returns the size in bytes of the value of field StructInfo
func (*Manifest) Validate ¶
Validate (recursively) checks the structure if there are any unexpected values. It returns an error if so.
func (*Manifest) ValidateBPMKey ¶
func (m *Manifest) ValidateBPMKey(bpmKS cbnt.KeySignature) error
type Usage ¶
type Usage uint64
Usage is the digest usage bitmask.
More than one bit can be set to indicate shared digest usage. Usage of bit 0 is normative; other usages are informative.
func (Usage) PrettyString ¶
PrettyString returns the bits of the flags in an easy-to-read format.
func (*Usage) Set ¶
Set sets/unsets the bits of `f` in bitmask `u`.
To set the bits `v` should be true, to unset -- false.