This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Use memset_s (or equivalent) when handling sensitive info #290
Closed
Conversation
This file contains 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
rajivshah3
requested review from
th0br0,
thibault-martinez and
tsvisabo
as code owners
September 16, 2018 14:43
Some comments we had in private:
|
rajivshah3
changed the title
Use memset_s when handling sensitive info
Use memset_s (or equivalent) when handling sensitive info
Sep 27, 2018
rajivshah3
force-pushed
the
fix/memset
branch
from
September 27, 2018 01:09
58a834a
to
3b2a0a0
Compare
@thibault-martinez I changed this so that it will use whatever is available based on the preprocessor directives |
thibault-martinez
suggested changes
Oct 9, 2018
Closing in favor of #839 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Changes
memset
to a custom function when clearing sensitive info out of the memory. According to MSC06-C. Beware of compiler optimizations,memset
could be removed by a compiler during optimization if it does not deem it necessary.memset_s
andSecureZeroMemory
are guaranteed to not be removed by the compiler (see https://en.cppreference.com/w/c/string/byte/memset and https://msdn.microsoft.com/en-us/library/windows/desktop/aa366877).I changed
common/helpers/sign.c
andmobile/android/Interface.cpp
, but I'm not sure if thememset
s that are used in other places need to be changed as well.Test Plan: