-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zeroise private random data on the stack before returning #762
Conversation
3aceaa2
to
a3be553
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider using sizeof in the calls to OPENSSL_cleanse to ensure all the data is cleansed as expected? If a future change made one of these arrays smaller it would trigger an address sanitizer error as cleanse tries to cleanse past the end, but if the array gets bigger the cleanse would only cleanse the first part.
Also this change introduces an inconsistencies: some places use a new constant (ED25519_SEED_LEN) while others continue to use magic numbers.
There is an equal issue here if the array is made a pointer that is dynamically allocated. Then |
CryptoAlg-1524
Description of changes:
Zeroise private random data immediately after use. This is just good secret value hygiene.
Most is stack-allocated. So, good chances it would be overwritten fairly quickly anyway. Looked in both
/crypto
and/ssl
, grepping my way through.Testing:
CI
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and
the ISC license.