7 #if !defined(_EncoreBootImageReader_h_) 8 #define _EncoreBootImageReader_h_ 10 #include "EncoreBootImage.h" 28 :
std::runtime_error(msg)
117 #endif // _EncoreBootImageReader_h_ void readImageHeader()
Reads the header from the image.
Definition: EncoreBootImageReader.cpp:20
section_array_t m_sections
The section table.
Definition: EncoreBootImageReader.h:107
Base class for a section of an Encore boot image.
Definition: EncoreBootImage.h:989
void computeImageDigest(sha1_digest_t &digest)
Run a SHA-1 digest over the entire image.
Definition: EncoreBootImageReader.cpp:107
Reads a Piano/Encore boot image from an input stream.
Definition: EncoreBootImageReader.h:17
std::vector< EncoreBootImage::section_header_t > section_array_t
An array of section headers.
Definition: EncoreBootImageReader.h:34
Exception class used for error found while reading a boot image.
Definition: EncoreBootImageReader.h:23
std::istream & m_stream
The input stream to read the image from.
Definition: EncoreBootImageReader.h:103
virtual ~EncoreBootImageReader()
Destructor.
Definition: EncoreBootImageReader.h:47
const sha1_digest_t & getDigest() const
Returns a reference to the SHA-1 digest read from the image.
Definition: EncoreBootImageReader.h:95
bool isEncrypted() const
Returns whether the image is encrypted or not.
Definition: EncoreBootImageReader.h:91
EncoreBootImage::Section * readSection(unsigned index)
Definition: EncoreBootImageReader.cpp:312
EncoreBootImage::boot_image_header_t m_header
Header from the boot image.
Definition: EncoreBootImageReader.h:105
bool readKeyDictionary(const AESKey< 128 > &kek)
Reads the key dictionary, if the image is encrypted.
Definition: EncoreBootImageReader.cpp:169
void computeHeaderDigest(sha1_digest_t &digest)
Computes the actual SHA-1 digest of the image header.
Definition: EncoreBootImageReader.cpp:67
void readImageDigest()
Reads the digest at the end of the image.
Definition: EncoreBootImageReader.cpp:79
void readBootTags()
Definition: EncoreBootImageReader.cpp:237
Definition: BootImage.h:13
boot_tag_array_t m_bootTags
The array of boot tags read from the image.
Definition: EncoreBootImageReader.h:108
sha1_digest_t m_digest
SHA-1 digest as read from the image.
Definition: EncoreBootImageReader.h:106
Structure for a Piano bootloader command.
Definition: EncoreBootImage.h:249
const boot_tag_array_t & getBootTags() const
Returns a reference to the STL container holding the boot tags.
Definition: EncoreBootImageReader.h:99
const section_array_t & getSections() const
Returns a reference to the STL container holding the section headers.
Definition: EncoreBootImageReader.h:97
uint16_t m_keyCount
Number of entries in DEK dictionary.
Definition: EncoreBootImage.h:168
void readSectionTable()
Read the plaintext section table entries.
Definition: EncoreBootImageReader.cpp:131
std::vector< EncoreBootImage::boot_command_t > boot_tag_array_t
An array of boot tags.
Definition: EncoreBootImageReader.h:37
uint8_t calculateCommandChecksum(EncoreBootImage::boot_command_t &header)
Calculates the 8-bit checksum on a boot command header.
Definition: EncoreBootImageReader.cpp:291
const EncoreBootImage::boot_image_header_t & getHeader() const
Returns a reference to the image's header.
Definition: EncoreBootImageReader.h:93
AESKey< 128 > m_dek
DEK (data encryption key) read from the key dictionary.
Definition: EncoreBootImageReader.h:104
EncoreBootImageReader(std::istream &stream)
Default constructor.
Definition: EncoreBootImageReader.h:41
read_error(const std::string &msg)
Constructor.
Definition: EncoreBootImageReader.h:27