Repository navigation
Fix Fenrir items 16893, 16900, 16902 and 16903 - #12188
Open
kaleb-himes wants to merge 5 commits into
Open
kaleb-himes wants to merge 5 commits into
kaleb-himes wants to merge 5 commits into
Conversation
kaleb-himes
requested review from
wolfSSL-Fenrir-bot
and
a balanced review from Copilot
November 19, 2026 18:42
wolfSSL-Fenrir-bot
dismissed
their stale review
November 19, 2026 18:48
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
Contributor
Author
|
@claude review please. |
kaleb-himes
requested review from
wolfSSL-Fenrir-bot
and
a balanced review from Copilot
November 19, 2026 20:00
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12188
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): configure.ac, doc/ALGORITHM_DEFINES.md, tests/api/test_ecc.h
Coverage: 2 of 2 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
Contributor
Author
|
@claude review again please. |
kaleb-himes
marked this pull request as ready for review
November 19, 2026 22:03
|
retest this please |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Four correctness fixes. None is FIPS-gated.
WOLFSSL_SAKKE_SMALL+ custom curves: the pairing passedNULLfora, so every pairing failed withMP_VAL.¶ms->a.CURVE25519_SMALL:wc_curve25519_generic()did not mask bit 255 of u, so it computed X25519 on u + 19.WOLFSSL_SP_MATH:ecc_map_ex()used an#elifchain, so only the first compiled curve was mapped; others returned success unmapped.#ifper curve; anything else returnsECC_BAD_ARG_E.Behavior changes: X25519 output changes only in
CURVE25519_SMALLbuilds when bit 255 is set. Custom-curve compressed import now refuses a non-prime modulus withoutWOLFSSL_VALIDATE_ECC_IMPORT, somp_prime_is_prime()is compiled in for custom curves with compressed keys.Commit 2 fixes the new tests' build gates from review: static curve structs (
WOLFSSL_ECC_CURVE_STATIC), P-224-only builds, and SP-math builds without P-384/P-521 SP code or without RSA/DH.Commit 3:
--enable-sakke=smalldefinedWOLFCRYPT_SAKKE_SMALL, which nothing reads, so configure never built the small SAKKE code where F-16893 lives. It now definesWOLFSSL_SAKKE_SMALL.Commit 4, from review:
WOLFSSL_SAKKE_SMALLwithout SP ECC used a square-and-multiply loop that branched on each bit of the secret exponent r. Small builds now use the existing constant-time ladder, which runs over the bits of the public order q.WOLFSSL_SP_PRIME_GEN) callssp_cnt_lsb(), which was not compiled in RSA-public-only builds without DH or keygen. It now is.Testing
New tests:
test_wc_ecc_import_compressed_custom,test_wc_ecc_map_curves(needsWOLFSSL_PUBLIC_MP+WOLFSSL_PUBLIC_ECC_ADD_DBL), and RFC 7748 sec 5.2 vector 2 intest_wc_curve25519_make_pub_generic.Each fails with master's library sources and passes here (-Werror):
--enable-curve25519=small --enable-sakke --enable-eccsi --enable-ecccustcurves --enable-compkey CFLAGS=-DWOLFSSL_SAKKE_SMALLtest_curve25519.c:686,test_ecc.c:1805--enable-ecc --enable-sp --enable-sp-math --enable-sp-asm --enable-keygen+ the two defines abovetest_ecc.c:4886(P-384)Test gate fixes, each failing on commit 1 and passing on commit 2:
--enable-ecccustcurves --enable-compkey CFLAGS=-DWOLFSSL_ECC_CURVE_STATICtest_ecc.c:1760and:1782--disable-tls13 --enable-ecccustcurves --enable-compkey CFLAGS="-DECC_USER_CURVES -DNO_ECC256 -DHAVE_ECC224"test_ecc.c:1804(now skipped)--enable-ecc --enable-sp=ec256 --enable-sp-math --disable-rsa --disable-dh+ the two definesunit.testlink failure,sp_mont_setupundefined-DHAVE_ECC384test_ecc.c:4894(P-384); other ECC tests also fail here, as SP math has no P-384 codemake checkpasses with--enable-allplus SAKKE, ECCSI, custom curves and compressed keys; with theCURVE25519_SMALL+WOLFSSL_SAKKE_SMALLbuild; with SP-math only; and with fastmath and heapmath.--enable-sakke=small(commit 3):sakke.cWOLFSSL_SAKKE_SMALLnot defined; SAKKE passes because the small code is never builtsakke.cmake checkalso passes with--enable-sakke=small --enable-eccsion default math, custom curves with compressed keys,--enable-all, fastmath and heapmath.Commit 4 controls (commit 3 vs commit 4):
--enable-sakke=small --enable-eccsi --disable-sp, fastmath and heapmath; field multiplies per encapsulation, 4 SSVs (gdb)--enable-rsapub --disable-dh --disable-keygen --enable-ecccustcurves --enable-compkey CFLAGS=-DSQRTMOD_USE_MOD_EXPsp_cnt_lsbundefined (master links)SQRTMOD_USE_MOD_EXPmake checkpasses on commit 4 with--enable-sakke=small --enable-eccsion SP, custom curves, fastmath, heapmath and--enable-all, and with non-small SAKKE on--enable-alland fastmath.Checklist