wolfBoot icon indicating copy to clipboard operation
wolfBoot copied to clipboard

Improve image header default size, check for dupe hash def

Open gojimmypi opened this issue 2 months ago • 0 comments

Properly assign IMAGE_HEADER_SIZE default value.

Fixes validations failures in image.c verify when IMAGE_HEADER_SIZE not defined and called from the test-lib app.

While working on https://github.com/wolfSSL/wolfBoot/pull/623 and adding matrix support for more combinations, I encountered an odd problem where the test-lib would fail to validate.

The root cause is this blanket assignment that uses a value of 256, regardless of actual sign/hash needs:

#ifndef IMAGE_HEADER_SIZE
#  define IMAGE_HEADER_SIZE 256
#endif

Most of the make and cmake builds probably set this. There was no logic for it in my Visual Studio builds.

Tested here:

https://github.com/gojimmypi/wolfBoot/actions/runs/19991079444

While here, I also added a check for multiple hash assignments with a hard compile-time fail. (yes, I did this accidentally, no, it's not an intuitive error, lol)

gojimmypi avatar Dec 06 '25 16:12 gojimmypi