Repository navigation
MC/DC: close aes.c condition gaps (part 10) - #12176
danielinux wants to merge 5 commits into
Conversation
|
@claude review |
|
0c071f7 to
fb57eec
Compare
There was a problem hiding this comment.
Separately from the inline comments, I checked the one library change: removing out != NULL from the guard on the GCM decrypt auth-fail wipe. It is safe. The argument check at the top of wc_AesGcmDecrypt (aes.c:13095) returns BAD_FUNC_ARG whenever sz != 0 and out == NULL, in every build. out is never reassigned before the wipe, so ForceZero(out, sz) cannot be called with a NULL pointer.
Extended reasoning...
The only library change is the ForceZero guard in wolfcrypt/src/aes.c. The unconditional argument check at the top of wc_AesGcmDecrypt already rejects a NULL out when sz is nonzero, and nothing in between reassigns out.
Findings marked 🟡 are optional suggestions and need no follow-up push.
aes gap 23 -> 7 (all 7 excluded, 0 open; check-closure CLOSED). Full union 477/484 (98.55%), native 416/470 (88.51%) across 8 native variants + m33mu lane; aarch64 lane excluded (pre-existing sha3.c build break + unaligned-allocator test issue). Closed: - 15698 stream Final guard x4: test_wc_AesGcmStreamMcdc rewritten around the real state model (GcmInit-with-IV sets nonceSet only; SetIV sets ctrSet only) with 6 vectors including complete (T,T,T,T) and (T,F,-,-) rows; clang-21 pairs a vector only against rows where the unvaried operands are evaluated, so the old 5-vector set left idx0/2/3 unpaired. - 17329 wc_AesGetKeySize claimed-key guard x2: whitebox Class 13 corrupts the context (rounds=0, keylen=16) under plain WOLF_CRYPTO_CB. - 5289/8916/16032/16220/17963:1: whitebox Classes 12/14/15 (counter overflow preload, SetIV carry scan with deterministic RNG device, CFB loop ret guard) on the m33mu lane. - 13369 idx2: removed the redundant 'out != NULL' operand from the GcmDecrypt auth-fail wipe guard (the entry arg check already rejects NULL out); shrinks the decision from 3 to 2 operands. Excluded (structural, in the campaign exclusion ledger): - 5991 x2 devOwned constant 0: needs WOLF_CRYPTO_CB_AES_SETKEY, which breaks upstream test_wc_CryptoCb_Tls13_Key_Zero_After_Offload (double SetKeysSide in SendTls13Finished re-imports the zeroed client_write_key; genuine upstream bug, to be fixed separately). - 8645 x2 CTR drain loop drained unconditionally before the ARM/PPC arm. - 15372:5 / 15992:5 complementary-operand pairs (ivSz>0, ivFixed!=NULL). - 17963:0 CFB loop ret guard: the arm wc_AesEncrypt (WOLFSSL_ARMASM_NO_HW_CRYPTO) returns 0 unconditionally, so ret is provably 0 at every evaluation. Verification: sweep6 (8 native variants + m33mu) all green; check-closure.py aes: gap 7 = excluded 7 + open 0, CLOSED; fips-dev-no-post --enable-all (FIPS v7, AESGCM_STREAM on): aes group 78 tests, 0 failed; check-api-guards.py clean; baselines.json rebaselined to the native union 416/470 with the part-10 note.
6d3a5d5 to
e7f708f
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12176
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-bugs
Not reviewed (no scan target covers them): tests/api/test_aes.h
Coverage: 3 of 3 in-scope changed file(s) opened by the reviewer
Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Max
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12176
Scan targets checked: wolfssl-bugs
Unchanged since last review (not re-run): wolfcrypt-src, wolfcrypt-bugs
Not reviewed (no scan target covers them): tests/api/test_aes.h
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: tests/api/test_aes.c
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
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
aes gap 23 -> 7 (all 7 excluded, 0 open; check-closure CLOSED). Full union 477/484 (98.55%), native 416/470 (88.51%) across 8 native variants + m33mu lane; aarch64 lane excluded (pre-existing sha3.c build break + unaligned-allocator test issue).
Closed:
Excluded (structural, in the campaign exclusion ledger):
Verification: sweep6 (8 native variants + m33mu) all green; check-closure.py aes: gap 7 = excluded 7 + open 0, CLOSED; fips-dev-no-post --enable-all (FIPS v7, AESGCM_STREAM on): aes group 78 tests, 0 failed; check-api-guards.py clean; baselines.json rebaselined to the native union 416/470 with the part-10 note.