Skip to content

ML-KEM fixes#9968

Open
Frauschi wants to merge 2 commits intowolfSSL:masterfrom
Frauschi:mlkem_fixes
Open

ML-KEM fixes#9968
Frauschi wants to merge 2 commits intowolfSSL:masterfrom
Frauschi:mlkem_fixes

Conversation

@Frauschi
Copy link
Contributor

Various ML-KEM related fixes (extracted from #9732):

All of these changes have already been reviewed and approved as part of #9732.

@Frauschi Frauschi added the For This Release Release version 5.9.0 label Mar 13, 2026
@Frauschi Frauschi force-pushed the mlkem_fixes branch 2 times, most recently from a932da8 to 88b42f7 Compare March 13, 2026 20:44
@JacobBarthelmeh JacobBarthelmeh requested a review from Copilot March 13, 2026 20:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates ML-KEM/DTLS 1.3 behavior and static-memory sizing, fixes a TLS server-side PQC/ECH-related leak, and expands CI/test coverage to ensure ML-KEM and hybrid groups are exercised.

Changes:

  • Enable/auto-configure DTLS 1.3 CH fragmentation for ML-KEM and adjust DTLS cookie/HRR initialization.
  • Fix PQC key share memory handling (free before overwrite; cleanup when group unsupported) and tune static-memory bucket sizing.
  • Expand tests/CI to cover hybrid groups and individual ML-KEM parameter sets.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
wolfssl/wolfcrypt/settings.h Auto-enables DTLS CH fragmentation when ML-KEM is enabled with DTLS 1.3.
wolfssl/wolfcrypt/memory.h Adjusts static-memory buckets/distribution for ML-KEM builds.
wolfssl/ssl.h Updates draft references for ML-KEM and hybrid key agreement groups.
wolfssl/internal.h Increases max curve-name buffer size to fit new hybrid group names.
tests/suites.c Extends “available group” detection to ML-KEM + hybrids; increases static memory for suite tests.
tests/api/test_tls13.c Ensures tests pick an actually-enabled ML-KEM/Kyber level.
tests/api.c Updates static memory sizing gates; improves DTLS1.3 PQC frag test group selection and validation.
src/tls.c Fixes PQC key share pubKey overwrite leak; clears key share state when group unsupported.
src/internal.c Initializes DTLS1.3 HRR cookie and enables CH fragmentation for ML-KEM during init.
examples/server/server.c Adjusts static-memory sizing condition for ML-KEM.
examples/client/client.c Ensures DTLS+PQC runs with SupportedGroups constrained to preserve desired KEM after HRR.
.github/workflows/pq-all.yml Adds CI runs for individual ML-KEM levels (512/768/1024).
Comments suppressed due to low confidence (1)

src/internal.c:1

  • This introduces new default behavior (enabling DTLS 1.3 CH fragmentation during initialization when ML-KEM is enabled). The existing DTLS1.3 PQC frag test in tests/api.c still calls wolfSSL_dtls13_allow_ch_frag() explicitly, so it won’t catch regressions in this init-time path. Consider adding/adjusting a test to exercise a DTLS 1.3 ML-KEM handshake without manually enabling CH fragmentation, validating that init-time enabling works.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

* DTLS 1.3 cookie and CH frag handling
* static memory handling
* Fix memory leak in TLS server PQC handling in case of ECH
* Make sure hybrids are actually tested in testsuite
Also fix minor problems found with these tests
@Frauschi
Copy link
Contributor Author

Addressed Copilot issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants