Repository navigation
v7.0.0-user-space: EMS refusal in wc_PRF, hybrid group constants, RAND_load_file single reseed, -209 comment - #12249
Conversation
|
There was a problem hiding this comment.
🔵 Needs a closer look
The inaccessible companion FIPS change leaves the coordinated EMS CAST/wrapper updates and real FIPS v7 self-tests unverified, requiring maintainer review.
No open issues 🎉
What changed in this PR
This PR follows up on #12170 by tightening FIPS v7 key derivation, centralizing hybrid-group identifiers, and reducing reseeding overhead in the OpenSSL compatibility layer.
Changes:
- Refuses non-extended master-secret derivation in the v7 PRF and updates test expectations.
- Adds named wolfCrypt hybrid-group constants and checks their agreement with TLS identifiers.
- Hashes file contents before a single no-stir reseed, adds portable file-reading tests, and clarifies DRBG error comments.
| File | Description |
|---|---|
wolfssl/wolfcrypt/kdf.h |
Defines three ML-KEM hybrid-group constants. |
wolfssl/wolfcrypt/error-crypt.h |
Clarifies self-test and health-test failure comments; no behavior change. |
wolfcrypt/test/test.c |
Updates v7 refusal expectations and uses hybrid constants. |
wolfcrypt/src/kdf.c |
Adds master-secret refusal and replaces numeric group identifiers. |
tests/api/test_ossl_rand.c |
Adds multi-chunk regular-file read cases. |
tests/api/test_kdf.c |
Uses wolfCrypt constants in hybrid-secret tests. |
tests/api/test_curve25519.c |
Uses named constants in X25519 hybrid tests. |
src/tls.c |
Statically checks TLS and wolfCrypt group identifiers agree. |
src/ssl_crypto.c |
Accumulates file data through hashing for one no-stir reseed. |
Review effort: Balanced
|
@claude review |
|
@claude review |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12249
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 2 of 3 in-scope changed file(s) opened by the reviewer; not opened: src/tls.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.
There was a problem hiding this comment.
Thanks for the follow-up commits. They address both of my earlier comments, and this pass found no new bugs. A human should still sign off, because this changes FIPS v7 KDF behavior and DRBG reseeding, and an earlier changes-requested review is still open.
What was reviewed:
- The tls.c static asserts are now guarded by WOLFSSL_HAVE_TLS13_HYBRID_SECRET, so a FIPS bundle with an older kdf.h skips them.
- The master-secret refusal in wc_PRF and the matching tls12_kdf_test branches now only apply when the module defines WC_FIPS_TLS12_EMS_ONLY. Without it, the old not-approved flag behavior stays.
- In RAND_load_file without stir, I checked the hash init/update/final flow, the single locked reseed, and the cleanup. The hash is freed only after init, and the hash state and digest are zeroed on every exit path after allocation.
Extended reasoning...
The change touches FIPS v7 crypto paths: the TLS 1.2 PRF in wolfcrypt/src/kdf.c, global DRBG reseeding in src/ssl_crypto.c, and the hybrid ML-KEM group constants in kdf.h and tls.c. Commits 07584e0 and 856cfdd fix the two configuration problems raised in the earlier review. wolfSSL-Fenrir-bot left a changes-requested review on tls.c, and its review state was never updated. The author replied and pushed commits later, but this run cannot confirm that review is cleared. Because the changes are crypto/FIPS-sensitive and that review is still open, this is a defer rather than an approval.
kaleb-himes
left a comment
There was a problem hiding this comment.
Jack, nice work! I only have one request on the call to wc_HashFree since it can error, can we just make sure we're checking the return code there please?
kaleb-himes
left a comment
There was a problem hiding this comment.
Thank you @jackctj117
283a73d
into
wolfSSL:v7.0.0-user-space
Follow-ups from the #12170 review.
wc_PRF()refuses a"master secret"derivation (BAD_FUNC_ARG) instead of the module flagging it not-approved. It only does this once the module'sfips.hdefinesWC_FIPS_TLS12_EMS_ONLY, which comes with wolfSSL/fips#442. The TLS-layer refusal is unchanged.WC_SECP256R1MLKEM768,WC_X25519MLKEM768andWC_SECP384R1MLKEM1024inkdf.hreplace the bare 4587/4588/4589 inkdf.cand its tests.RAND_egdis compiled out under FIPS.Testing:
make checkpasses (--enable-all). A FIPS v7 build with wolfSSL/fips#442 starts, passes its self-test andmake check, and refuses the master secret.Merge this before wolfSSL/fips#442.