cleanup: Use memzero(x, s) instead of memset(x, 0, s).#2594
cleanup: Use memzero(x, s) instead of memset(x, 0, s).#2594toktok-releaser merged 1 commit intoTokTok:masterfrom
memzero(x, s) instead of memset(x, 0, s).#2594Conversation
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
JFreegman
left a comment
There was a problem hiding this comment.
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.
iphydf
left a comment
There was a problem hiding this comment.
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.
JFreegman
left a comment
There was a problem hiding this comment.
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