We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
s2n_blob_zeroize_free
We currently have both s2n_blob_free and s2n_blob_zeroize_free which are very subtly different.
s2n_blob_free
s2n_blob_zeroize_free always zeroes the memory, even if it's not an allocated blob.
allocated
s2n-tls/utils/s2n_mem.c
Lines 300 to 303 in 1209208
s2n_blob_free will fail if you try and free a non-growable blob:
Line 285 in 1209208
however it still zeroes the blob:
Line 282 in 1209208
It would be ideal if we only had one of these. The s2n_blob_zeroize_free is only referenced in a handful of places:
$ rg s2n_blob_zeroize_free bin crypto error pq-crypto stuffer tls tls/s2n_tls13_secrets.c 347: DEFER_CLEANUP(struct s2n_blob shared_secret = { 0 }, s2n_blob_zeroize_free); tls/s2n_client_key_exchange.c 229: DEFER_CLEANUP(struct s2n_blob shared_key = { 0 }, s2n_blob_zeroize_free); 328: DEFER_CLEANUP(struct s2n_blob shared_key = { 0 }, s2n_blob_zeroize_free); tls/s2n_tls13_handshake.c 97: DEFER_CLEANUP(struct s2n_blob ecdhe_shared_secret = { 0 }, s2n_blob_zeroize_free); tls/s2n_kem.c 228: POSIX_GUARD(s2n_blob_zeroize_free(&kem_params->private_key)); 229: POSIX_GUARD(s2n_blob_zeroize_free(&kem_params->public_key)); 230: POSIX_GUARD(s2n_blob_zeroize_free(&kem_params->shared_secret));
Assuming all of these can be replaced with s2n_blob_free, we should just get rid of s2n_blob_zeroize_free entirely.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Problem:
We currently have both
s2n_blob_free
ands2n_blob_zeroize_free
which are very subtly different.s2n_blob_zeroize_free
always zeroes the memory, even if it's not anallocated
blob.s2n-tls/utils/s2n_mem.c
Lines 300 to 303 in 1209208
s2n_blob_free
will fail if you try and free a non-growable blob:s2n-tls/utils/s2n_mem.c
Line 285 in 1209208
however it still zeroes the blob:
s2n-tls/utils/s2n_mem.c
Line 282 in 1209208
Solution:
It would be ideal if we only had one of these. The
s2n_blob_zeroize_free
is only referenced in a handful of places:Assuming all of these can be replaced with
s2n_blob_free
, we should just get rid ofs2n_blob_zeroize_free
entirely.The text was updated successfully, but these errors were encountered: