Repository navigation
Fix/fenrir9929 - #11653
Fix/fenrir9929#11653ageprocpp wants to merge 4 commits into
Conversation
00356ca to
7f6cb06
Compare
|
retest this please |
|
|
Okay to test. Intern for wolfSSL |
7f6cb06 to
8451160
Compare
|
Will rebase after #11665 is merged |
8451160 to
f4bc2f4
Compare
0f4b56c to
f4bc2f4
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11653
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs
Not reviewed (no scan target covers them): doc/dox_comments/header_files/sha256.h
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
philljj
left a comment
There was a problem hiding this comment.
Thank you for the PR. The code looks good, but I think it is overkill for the issue:
wc_Sha256Copy checks each pointer for NULL but does not reject src == dst.
I think a check for src != dst would be sufficient, and you could add a test that expects BAD_FUNC_ARG in wolfcrypt/test/test.c when calling with src == dst.
|
@philljj On the other hand, if we try to add a test that expects I'd like to confirm if it looks good to you. |
|
The awkward define gates around a I would rather the awkward behavior difference be documented clearly in test, rather than left implicit. |
|
Reflected your review. |

Description
Fixes F-9929
wc_Sha256Copy(wc_Sha256* src, wc_Sha256* dst), which copieswc_Sha256instances, lacked error handling when src and dst memories have overlapping.It is unclear if this function should return
BAD_FUNC_ARGon all such opportunity, but implemented that behavior.The same changes to
wc_Sha224Copy.Testing
Did not add any test because the specification does NOT guarantee this function returns BAD_FUNC_ARG and just stipulate that this is an undefined behavior.
(If guaranteeing this returns BAD_FUNC_ARG, we'd have to change all other ad-hoc implementations for a number of environments)
Checklist
Discussion
It is unclear if this function should return BAD_FUNC_ARG when
src == dstbecause it is somehow reasonable expectation for the function to work fine by doing nothing. I would like have reviewers' comments in this respect.It should be noted that src is not const pointer and in some environment the content of src can be changed by this function.