phoenix-rtos / phoenix-rtos-hostutils

Phoenix-RTOS supporting daemon
BSD 3-Clause "New" or "Revised" License
1 stars 5 forks source link

metaelf: Add tool to embed CRC32 into ELF #40

Closed gerard5 closed 1 year ago

gerard5 commented 1 year ago

Add a tool to embed a checksum to check the integrity of the ELF file.

Legally significant software requires each sub-module to have a checksum that can be used to verify the integrity of the module as a whole based on a hash of the sum of individual checksums from the sub-modules that make up the software subject to legalization.

CRC hash will be embeded into ELF header onto unused padding bytes (10:16) which are ignored by ELF loaders and parsers, normally this fields should be set to zero (default value). CRC32 hash is calculated ignoring those bytes (assuming normally always zero) during checksum calculation and checksum verification. Integrity of ELF file can be easily verified thanks to known ELF file size (as read from standard ELF header) and embedded by this tool checksum (CCITT-32, polynomial: EDB88320).

example

JIRA: RTOS-295

Description

Motivation and Context

Types of changes

How Has This Been Tested?

Checklist:

Special treatment