]> git.ipfire.org Git - ipfire-2.x.git/commit
vpnmain.cgi: Use ML-KEM only as a hybrid with Curve 25519
authorPeter Müller <peter.mueller@ipfire.org>
Mon, 26 May 2025 18:27:00 +0000 (18:27 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 May 2025 14:06:08 +0000 (14:06 +0000)
commit5ed68a18b06ac84e994b1065398370533f59eea0
treec81be41c38315b4f3dd4737b88651b2d031dd868
parent23026ecc8531dfc41bd4cd7ca909b023f6fdc9a7
vpnmain.cgi: Use ML-KEM only as a hybrid with Curve 25519

In commit 887778e0888d51eb9942ae310a43f6d2813efad3, the post-quantum
key exchange algorithm ML-KEM was introduced, due to its support being
added in strongSwan 6.0. However, using PQC key exchanges is commonly
recommended only in conjunction with a traditional one, to avoid
encrypted traffic becoming subject to trivial decryption in case a PQC
algorithm proves weak, broken, or backdoored. OpenSSH, for instance,
combines ML-KEM 768 with Curve 25519 (mlkem768x25519-sha256), rather
than using ML-KEM alone.

This patch changes the cipher suites offered for IPsec connections to
always use ML-KEM as a hybrid with Curve 25519. This is possible due to
strongSwan 6.0 having added support for IKE intermediary key exchanges
(RFC 9370); see https://docs.strongswan.org/docs/latest/config/proposals.html#_key_exchange_methods
for additional information.

We can reasonably assume an IPsec peer supporting ML-KEM will also
support Curve 25519, as this has been around for much longer, and is
used quite commonly. Even if this is not the case, or if the IPsec peer
does not implement RFC 9370, any IPsec connection using our default
cipher selection will fall back to Curve 448, Curve 25519, or other,
hence continue working.

IPsec connections already created will need their ciphers to be changed
once during the Core Update routine where this patch will be
incorporated.

Tested-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/vpnmain.cgi