Skip to content

Allow zero-length input in _wc_Hash_Grow and fix SHA Copy MAX32666#10035

Open
night1rider wants to merge 2 commits intowolfSSL:masterfrom
night1rider:allow-0-len-input-hash-update
Open

Allow zero-length input in _wc_Hash_Grow and fix SHA Copy MAX32666#10035
night1rider wants to merge 2 commits intowolfSSL:masterfrom
night1rider:allow-0-len-input-hash-update

Conversation

@night1rider
Copy link
Contributor

@night1rider night1rider commented Mar 20, 2026

This PR is to fix issues found by the testing of the MAX32666 tests.

Fixes:
Allow zero-length input to _wc_Hash_Grow as a no-op instead of returning BAD_FUNC_ARG
Add WOLFSSL_HASH_KEEP build configuration to CI (os-check.yml) to hopefully catch this and keep current behavior.

Also Fixes:
The pr made changes to the copy sequence of the MAX32666 SHA code. after XMEMCPY(dst, src, ctxSz), *dstMsg intentionally holds the source's msg pointer (because the whole src struct was just copied into dst). The PR incorrectly moved srcBuf = *dstMsg before the free/copy, turning it into a dangling pointer and breaking the deep-copy condition.

The fix reverts that specific function to its original logic. The other changes in that commit related to the MAX32666 (AES CBC return values, MAA math fixes, etc.) look fine and don't need reverting.

Added '--enable-all CPPFLAGS=-DWOLFSSL_HASH_KEEP' to the make_check matrix in os-check.yml.
@night1rider night1rider self-assigned this Mar 20, 2026
@night1rider night1rider force-pushed the allow-0-len-input-hash-update branch from e1d20bd to 92e3647 Compare March 20, 2026 22:11
@night1rider night1rider changed the title Allow zero-length input in _wc_Hash_Grow Allow zero-length input in _wc_Hash_Grow and fix SHA Copy MAX32666 Mar 20, 2026
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