Page 1 of 1

How to append SHA256 to image file?

Posted: Mon Nov 11, 2024 11:33 pm
by FrankJensen
Hi Forum.

I can see in many places, that it should be possible to add a SHA256 checksum at the end of a .bin image file. I can also see, that there is a flag indication if its set or not

https://docs.espressif.com/projects/esp ... ormat.html
uint8_t hash_appendedīƒ
If 1, a SHA256 digest "simple hash" (of the entire image) is appended after the checksum. Included in image length. This digest is separate to secure boot and only used for detecting corruption. For secure boot signed images, the signature is appended after this (and the simple hash is included in the signed data).
But I can not find a way to enable this? It does not seem to be enabled as default, cant find any flags to set, can not find it it menuconfig......

I download the whole image via a serial connection, and before I use it for anything, I would like a check. I can of course add my own SHA256 to the end of the file, before downloading it via serial interface, but seems kind of silly, if its already built in.

is it possible to enable this somewhere, so that a SHA256 hash is automatically added at the end of my bin file?

Br. Frank.