Cleanse-before-free buffers for sensitive data#164
Merged
gotthardp merged 1 commit intotpm2-software:masterfrom Mar 8, 2026
Merged
Cleanse-before-free buffers for sensitive data#164gotthardp merged 1 commit intotpm2-software:masterfrom
gotthardp merged 1 commit intotpm2-software:masterfrom
Conversation
gotthardp
requested changes
Mar 8, 2026
Contributor
Author
|
Thank you for the review. Once PR #168 is merged, I will rebase this branch and address the suggested changes. |
Contributor
ae25bcd to
a7763ff
Compare
5e9b041 to
6aaf390
Compare
Replace free() with cleanse_free() for some Esys-allocated buffers that contains sensitive data. The following buffers are now guaranteed to be zeroed after freed. - RSA decrypted plaintext (tpm2-provider-asymcipher-rsa) - Private key and decrypted plaintext (tpm2-provider-cipher) - Private key (tpm2-keymgmt-ec) - Private key (tpm2-keymgmt-rsa) - DER/PEM contents read from NV index (tpm2-provider-store-handle) - ECDH shared secret (tpm2-provider-keyexch) Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>
6aaf390 to
d35cea0
Compare
Contributor
Author
|
I have addressed all your suggested changes. |
gotthardp
approved these changes
Mar 8, 2026
Contributor
gotthardp
left a comment
There was a problem hiding this comment.
Thank you for the changes.
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.
This pull request replace
free()withcleanse_free()for Esys-allocated buffers.Targets
actx->messagersa_asymcipher_freectxtpm2-provider-asymcipher-rsa.ckeyPrivatetpm2_load_external_keytpm2-provider-cipher.coutbufftpm2_cipher_process_buffertpm2-provider-cipher.coutbufftpm2_cipher_update_streamtpm2-provider-cipher.coutPointtpm2_keyexch_derive_kdftpm2-provider-keyexch.ckeyPrivatetpm2_ec_keymgmt_gentpm2-keymgmt-ec.ckeyPrivatetpm2_rsa_keymgmt_gentpm2-keymgmt-rsa.cbuff,data,der_datatpm2_handle_load_indextpm2-provider-store-handle.cTest
I have confirmed that
make checkcompleted successfully.