Use wolfCrypt's wc_ForceZero()#1108
Open
ejohnstown wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes wolfSSH’s local ForceZero() helper and standardizes sensitive-memory wiping by using wolfCrypt’s wc_ForceZero() across the codebase, reducing duplicated implementations and aligning with wolfCrypt’s established zeroization API.
Changes:
- Removed the local
ForceZero()implementation fromsrc/misc.cand its declaration fromwolfssh/misc.h. - Replaced
ForceZero()call sites withwc_ForceZero()in core SSH, SFTP, and wolfsshd auth code. - Updated unit test comments/documentation to reflect the new zeroization function name.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfssh/misc.h | Removes local ForceZero() declaration from the misc inline API surface. |
| src/misc.c | Deletes the local inline ForceZero() implementation. |
| src/internal.c | Switches numerous secret-wiping call sites to wc_ForceZero(). |
| src/ssh.c | Uses wc_ForceZero() when wiping key buffers before freeing. |
| src/wolfsftp.c | Uses wc_ForceZero() to wipe SFTP buffer contents before shrink/free. |
| apps/wolfsshd/auth.c | Uses wc_ForceZero() to wipe password/hash copies before freeing. |
| tests/unit.c | Updates commentary to refer to wc_ForceZero() to match implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ejohnstown
force-pushed
the
wc_forcezero
branch
2 times, most recently
from
July 16, 2026 20:46
835e098 to
0c8a922
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1108
Scan targets checked: wolfssh-bugs, wolfssh-src
No new issues found in the changed files. ✅
Contributor
|
@ejohnstown this picked up a merge conflict |
Contributor
|
@ejohnstown some CI is failing after the rebase, please look into the failing test cases. |
- Keep a gated fallback, wolfSSH_ForceZero(). - Add macro WS_FORCEZERO gated between wc_ForceZero() or wolfSSH_ForceZero(). - Use WS_FORCEZERO() in place of the local ForceZero(). - Change the fallback's length parameter from word32 to size_t to match wc_ForceZero()'s signature.
JacobBarthelmeh
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.