-
Notifications
You must be signed in to change notification settings - Fork 291
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
cleanup: Use memzero(x, s)
instead of memset(x, 0, s)
.
#2594
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2594 +/- ##
=======================================
Coverage 73.60% 73.60%
=======================================
Files 148 148
Lines 30342 30339 -3
=======================================
- Hits 22333 22332 -1
+ Misses 8009 8007 -2 ☔ View full report in Codecov by Sentry. |
68bec1e
to
709fd3b
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.
Reviewed 16 of 17 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @iphydf)
toxcore/net_crypto.c
line 1142 at r2 (raw file):
memcpy(packet, &buffer_start, sizeof(uint32_t)); memcpy(packet + sizeof(uint32_t), &num, sizeof(uint32_t)); memzero(packet + (sizeof(uint32_t) * 2), padding_length);
I'm not sure about this one. The packet padding bytes needs to match PACKET_ID_PADDING
, which we're now just assuming is 0. We should either remove the define or adhere to it.
toxcore/util.h
line 52 at r2 (raw file):
/** * @brief Set all bytes in `data` to 0.
Maybe mention that this doesn't do a secure wipe, and a different function should be used for sensitive data.
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.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @JFreegman)
toxcore/net_crypto.c
line 1142 at r2 (raw file):
Previously, JFreegman wrote…
I'm not sure about this one. The packet padding bytes needs to match
PACKET_ID_PADDING
, which we're now just assuming is 0. We should either remove the define or adhere to it.
I agree. #2593 should be done first. I factored that out of this PR into a separate PR.
toxcore/util.h
line 52 at r2 (raw file):
Previously, JFreegman wrote…
Maybe mention that this doesn't do a secure wipe, and a different function should be used for sensitive data.
Good point. Added.
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.
Reviewed 1 of 1 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status:complete! 1 of 1 approvals obtained
611772e
to
04ee577
Compare
It's clearer and doesn't risk having a non-zero filler value.
It's clearer and doesn't risk having a non-zero filler value.
This change is