Skip to content

Post-quantum TLS, measured: real handshakes to the HTTP transport, in CI - #113

Merged
HackTuah merged 1 commit into
mainfrom
slice/068-pq-tls
Nov 30, 2026
Merged

HackTuah merged 1 commit into
mainfrom
slice/068-pq-tls

Conversation

@HackTuah

Copy link
Copy Markdown
Member

Tests, CI and docs only: no public entry and no package byte moves.

What

  • test/beam_mcp/transport/pq_tls_test.exs: Bandit serves BeamMCP.Transport.HTTP over HTTPS on the loopback, TLS 1.3. For each of X25519MLKEM768, SecP384r1MLKEM1024 and ML-KEM-1024:

    • client and server each allow only that group, the handshake completes, and tools/list is answered 200 over it;
    • a server allowing only a classical group (X25519 or P-384) refuses the same client;
    • OpenSSL's own s_client reports Negotiated TLS1.3 group: <group>.

    OTP's ssl does not report the negotiated TLS 1.3 group, so the in-VM proof is by construction (one group allowed on both sides), backed by the negative control. s_client is the independent reading.

  • Gating by a real handshake (test/support/beam_mcp/pq_tls.ex), not ssl:groups/0. In FIPS mode under provider 3.1.2, OTP lists ML-KEM groups whose handshake then exits rather than alerts.

  • CI:

    • the gate's and the flake hunt's box leg (aarch64, the image's OpenSSL 3.5) must run all nine (PQ_TLS_REQUIRED=all);
    • the FIPS leg's 3.5.9 rows must run the two ML-KEM-1024 groups (cnsa). In FIPS mode X25519MLKEM768 is not offered, because X25519 is not approved.
    • A leg that should run them and can't is refused, not green.
  • Docs: the README gains "Post-quantum TLS, measured", covering what was measured, how a host requires post-quantum key exchange, and the 3.1.2 caveat. docs/crypto-posture.md now says the post-quantum signature exists (beam_mcp_signer 0.3.0, KMS-held keys in 0.4.0). docs/fips.md gets the FIPS-mode result. The CHANGELOG is updated.

Measured locally

  • OTP 28.5.0.9 + OpenSSL 3.5.9, FIPS off: 9 tests, 0 failures. s_client printed Negotiated TLS1.3 group: X25519MLKEM768 (TLSv1.3, TLS_AES_256_GCM_SHA384), and the same for the other two groups.
  • FIPS mode, provider 3.5.9: the 6 ML-KEM-1024 tests pass, s_client included. Provider 3.1.2: all excluded by the probe.
  • OTP 28.5.0.8 + OpenSSL 3.0.13: all excluded, and PQ_TLS_REQUIRED=all refuses that runtime.
  • Full suite: 11 properties, 801 tests, 0 failures. tools/gate.sh gives "Gate OK." with box-leg settings.

A new test serves the HTTP transport from Bandit over HTTPS and completes
TLS 1.3 handshakes in which client and server each allow only one
post-quantum key exchange: X25519MLKEM768, SecP384r1MLKEM1024 and
ML-KEM-1024. It answers an MCP request over each, has a server that allows
only a classical group refuse the same client, and has OpenSSL's s_client
name the negotiated group.

The groups are found by a real loopback handshake, not by ssl:groups/0: in
FIPS mode under provider 3.1.2 OTP lists ML-KEM groups whose handshake then
exits. The box leg must run all nine; the FIPS leg's 3.5.9 rows must run
the two ML-KEM-1024 groups, which complete in FIPS mode (X25519MLKEM768 is
not offered there). A leg that should run them and cannot is refused, not
green.

The README says what was measured and how a host requires post-quantum key
exchange; docs/crypto-posture.md and docs/fips.md follow.

Signed-off-by: Ayla Croft <aylacroft@proton.me>
@HackTuah
HackTuah merged commit e723466 into main Nov 30, 2026
25 checks passed
@HackTuah
HackTuah deleted the slice/068-pq-tls branch November 30, 2026 02:23
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.

1 participant