Repository navigation
Clear secret buffers with a wipe the compiler keeps - #114
Merged
Merged
Conversation
ppk.c cleared keys and other secret data with memset. A compiler can remove a memset on a buffer that is not used again. A new function, wipe(), writes the zeros through a volatile pointer, thus the compiler keeps the writes. All the memset calls in ppk.c now use wipe(). The result of each call does not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRUrfg8fQaXPrMeiQ9h Signed-off-by: Neo-Desktop <321592+Neo-Desktop@users.noreply.github.com>
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.
Requested by Sydney · project thread
Summary
This PR corrects 1 code scanning finding of the rule Call to
memsetmay be deleted (ssh/src/ppk.c).memseton a buffer that is not used again. A new function,wipe(), writes the zeros through avolatilepointer, thus the compiler keeps them.memset(…, 0, …)calls inppk.cnow usewipe(). The result of each call does not change.ppk.c.Test
ppk.cchange in D-Modem/app builds with-Wall -Wextra -Werrorand itsdmodemssh_testpasses.Generated by Claude Code