From patchwork Thu Oct 29 14:17:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 10535 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4jFmXl44Jwz3wwg for ; Thu, 29 Oct 2026 14:17:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [IPv6:2001:678:b28::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail02.haj.ipfire.org", Issuer "YE2" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4jFmXl1zQjz6Gw for ; Thu, 29 Oct 2026 14:17:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4jFmXl1Ddmz2yqg for ; Thu, 29 Oct 2026 14:17:59 +0000 (UTC) X-Original-To: development@lists.ipfire.org Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4jFmXh4R87z2xLm for ; Thu, 29 Oct 2026 14:17:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4jFmXc6MrYz4GR for ; Thu, 29 Oct 2026 14:17:52 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1793283476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XoigA3POAxIRBMBmokuQEujZ72pl2kbETsCuF35Orbw=; b=qMJStDEICH9urSrE0n6pqTzJIP6KXHvAsYliDrEH7RmcUfjhbhzlCBED+/6HzDA33TStwv f9zpBuoEo8g1zIBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1793283476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XoigA3POAxIRBMBmokuQEujZ72pl2kbETsCuF35Orbw=; b=vGjcH11LuvWrc6uopgARc77GF1kJ/fYwERyO2m9DH8PyJg98qbzX2deDAUr30JVboXbs6Y zbdBXCYeV86mJ7rAZDq5Dxxibl/isR1fD6AYjOokI0pCwYoNXtCi9QEd1Vgwa0dbraJc4r 6cRN+VNkmJM8NbOtv0xybUOlGMFMVqWU+Hz1RHv9YpHXK9DqHod2eKGCFGQJhOCpdbxwnt ZTGTFzTFrtnrUrxA2WuOE+zXZZQV5qdQQfRFPLTMTNW0Vcmsz3FcFMmaCLjYZ636v6R0pM tnvX8cEVXCZ62mdZeBOk26Hn/SB0Cvbjua/UCFG2mCHg5SOMOA3VKKk4SBMjBQ== Message-ID: <45180abd-110b-4faa-b089-b7ee7db2c990@ipfire.org> Date: Thu, 29 Oct 2026 14:17:00 +0000 Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 To: "IPFire: Development" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] vpnmain.cgi: Allow for using a hybrid of ML-KEM 1024 and Curve 448 This matches efforts such as https://datatracker.ietf.org/doc/html/draft-preussmattsson-tls-mlkem1024-x448-01/, where the security level of ML-KEM 1024 is paired with Curve 448 rather than x25519, to achive the same strength as 265-bit AES, for both the traditional and post-quantum algorithm. Curve 448 seems not as widely supported as x25519, however, hence keeping the hybrid of ML-KEM 1024 and x25519 available for IPsec peers who would otherwise have to fall back to weaker encryption. Signed-off-by: Peter Müller --- html/cgi-bin/vpnmain.cgi | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/html/cgi-bin/vpnmain.cgi b/html/cgi-bin/vpnmain.cgi index b1048a802..ad838083c 100644 --- a/html/cgi-bin/vpnmain.cgi +++ b/html/cgi-bin/vpnmain.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2025 IPFire Team # +# Copyright (C) 2007-2026 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -2374,11 +2374,11 @@ END #use default advanced value $cgiparams{'IKE_ENCRYPTION'} = 'chacha20poly1305|aes256gcm128|aes256'; #[18]; $cgiparams{'IKE_INTEGRITY'} = 'sha2_512|sha2_256'; #[19]; - $cgiparams{'IKE_GROUPTYPE'} = 'x25519-ke1_mlkem1024|x25519-ke1_mlkem768|x25519-ke1_mlkem512|curve448|curve25519|e521|e384|4096|3072'; #[20]; + $cgiparams{'IKE_GROUPTYPE'} = 'curve448-ke1_mlkem1024|x25519-ke1_mlkem1024|x25519-ke1_mlkem768|x25519-ke1_mlkem512|curve448|curve25519|e521|e384|4096|3072'; #[20]; $cgiparams{'IKE_LIFETIME'} = '3'; #[16]; $cgiparams{'ESP_ENCRYPTION'} = 'chacha20poly1305|aes256gcm128|aes256'; #[21]; $cgiparams{'ESP_INTEGRITY'} = 'sha2_512|sha2_256'; #[22]; - $cgiparams{'ESP_GROUPTYPE'} = 'x25519-ke1_mlkem1024|x25519-ke1_mlkem768|x25519-ke1_mlkem512|curve448|curve25519|e521|e384|4096|3072'; #[23]; + $cgiparams{'ESP_GROUPTYPE'} = 'curve448-ke1_mlkem1024|x25519-ke1_mlkem1024|x25519-ke1_mlkem768|x25519-ke1_mlkem512|curve448|curve25519|e521|e384|4096|3072'; #[23]; $cgiparams{'ESP_KEYLIFE'} = '1'; #[17]; $cgiparams{'COMPRESSION'} = 'off'; #[13]; $cgiparams{'ONLY_PROPOSED'} = 'on'; #[24]; @@ -2759,7 +2759,7 @@ if(($cgiparams{'ACTION'} eq _('Advanced')) || goto ADVANCED_ERROR; } foreach my $val (@temp) { - if ($val !~ /^(x25519-ke1_mlkem(1024|768|512)|curve448|curve25519|e521|e384|e256|e224|e192|e512bp|e384bp|e256bp|e224bp|768|1024|1536|2048|3072|4096|6144|8192)$/) { + if ($val !~ /^((x25519|curve448)-ke1_mlkem(1024|768|512)|curve448|curve25519|e521|e384|e256|e224|e192|e512bp|e384bp|e256bp|e224bp|768|1024|1536|2048|3072|4096|6144|8192)$/) { $errormessage = _('Invalid Input'); goto ADVANCED_ERROR; } @@ -2800,7 +2800,7 @@ if(($cgiparams{'ACTION'} eq _('Advanced')) || goto ADVANCED_ERROR; } foreach my $val (@temp) { - if ($val !~ /^(x25519-ke1_mlkem(1024|768|512)|curve448|curve25519|e521|e384|e256|e224|e192|e512bp|e384bp|e256bp|e224bp|768|1024|1536|2048|3072|4096|6144|8192|none)$/) { + if ($val !~ /^((x25519|curve448)-ke1_mlkem(1024|768|512)|curve448|curve25519|e521|e384|e256|e224|e192|e512bp|e384bp|e256bp|e224bp|768|1024|1536|2048|3072|4096|6144|8192|none)$/) { $errormessage = _('Invalid Input'); goto ADVANCED_ERROR; } @@ -2940,6 +2940,7 @@ if(($cgiparams{'ACTION'} eq _('Advanced')) || $checked{'IKE_INTEGRITY'}{'aesxcbc'} = ''; @temp = split('\|', $cgiparams{'IKE_INTEGRITY'}); foreach my $key (@temp) {$checked{'IKE_INTEGRITY'}{$key} = "selected='selected'"; } + $checked{'IKE_GROUPTYPE'}{'curve448-ke1_mlkem1024'} = ''; $checked{'IKE_GROUPTYPE'}{'x25519-ke1_mlkem1024'} = ''; $checked{'IKE_GROUPTYPE'}{'x25519-ke1_mlkem768'} = ''; $checked{'IKE_GROUPTYPE'}{'x25519-ke1_mlkem512'} = ''; @@ -2983,6 +2984,7 @@ if(($cgiparams{'ACTION'} eq _('Advanced')) || $checked{'ESP_INTEGRITY'}{'aesxcbc'} = ''; @temp = split('\|', $cgiparams{'ESP_INTEGRITY'}); foreach my $key (@temp) {$checked{'ESP_INTEGRITY'}{$key} = "selected='selected'"; } + $checked{'ESP_GROUPTYPE'}{'curve448-ke1_mlkem1024'} = ''; $checked{'ESP_GROUPTYPE'}{'x25519-ke1_mlkem1024'} = ''; $checked{'ESP_GROUPTYPE'}{'x25519-ke1_mlkem768'} = ''; $checked{'ESP_GROUPTYPE'}{'x25519-ke1_mlkem512'} = ''; @@ -3151,6 +3153,7 @@ if(($cgiparams{'ACTION'} eq _('Advanced')) || @{[ _('Group Type:') ]} + @@ -3771,7 +3775,7 @@ sub make_algos($$$$$) { if ($mode eq "ike") { push(@algo, $int); - if ($grp =~ m/^x25519-ke1_mlkem(\d+)$/) { + if ($grp =~ m/^(x25519|curve448)-ke1_mlkem(\d+)$/) { push(@algo, "$grp"); } elsif ($grp =~ m/^e(.*)$/) { push(@algo, "ecp$1"); @@ -3790,7 +3794,7 @@ sub make_algos($$$$$) { if (!$pfs || $grp eq "none") { # noop - } elsif ($grp =~ m/^x25519-ke1_mlkem(\d+)$/) { + } elsif ($grp =~ m/^(x25519|curve448)-ke1_mlkem(\d+)$/) { push(@algo, "$grp"); } elsif ($grp =~ m/^e(.*)$/) { push(@algo, "ecp$1");