From patchwork Mon Sep 13 09:29:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1949 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director14.mail.ord1d.rsapps.net ([172.27.255.7]) by backend30.mail.ord1d.rsapps.net with LMTP id GAfJNeCmP2HYfgAAIUCqbw (envelope-from ) for ; Mon, 13 Sep 2021 15:30:40 -0400 Received: from proxy21.mail.iad3a.rsapps.net ([172.27.255.7]) by director14.mail.ord1d.rsapps.net with LMTP id IMh4NeCmP2EMCwAAeJ7fFg (envelope-from ) for ; Mon, 13 Sep 2021 15:30:40 -0400 Received: from smtp8.gate.iad3a ([172.27.255.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy21.mail.iad3a.rsapps.net with LMTPS id oK6HLuCmP2EgEwAASBQwCQ (envelope-from ) for ; Mon, 13 Sep 2021 15:30:40 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp8.gate.iad3a.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 13d8af8e-14c9-11ec-99d7-525400b8fe03-1-1 Received: from [216.105.38.7] ([216.105.38.7:59338] helo=lists.sourceforge.net) by smtp8.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 52/EF-19998-0E6AF316; Mon, 13 Sep 2021 15:30:40 -0400 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.92.3) (envelope-from ) id 1mPreM-0002sL-NT; Mon, 13 Sep 2021 19:29:54 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mPreL-0002sA-Ev for openvpn-devel@lists.sourceforge.net; Mon, 13 Sep 2021 19:29:53 +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:Cc:To:From:Sender:Reply-To: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=2Us8j/CbYlB/evByDCUJgQTCXZNGhi1kL4RHAGXhdik=; b=J/HWUuESeKBrnfB1v1KpY5Gkkp hSViHX74zQC/gyzyHNDv6JwtgS2r0KwXdsZevNHrLcqXWZSikEBQhHI/1rRgJyiy2vsEqMcmg4hq2 yho+WSkb4bckMOmRNAKHs0y7vje63vyhH8WTBMqVNpK1ievyzaDKzZLudWwtMS5IMfnI=; 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:Cc:To:From:Sender:Reply-To: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=2Us8j/CbYlB/evByDCUJgQTCXZNGhi1kL4RHAGXhdik=; b=WVEmPk/Pf6asLynoOq7LjuDqvI GtV9Ps6JthTBccp9owTBT6dk65cYOTRc29FLLIOjkYktuBM8rUgiVcfyjRQbB0mds+/yZ/HAro0a+ 7Cg2TWxvaBXvuJdjTzOfVqgedC0NCcutWhx/fOtsave/LnNLbm0qanxsEOlJQATe4WIg=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1mPreJ-0005R2-DE for openvpn-devel@lists.sourceforge.net; Mon, 13 Sep 2021 19:29:53 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Mon, 13 Sep 2021 21:29:29 +0200 Message-Id: <20210913192929.26391-1-a@unstable.cc> In-Reply-To: <20210904095629.6273-7-a@unstable.cc> References: <20210904095629.6273-7-a@unstable.cc> MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", 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: Do not accept handshakes with peers trying to negotiate TLS lower than 1.2. TLS 1.1 and 1.0 are not recommended and therefore will, by default, allow TLS 1.2 as minimum version. The minimum allowed version can still be controlled via '--tls-version-min'. Content analysis details: (-0.0 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1mPreJ-0005R2-DE Subject: [Openvpn-devel] [PATCH v2 6/7] set TLS 1.2 as minimum by default 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox Do not accept handshakes with peers trying to negotiate TLS lower than 1.2. TLS 1.1 and 1.0 are not recommended and therefore will, by default, allow TLS 1.2 as minimum version. The minimum allowed version can still be controlled via '--tls-version-min'. At the same time automatically set '--tls-version-min' to 1.0 if the user requires compatibility with versions onlder than 2.3.7, as that was the only version supported back then. Signed-off-by: Arne Schwabe Signed-off-by: Antonio Quartulli Acked-by: Gert Doering --- Changes from v1: - remove bogus ssl_flags initialization in init_options() Changes.rst | 5 +++++ doc/man-sections/generic-options.rst | 2 ++ src/openvpn/options.c | 15 +++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/Changes.rst b/Changes.rst index 5195c634..a7389687 100644 --- a/Changes.rst +++ b/Changes.rst @@ -71,6 +71,11 @@ Deprecated features This option mainly served a role as debug option when NCP was first introduced. It should now no longer be necessary. +TLS 1.0 and 1.1 are deprecated + ``tls-version-min`` is set to 1.2 by default. OpenVPN 2.6.0 defaults + to a minimum TLS version of 1.2 as TLS 1.0 and 1.1 should be generally + avoided. Note that OpenVPN versions older than 2.3.7 use TLS 1.0 only. + ``--cipher`` argument is no longer included in ``--data-ciphers`` by default Data cipher negotiation has been introduced in 2.4.0 and been significantly improved in 2.5.0. The implicit fallback to the cipher specified in diff --git a/doc/man-sections/generic-options.rst b/doc/man-sections/generic-options.rst index 3e099e12..e6c1fe45 100644 --- a/doc/man-sections/generic-options.rst +++ b/doc/man-sections/generic-options.rst @@ -70,6 +70,8 @@ which mode OpenVPN is configured as. ``--data-ciphers`` - 2.3.x or lower: ``--data-cipher-fallback`` is automatically added with the same cipher as ``--cipher`` + - 2.3.6 or lower: ``--tls-version-min 1.0`` is added to the configuration + when ``--tls-version-min`` is not explicitly set. --config file Load additional config options from ``file`` where each line corresponds diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 4b6655d9..b3a83aa1 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -3164,6 +3164,21 @@ need_compatibility_before(const struct options *o, unsigned int version) static void options_set_backwards_compatible_options(struct options *o) { + /* TLS min version is not set */ + if ((o->ssl_flags & SSLF_TLS_VERSION_MIN_MASK) == 0) + { + if (need_compatibility_before(o, 20307)) + { + /* 2.3.6 and earlier have TLS 1.0 only, set minimum to TLS 1.0 */ + o->ssl_flags = (TLS_VER_1_0 << SSLF_TLS_VERSION_MIN_SHIFT); + } + else + { + /* Use TLS 1.2 as proper default */ + o->ssl_flags = (TLS_VER_1_2 << SSLF_TLS_VERSION_MIN_SHIFT); + } + } + /* Versions < 2.5.0 do need --cipher in the list of accepted ciphers. * Version 2.4 might probably does not need it but NCP was not so * good with 2.4 and ncp-disable might be more common on 2.4 peers.