Skip to content

Address chunk size issue in wh_Client_SheSecureBoot#293

Draft
padelsbach wants to merge 1 commit intowolfSSL:mainfrom
padelsbach:padelsbach/finding-146
Draft

Address chunk size issue in wh_Client_SheSecureBoot#293
padelsbach wants to merge 1 commit intowolfSSL:mainfrom
padelsbach:padelsbach/finding-146

Conversation

@padelsbach
Copy link

@padelsbach padelsbach commented Feb 27, 2026

Fixes finding 146 and adds associated regression test.

The added test case performs a second secure boot which triggered a failure in the server, even after the first one completed successfully. So there is a small change to allow a second _SecureBootInit(). If this is not a valid use case, we may need a different solution for the test code.

Also, this adjusts a buffer size constant in the test code.

@padelsbach padelsbach force-pushed the padelsbach/finding-146 branch 15 times, most recently from 2b1e6e9 to 9d9d6b6 Compare March 2, 2026 07:32
@padelsbach padelsbach force-pushed the padelsbach/finding-146 branch from 9d9d6b6 to 6a06299 Compare March 2, 2026 07:39
/* send what's left in the size available */
updateReq->sz = ((bootloaderLen - bootloaderSent) %
(WOLFHSM_CFG_COMM_DATA_LEN - sizeof(*updateReq)));
remaining = bootloaderLen - bootloaderSent;
Copy link
Author

Choose a reason for hiding this comment

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

This fixes the issue in the finding

REQ_SIZE = 32,
RESP_SIZE = 64,
BUFFER_SIZE = 4096,
BUFFER_SIZE = sizeof(whTransportMemCsr) + sizeof(whCommHeader) +
Copy link
Author

@padelsbach padelsbach Mar 2, 2026

Choose a reason for hiding this comment

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

BUFFER_SIZE was too small and causing a failure/hang due to overflow in build+test workflow in CI. This increases it to 5120.

WH_TEST_PRINT("SHE secure boot SUCCESS\n");

/* verify bootloader at exact max update chunk boundary */
bootloaderSz = maxBoundaryUpdateChunk;
Copy link
Author

Choose a reason for hiding this comment

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

New test case to validate the finding fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant