Add hooks for crypto callback mechanism - #34
Conversation
7022037 to
b1876bb
Compare
b1876bb to
3c108bf
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #34
Scan targets checked: wolfsm-bugs, wolfsm-src
Findings: 5
4 finding(s) posted as inline comments (see file-level comments below)
Required changes (1)
wc_Sm3GetHash duplicates the device context by using raw sm3_copy()
File: sm3.c:1201
Function: wc_Sm3GetHash
Category: API contract violations
sm3_copy() byte-copies the struct, so sm3Copy shares devCtx with sm3; the following wc_Sm3Final() finalizes the shared device state and wc_Sm3Free(sm3Copy) releases it, so the caller's sm3 is left with a finalized/dangling device handle despite the documented "more data can be added" contract. Distinct from known #8803 (missing ForceZero).
Related known finding #8803 (similar but distinct): Both involve wc_Sm3GetHash disposing of a temporary SM3 copy, but this faults by shallow-copying devCtx and freeing/finalizing the caller's device state; #8803 faults by not zeroizing the temporary object. The causes and fixes (device-aware copy versus ForceZero) differ.
Recommendation: Call wc_Sm3Copy() here so the device-aware duplication path added in this PR is used.
Referenced code: sm3.c:1201-1203 (3 lines)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
…o route wc_ecc_sm2_create_digest through wc_CryptoCb_Sm2CreateDigest.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #34
Scan targets checked: wolfsm-bugs, wolfsm-src
Findings: 5
5 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
NOTE: Merge wolfSSL/wolfssl#10857 prior to this PR