Skip to content

20261029-misc-fixes - #11934

Merged
philljj merged 28 commits into
wolfSSL:masterfrom
douzzer:20261029-misc-fixes
Nov 4, 2026
Merged

philljj merged 28 commits into
wolfSSL:masterfrom
douzzer:20261029-misc-fixes

Conversation

@douzzer

@douzzer douzzer commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

linuxkm/Kbuild: fix+improve handling for CONFIG_MITIGATION_RETPOLINE, CONFIG_MITIGATION_RETHUNK, and CONFIG_OBJTOOL. Also tabify some whitespace.

wolfssl/wolfcrypt/wc_compat.h: in wc_AesGcmEncrypt_compat_shim(), wipe tag and output to match wc_AesGcmEncrypt().

wolfcrypt/test/test.c: don't define SLHDSA_TEST_CERT if WOLFSSL_NO_MALLOC (not compatible).

wolfcrypt/benchmark/benchmark.c: refactor key init/free in bench_frodokem_keygen(), bench_frodokem_encap(), and bench_frodokem(), to fix uninited-key free ops.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 04:42
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved issues include out-of-bounds authentication-tag zeroization, broken kernel return-thunk mitigation handling, and compilation failures in supported configurations.

4 open issues
What changed in this PR

This PR addresses compatibility and cleanup issues in wolfSSL’s Linux kernel integration, AES-GCM shim, and cryptographic tests and benchmarks.

Changes:

  • Correct kernel mitigation flag handling and adjust objtool controls.
  • Add ciphertext and tag wiping on AES-GCM shim failures.
  • Refactor FrodoKEM benchmark key lifetimes and exclude SLH-DSA certificate tests from no-malloc builds.
File Description
wolfssl/​wolfcrypt/​wc_compat.h Wipe output and authentication tags after streaming-shim failures.
wolfcrypt/​test/​test.c Disable SLH-DSA certificate tests with WOLFSSL_NO_MALLOC.
wolfcrypt/​benchmark/​benchmark.c Adjust FrodoKEM key initialization, generation, and cleanup.
linuxkm/​Kbuild Update mitigation flags, legacy configuration aliases, and objtool handling.

Review effort: Balanced

Comment thread linuxkm/Kbuild Resolved
Comment thread wolfssl/wolfcrypt/wc_compat.h Resolved
Comment thread wolfcrypt/benchmark/benchmark.c Resolved
Comment thread wolfssl/wolfcrypt/wc_compat.h Resolved

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #11934

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): linuxkm/Kbuild, wolfcrypt/benchmark/benchmark.c
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

@philljj philljj assigned philljj and douzzer and unassigned wolfSSL-Bot Oct 30, 2026
@douzzer
douzzer force-pushed the 20261029-misc-fixes branch from b5c5eb4 to 36f4ff4 Compare October 30, 2026 22:09
@douzzer
douzzer requested review from wolfSSL-Fenrir-bot and a balanced review from Copilot October 30, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new inline shims call ForceZero without a prior declaration when FIPS AES-GCM and WOLFSSL_NO_FORCE_ZERO are enabled, causing compilation failures even when applications provide the zeroizer in another translation unit.

1 open issue
3 resolved since last review

Review effort: Balanced

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #11934

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): linuxkm/Kbuild, wolfcrypt/benchmark/benchmark.c
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: wolfssl/wolfcrypt/memory.h

Findings: 1
1 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: Lite

Comment thread wolfssl/wolfcrypt/wc_compat.h Resolved
@douzzer

douzzer commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

retest this please

FAIL: scripts/google

@douzzer

douzzer commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

retest this please

ERROR: Checkout failed

(PRB-fips-repo-and-harness-test-v3-part1)

@philljj philljj mentioned this pull request Nov 2, 2026
@douzzer
douzzer force-pushed the 20261029-misc-fixes branch from 36f4ff4 to 724c8d3 Compare November 2, 2026 22:44
@philljj

philljj commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

note: merge with

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #11934

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .wolfssl_known_macro_extras, linuxkm/Kbuild, wolfcrypt/benchmark/benchmark.c
Coverage: 5 of 15 in-scope changed file(s) opened by the reviewer; not opened: src/pk.c, tests/api/test_aes.c, tests/api/test_kdf.c, tests/api/test_ossl_x509_str.c, tests/api/test_sha512.c, wolfcrypt/src/evp.c, wolfcrypt/src/hpke.c, wolfcrypt/src/pkcs7.c, wolfssl/internal.h, wolfssl/wolfcrypt/types.h

Findings: 3
3 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: Lite

Comment thread wolfcrypt/src/rng_bank.c Resolved
@douzzer
douzzer force-pushed the 20261029-misc-fixes branch from 5f103d5 to d76e0d1 Compare November 3, 2026 20:47
@douzzer
douzzer requested review from wolfSSL-Fenrir-bot and a balanced review from Copilot November 3, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

With WOLFSSL_NO_FORCE_ZERO enabled in non-FIPS builds, memory.h aliases wc_ForceZero to an undeclared ForceZero, preventing callers that include only this header from compiling in C++ or strict C.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread wolfssl/wolfcrypt/memory.h Resolved

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #11934

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .wolfssl_known_macro_extras, linuxkm/Kbuild, wolfcrypt/benchmark/benchmark.c
Coverage: 2 of 2 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: Lite

…Level for the mismatched _PublicKeyDecode() refusal test.
PRIVATE_KEY_UNLOCK()/LOCK() pairs for FIPS-gated KDF/KEM calls whose
output is consumed internally: in wc_PKCS7_GenerateKEK_PWRI() around the
wc_PBKDF2() KEK derivation (reached from both wc_PKCS7_AddRecipient_PWRI()
and PWRI decode), and in wc_HpkeInitSealContext() and
wc_HpkeInitOpenContext() around wc_HpkeSetupBaseSender()/-Receiver(),
matching the existing arrangement in wc_HpkeSealBase()/wc_HpkeOpenBase().

Both paths returned FIPS_PRIVATE_KEY_LOCKED_E in FIPS builds; untested
previously because configure omits PKCS7 and HPKE from FIPS builds unless
explicitly enabled.
…) wraps:

* in dh_agree_ct_test(), add point-of-use
  PRIVATE_KEY_UNLOCK()/PRIVATE_KEY_LOCK() around the wc_DhAgree_ct() calls, and
  in dh_key_import_export_test(), around the wc_DhExportKeyPair() call. No
  current FIPS flavor gates these, but the wraps are harmless and future-proof
  the tests against a flavor that restores DH to inside-boundary status, or
  activates these subtests on FIPS <v7.

* in mlkem512_kat(), mlkem768_kat(), and mlkem1024_kat(), add point-of-use
  PRIVATE_KEY_UNLOCK()/PRIVATE_KEY_LOCK() around the
  wc_MlKemKey_EncodePrivateKey() and wc_MlKemKey_Decapsulate() calls.
* in wc_rng_bank_init_nonce(), use wc_RNG_lock_put_unconditional() to unlock the
  root_rng if it was locked, and don't unlock it otherwise;

* in wc_rng_bank_root_rng_init(), if RNG init fails and the caller didn't
  request _PRESERVE_LOCK, wipe the root_rng, restoring it to its condition after
  the whole-context wipe at the start of wc_rng_bank_init_nonce() -- with this
  fix, wc_rng_bank_root_rng_init() always leaves bank->root_rng in a known and
  sensible state that the caller can rely on, regardless of retval.
…orceZero(), matching the one in wc_compat.h, to assure warning-free availability regardless of include order.
…cess, call wolfSSL_RAND_Cleanup() before _exit() to avoid valgrind-detected leaks of globalRNG allocations.
…cc_export_x963_ex(); fix unused-store warning in ed448_kat_test(); add missing PRIVATE_KEY_UNLOCK()s in mlkem_asn1_test().
…l PRIVATE_KEY_UNLOCK() for wc_ecc_export_x963_ex().
…'t wipe buffers when WC_PENDING_E, and don't wipe output buffer when it's equal to the input buffer.
@douzzer
douzzer force-pushed the 20261029-misc-fixes branch from 3c359b4 to 1b6fa87 Compare November 4, 2026 00:28
@douzzer
douzzer requested review from wolfSSL-Fenrir-bot and a balanced review from Copilot November 4, 2026 00:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

RNG initialization failures can leak an allocated Nitrox context because resetting the RNG discards the device handle before cleanup, requiring partial-resource cleanup before zeroing.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread wolfcrypt/src/rng_bank.c Resolved

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #11934

Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .wolfssl_known_macro_extras, linuxkm/Kbuild, wolfcrypt/benchmark/benchmark.c
Coverage: 6 of 16 in-scope changed file(s) opened by the reviewer; not opened: src/pk.c, tests/api/test_aes.c, tests/api/test_sha512.c, wolfcrypt/src/evp.c, wolfcrypt/src/hpke.c, wolfcrypt/src/pkcs7.c, wolfssl/internal.h, wolfssl/wolfcrypt/error-crypt.h, wolfssl/wolfcrypt/memory.h, wolfssl/wolfcrypt/types.h

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

@wolfSSL-Fenrir-bot
wolfSSL-Fenrir-bot dismissed stale reviews from themself November 4, 2026 00:43

Fenrir's latest completed scan found no issues; clearing the prior automated change request.

@douzzer
douzzer requested a review from philljj November 4, 2026 01:41
@douzzer

douzzer commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

retest this please

java.nio.file.FileSystemException: /tmp/workspace/wolfSSL/PRB-FIPS-windows-test-ACVP@tmp/durable-489ae734: No space left on device

@philljj philljj removed their assignment Nov 4, 2026
@douzzer douzzer assigned wolfSSL-Bot and unassigned douzzer Nov 4, 2026
@philljj philljj self-assigned this Nov 4, 2026
@philljj

philljj commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

tests good with multi-test with all-gcc-c89, c89-clang-tidy, wolfssl-all, sanitizer, no-malloc, tls13, dtls13, quic, etc scenarios

@philljj
philljj merged commit 869a64f into wolfSSL:master Nov 4, 2026
442 checks passed
@stenslae stenslae mentioned this pull request Nov 4, 2026
2 of 4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants