Skip to content

Align data in wolfboot test structs#364

Open
padelsbach wants to merge 4 commits into
wolfSSL:mainfrom
padelsbach:wolfboot-test-alignment
Open

Align data in wolfboot test structs#364
padelsbach wants to merge 4 commits into
wolfSSL:mainfrom
padelsbach:wolfboot-test-alignment

Conversation

@padelsbach
Copy link
Copy Markdown
Contributor

Fixes this test failure on macos, adds macos-latest to unit test runs in CI.

ERROR [whTest_ServerImgMgrServerCfgWolfBootRsa4096:1275]: wolfBoot verify method failed: -2000
ERROR [whTest_ServerImgMgr:1527]: wolfBoot RSA4096 image manager tests failed: -2000
Assertion failed: ((0 == whTest_ServerImgMgr(WH_NVM_TEST_BACKEND_FLASH))), function whTest_Unit, file wh_test.c, line 123.
make: *** [run] Abort trap: 6

Comment thread test/gen/wh_test_wolfboot_img_data.h Outdated

/* wolfBoot signed header (RSA4096+SHA256, 1024 bytes) */
static const uint8_t wolfboot_test_header[] = {
static const uint8_t wolfboot_test_header[] __attribute__((aligned(4))) = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm unfortunately this is clang/gcc specific and some target toolchains wont support it. I do want us to go to C11 but for now we are C99 :/

I would say we should probably add WH_ALIGN(_x) to wh_settings.h that can have per-architecture definitions. For now you can just toolchain detect clang and GCC. Believe we do this elsewhere. But in the future for other toolchains we can add support for those as they come online. Then this header will need to include settings.h which i'm sure will break everything else :(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use XALIGNED(4) from wolfcrypt. Let me know if you'd rather create a separate macro in wolfhsm.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats fine for now. Will wait until the other fix clears CI then u can rebase this

@padelsbach padelsbach marked this pull request as ready for review May 13, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants