Skip to content

config/tls: add X25519MLKEM768 to the curves directive name table, with tests - #912

Open
reservoir-cmyk wants to merge 3 commits into
foxcpp:masterfrom
reservoir-cmyk:config-tls-x25519mlkem768
Open

reservoir-cmyk wants to merge 3 commits into
foxcpp:masterfrom
reservoir-cmyk:config-tls-x25519mlkem768

Conversation

@reservoir-cmyk

Copy link
Copy Markdown

Implements the direction asked about in #910. I prepared this ahead of any reply on the issue, purely as material for consideration — if you would rather settle the direction on #910 first, that is entirely fine, and no prompt decision is being asked for here.

Change

  • framework/config/tls/general.go: add "X25519MLKEM768" → tls.X25519MLKEM768 to strCurvesMap. The name follows the existing X25519 entry, which uses the Go identifier as-is (tls.X25519MLKEM768.String() returns the same string).
  • framework/config/tls/general_test.go (new — the package had no test files): pins down TLSCurvesDirective interpretation:
    • every accepted name maps to its tls.CurveID,
    • curves X25519MLKEM768 X25519 yields [X25519MLKEM768, X25519] in order, i.e. a user who pins curves can keep the post-quantum hybrid in the list,
    • duplicate names are kept as specified (no deduplication),
    • unknown names (including mixed with valid ones, case variants, and an empty name) are rejected with an unknown curve error,
    • a curves directive without arguments is rejected.
  • docs/reference/tls.md: list the new name in both curves sections (server and client).

Verification (local, go1.26.10 against go.mod's go 1.26.0)

  • Before the change, the new tests fail exactly on the MLKEM cases with unknown curve: X25519MLKEM768; the rejection tests already pass, confirming the directive is fail-closed today.
  • After the change: go test ./framework/config/... passes (including the 5 new tests), and go vet and gofmt are clean.
  • A full go build ./... fails in my environment at cmd/maddy-pam-helper, which needs libpam development headers (security/pam_appl.h) that are not installed here — an environment limitation unrelated to this change. I have not separately build-verified every remaining package; the confirmed scope is the test run above.

Scope / not verified

This pins the configuration interpretation only. I have not dynamically verified that a handshake negotiated through a maddy server/client config with curves X25519MLKEM768 set actually selects the hybrid group end-to-end; that run is the next step and I am happy to add it if you would like it covered here. golangci-lint has not been run. Nothing else in the TLS configuration surface is changed.

— Tomoki Murota

@foxcpp foxcpp left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Needs formatting fix.

@github-project-automation github-project-automation Bot moved this from First Feedback Needed to Changes Needed in Maddy Mail Server PR Review Dec 1, 2026

This branch has not been deployed

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

Labels

None yet

Projects

Status: Changes Needed

Development

Successfully merging this pull request may close these issues.

2 participants