Documentation
¶
Index ¶
- Variables
- func DetectSDKVersion(r io.ReaderAt) (string, error)
- func DumpVerifyingKey(b []byte) ([]byte, error)
- func HexFileToBinary(b []byte) ([]byte, error)
- func UnmarshalDfuFile(name string) (*dfu.Packet, error)
- func VerifySignature(vk, cmd, sig []byte) error
- type Application
- type DfuContents
- type DfuInfo
- type DfuSettingAttrs
- type Firmware
- type Hash
- type ImageTLV
- type ImageTLVInfo
- type ImgVersion
- type MCUBoot
- type MCUBootImgHeader
- type Manifest
- type SDKSignatures
- type Signatures
- type TLVArea
- type TLVType
Constants ¶
This section is empty.
Variables ¶
View Source
var NoFirmwareSigned = errors.New("firmware is not signed")
Functions ¶
func DumpVerifyingKey ¶
func HexFileToBinary ¶
func UnmarshalDfuFile ¶
UnmarshalDfuFile parses the dat file and returns an init packet.
func VerifySignature ¶
VerifySignature verifies firmware signatures using ECDSA P-256 or Ed25519 public keys. pem format is also supported.
Types ¶
type Application ¶
type DfuContents ¶
type DfuContents struct {
Manifest Manifest `json:"manifest"`
}
type DfuInfo ¶
type DfuInfo struct {
// contains filtered or unexported fields
}
func OpenDfuFile ¶
type DfuSettingAttrs ¶
type Firmware ¶
type Firmware struct { Attr *DfuSettingAttrs // contains filtered or unexported fields }
func OpenFirmware ¶
func (*Firmware) ExtractApp ¶
func (*Firmware) ExtractBootloader ¶
type Hash ¶
func GenSignatureFromSDK ¶
type ImageTLVInfo ¶
ImageTLVInfo is information about TLV(tag-length-value). Magic and total size of TLV area.
type ImgVersion ¶
type MCUBoot ¶
type MCUBoot struct {
// contains filtered or unexported fields
}
func DetectMCUBoot ¶
func (*MCUBoot) ExtractImage ¶
func (*MCUBoot) Header ¶
func (b *MCUBoot) Header() *MCUBootImgHeader
func (*MCUBoot) ReadTLVArea ¶
type MCUBootImgHeader ¶
type MCUBootImgHeader struct { Magic uint32 LoadAddr uint32 Size uint16 ProtectedTLVSize uint16 ImgSize uint32 Flags uint32 Ver ImgVersion Pad uint32 }
func (*MCUBootImgHeader) IsEncrypted ¶
func (m *MCUBootImgHeader) IsEncrypted() bool
type Manifest ¶
type Manifest struct {
App Application `json:"application"`
}
type SDKSignatures ¶
type SDKSignatures struct {
Signatures []Signatures `json:"signatures"`
}
type Signatures ¶
type TLVType ¶
type TLVType int
const ( ImageTLVKeyHash TLVType = 0x01 // hash of the public key ImageTLVSHA256 TLVType = 0x10 // SHA256 of image hdr and body ImageTLVRsa2048PSS TLVType = 0x20 // RSA2048 of hash output ImageTLVEcdsa224 TLVType = 0x21 // ECDSA of hash output - Not supported anymore ImageTLVEcdsaSig TLVType = 0x22 // ECDSA of hash output ImageTLVRsa3072PSS TLVType = 0x23 // RSA3072 of hash output ImageTLVED25519 TLVType = 0x24 // ED25519 of hash output ImageTLVEncRsa2048 TLVType = 0x30 // Key encrypted with RSA-OAEP-2048 ImageTLVEncKW TLVType = 0x31 // Key encrypted with AES-KW-128 or 256 ImageTLVEncEC256 TLVType = 0x32 // Key encrypted with ECIES-P256 ImageTLVEncX25519 TLVType = 0x33 // Key encrypted with ECIES-X25519 ImageTLVEncDependency TLVType = 0x40 // Image depends on other image ImageTLVEncSecCnt TLVType = 0x50 // security counter ImageBootRecord TLVType = 0x60 // measured boot record )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.