From patchwork Sun May 18 22:02:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4258 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:16c2:b0:662:a395:de2b with SMTP id bp2csp345516mac; Sun, 18 May 2025 15:03:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXp/oJQ2G9/K8JlGtVKSNTKSIpSByHge/1Uw1rk99A/e2DmccldeWPkMhBdhzWQcNdnSAY1vHQJzoM=@openvpn.net X-Google-Smtp-Source: AGHT+IEV9WsiqLi9RbgOnZzoHQ/vGyLiRiFtsNhnkhKyiNLqmTpvMpzaaJTjO5YDikYwAVgzh0RF X-Received: by 2002:a05:6e02:1a6c:b0:3d5:890b:d9df with SMTP id e9e14a558f8ab-3db8579f077mr93697505ab.15.1747605782847; Sun, 18 May 2025 15:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747605782; cv=none; d=google.com; s=arc-20240605; b=fsf3v81eWkEh8XQiX5D8fIsbaCPULMFaQb7xEu7W/x1evHX8h0VmbVicsUosLdRfRZ dz7dUdSPjNcViduxz1CzgWtAEkQQr/eGehDPdkw48QPULfsi8UXcIrk44wq6Ig7QOYYe qG4TlK/GCmNqfzSAGSCmVojMBVdRmHexrrU/nz1db7mXjr8oyo1lGK62MqFVZw2KEGrZ 80Nv+GCnuRS1Yod9QJeEWRNFYbujiI914QcJOxDeDrdym+1JJV+tiWo7k86iiqCTsvUg XMqrQm2oZV7EsqrcjnSfQPfnxTdkYgs2GgnvqrrsEEKU58RAOiyqlR2A7i02/XsIeF4P ajig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=UbNMBnOGEl+ihyk9T/tJlIjw2qvhotFluVWuonryu9Q=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=dRnauwxCI06K36PB+bmDHXf1zbSZYR+NKdVgLIZmgPv75zaxmE9u/ZZtBeOQUvnOBc IeQxR52FxdEOpuPS8uQVmooOjdzoRNql1eFVTvnIoAz/MuLVSvwCChx1iD/COB4vIfsS YpFarAf8wx8EAmtQMMMCblXuO8BxAXQxaOKyqaPXTL4mv734J6SDkSVLnfVKPckjC1kA /+uK93j3c1WJMLErPBs6+nsCduYHansDwxGZnWg2t+EdnMdV6TNzXyPfnk/+OZ3cBxmx Ry5I5QXNEEAnHAreUZGfQ9ScYbU4puwOb91k4IaGw62XCdvpzzZujtjhwIJzR513wlWg EIAw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=OLyFfC7N; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=MBM3ibTY; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=RDFgLRvX; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4fbcc3be82asi2271778173.43.2025.05.18.15.03.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 May 2025 15:03:02 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=OLyFfC7N; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=MBM3ibTY; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=RDFgLRvX; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UbNMBnOGEl+ihyk9T/tJlIjw2qvhotFluVWuonryu9Q=; b=OLyFfC7NyvS7fpPieliBlULXoN MPyYtkLR+/6F5TZh6rAhZIyhRCL1upSVwodjaIrGdnLMAs0rcRvONUMRiJ8Gfeev8wFHhZBQ1Dgqm OI3eD1W9TcjzVGh3h693MTlK5dQ2KczV0GXie2+d/nty4mCLbu3wZ1GN+ZTiPBh9EDxg=; Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uGm60-0006S8-4D; Sun, 18 May 2025 22:03:00 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uGm5y-0006Rz-Vx for openvpn-devel@lists.sourceforge.net; Sun, 18 May 2025 22:02:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xTkT7wOHZfYRoIsxKApC9+dDuQ5nsTbhpL7SlqKGI+s=; b=MBM3ibTY26SDx2t1TQGlw6IIU7 X8AhYcfwCtwqF8uA9rc4u+8OQxmCf6zHoAKSe8iTDYJVkoku96hO9Zcnd9JY4aW6FPHFKsInK+rOV SNFPfa7YTBzfKpWnO3zCmkgXNEFRzL0vj3IrQxTwh40cSka24tMypkvJDlpXVygNtXwk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xTkT7wOHZfYRoIsxKApC9+dDuQ5nsTbhpL7SlqKGI+s=; b=RDFgLRvXmpSwgfPo116Z+BktPj MdWMeAYlG7vjV/tdu9vujJB1gBM8LYZaiPdLyQYepSoakzdG1EDxCVnU1WD6XVpqTBEui9P9Luol3 r3fDDzEz0ugQ99kLxuqb5oaTtJ5IdbmPCe3c3EPwZlW4kOttBQggjKpwBebXxrMlaAG8=; Received: from [193.149.48.143] (helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1uGm5x-0003PX-M4 for openvpn-devel@lists.sourceforge.net; Sun, 18 May 2025 22:02:58 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 54IM2kdN024512 for ; Mon, 19 May 2025 00:02:46 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 54IM2jo5024509 for openvpn-devel@lists.sourceforge.net; Mon, 19 May 2025 00:02:45 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Mon, 19 May 2025 00:02:39 +0200 Message-ID: <20250518220245.24489-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "6901ab67b84d", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Arne Schwabe Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to [...] Content analysis details: (1.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Headers-End: 1uGm5x-0003PX-M4 Subject: [Openvpn-devel] [PATCH v4] Make --dh none behaviour default if not specified X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1832497481021580027?= X-GMAIL-MSGID: =?utf-8?q?1832497481021580027?= From: Arne Schwabe Nowadays ciphers that are using still DH and not ECDH are rarely chosen as best cipher suite. Our man page even indicates that OpenSSL 1.0.1+ supports ECDH cipher suites. So it does not feel useful to force specifying --dh anymore. Side note: Custom generated Diffie Hellmann parameters are also discouraged nowadays. The newest OpenSSL FIPS libraries even flat out reject them: FIPS 186-4 type domain parameters no longer allowed in FIPS mode, since the required validation routines were removed from FIPS 186-5 But instead of adding support for loading the well-known curve just make dh none the default and the recommended option as finite field Diffie Hellmann is being deprecated anyway (https://datatracker.ietf.org/doc/draft-ietf-tls-deprecate-obsolete-kex/) and not supported by TLS 1.3 at all. Change-Id: Ica02244c9f0ac9b4690a51f940fda9d900465289 Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/945 This mail reflects revision 4 of this Change. Signed-off-by line for the author was added as per our policy. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/Changes.rst b/Changes.rst index a4f5e57..e297334 100644 --- a/Changes.rst +++ b/Changes.rst @@ -103,6 +103,11 @@ - ``--x509-username-field`` will no longer automatically convert fieldnames to uppercase. This is deprecated since OpenVPN 2.4, and has now been removed. +- ``--dh none`` is now the default if ``--dh`` is not specified. Modern TLS + implementations will prefer ECDH and other more modern algorithms anyway. + And finite field Diffie Hellman is in the proces of being deprecated + (see draft-ietf-tls-deprecate-obsolete-kex) + Overview of changes in 2.6 ========================== diff --git a/doc/man-sections/tls-options.rst b/doc/man-sections/tls-options.rst index 0638d09..012518b 100644 --- a/doc/man-sections/tls-options.rst +++ b/doc/man-sections/tls-options.rst @@ -171,16 +171,22 @@ --dh file - File containing Diffie Hellman parameters in .pem format (required for - ``--tls-server`` only). + File containing finite field Diffie Hellman parameters in .pem format (used + by ``--tls-server`` only). - Set ``file`` to :code:`none` to disable Diffie Hellman key exchange (and - use ECDH only). Note that this requires peers to be using an SSL library - that supports ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or - mbed TLS 2.0+). + Setting``file`` to :code:`none` to disable fine field Diffie Hellman + key exchange (and to only use ECDH or newer hybrid key agreement algorithms + like X25519MLKEM768 instead). + Note that this requires peers to be using an SSL library that supports + ECDH TLS cipher suites (e.g. OpenSSL 1.0.1+, or mbed TLS 2.0+). Starting + with 2.7.0, this is the same as not specifying ``--dh`` at all. - Use ``openssl dhparam -out dh2048.pem 2048`` to generate 2048-bit DH - parameters. Diffie Hellman parameters may be considered public. + Diffie Hellman parameters can be generated using + ``openssl dhparam -out dh2048.pem 2048`` but it is recommended to + use ``none`` as finite field Diffie Hellman have been replaced + by more modern variants like ECDH. + + Diffie Hellman parameters may be considered public. --ecdh-curve name Specify the curve to use for elliptic curve Diffie Hellman. Available diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 3c1632f..1c7b4bc 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3708,8 +3708,6 @@ if (o->tls_server) { - /* Check that DH file is specified, or explicitly disabled */ - notnull(o->dh_file, "DH file (--dh)"); if (streq(o->dh_file, "none")) { o->dh_file = NULL;