From patchwork Sun Aug 9 23:00:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1353 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id sPdSKPwMMV9qKAAAIUCqbw for ; Mon, 10 Aug 2020 05:01:48 -0400 Received: from proxy12.mail.iad3b.rsapps.net ([172.31.255.6]) by director11.mail.ord1d.rsapps.net with LMTP id sIXuJvwMMV+eRAAAvGGmqA (envelope-from ) for ; Mon, 10 Aug 2020 05:01:48 -0400 Received: from smtp5.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy12.mail.iad3b.rsapps.net with LMTP id oOPtH/wMMV/RfgAAEsW3lA ; Mon, 10 Aug 2020 05:01:48 -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: smtp5.gate.iad3b.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=rfc2549.org X-Suspicious-Flag: YES X-Classification-ID: 1ee37aba-dae8-11ea-bd7a-525400155d63-1-1 Received: from [216.105.38.7] ([216.105.38.7:50282] helo=lists.sourceforge.net) by smtp5.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 9A/6E-02800-BFC013F5; Mon, 10 Aug 2020 05:01:48 -0400 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.90_1) (envelope-from ) id 1k53fk-0005rW-To; Mon, 10 Aug 2020 09:00:48 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k53fj-0005rI-BU for openvpn-devel@lists.sourceforge.net; Mon, 10 Aug 2020 09:00:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=References:In-Reply-To:Message-Id:Date:Subject:To: From:Sender:Reply-To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: 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=0MvEP1kY4rGB5uqxyof78/Wt3+87hAC2dUz0Vq72wco=; b=CS5PZyZiX26+xRLC8Q18oeb/k3 LvcF7BFCKRyFq8IsxLhyNbZXjSOjQBf1CLPegEQG3+gxX8Nv5MgGiulX9LsGsFj4Ps7wwdHXqf4Jh he7BXAZ8EDorO4ERzxwiYIzti0duMKRSn/bGN3Ncwxz5tgRRZc+7sduxo6cbBZXd7FFw=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc :MIME-Version:Content-Type:Content-Transfer-Encoding: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=0MvEP1kY4rGB5uqxyof78/Wt3+87hAC2dUz0Vq72wco=; b=mVMqh8vV6ueuce2pRgexEH6Oxt 0y5q4b8T5g+e2rQ9v/dxChedTy35imJXwoIRMld7PmJFeY4qv4GSaFd3pfcdrQ5QkYCsPvnywqnb0 zvw8fmdSM+aXe7BD1zUw1oKBgwIN0PQczfcySN9FWqHHfPcvO1+G4Fs/SClxk81EjxUI=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1k53ff-005WIo-JD for openvpn-devel@lists.sourceforge.net; Mon, 10 Aug 2020 09:00:47 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.94 (FreeBSD)) (envelope-from ) id 1k53fU-000Msi-Ly for openvpn-devel@lists.sourceforge.net; Mon, 10 Aug 2020 11:00:32 +0200 Received: (nullmailer pid 4268 invoked by uid 10006); Mon, 10 Aug 2020 09:00:32 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Mon, 10 Aug 2020 11:00:32 +0200 Message-Id: <20200810090032.4220-1-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200809141922.7853-2-arne@rfc2549.org> References: <20200809141922.7853-2-arne@rfc2549.org> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-Headers-End: 1k53ff-005WIo-JD Subject: [Openvpn-devel] [PATCH v2 2/2] Document different behaviour of dynamic cipher negotiation 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: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox This adds a section in the man page that details the various behaviour of older client/servers when using OpenVPN 2.5. Patch V2: Include grammar/spelling fixes from Richard Bonhomme Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- Changes.rst | 23 +++++++ doc/man-sections/cipher-negotiation.rst | 92 +++++++++++++++++++++++++ doc/openvpn.8.rst | 1 + 3 files changed, 116 insertions(+) create mode 100644 doc/man-sections/cipher-negotiation.rst diff --git a/Changes.rst b/Changes.rst index 37792342..8c6cafb6 100644 --- a/Changes.rst +++ b/Changes.rst @@ -29,6 +29,29 @@ Improved Data channel cipher negotiation ``data-ciphers ChaCha20-Poly1305:AES-256-GCM`` on the server that prefers ChaCha20-Poly1305 but uses it only if the client supports it. + See the data channel negotiation section in the manual for more details. + +Removal of BF-CBC support in default configuration: + By default OpenVPN 2.5 will only accept AES-256-GCM and AES-128-GCM as + data ciphers. OpenVPN 2.4 allows AES-256-GCM,AES-128-GCM and BF-CBC when + no --cipher and --ncp-cipher options are present. Accepting BF-CBC can be + enabled by adding + + data-ciphers AES-256-GCM:AES-128-GCM:BF-CBC + + and when you need to support very old peers also + + data-ciphers-fallback BF-CBC + + to offer backwards compatibility with older config an *explicit* + + cipher BF-CBC + + in the configuration will be automatically translated in adding BF-CBC + to the data-ciphers option and setting data-ciphers-fallback to BF-CBC + commands above. We strongly recommend to switching away from BF-CBC to a + more secure cipher. + Asynchronous (deferred) authentication support for auth-pam plugin. See src/plugins/auth-pam/README.auth-pam for details. diff --git a/doc/man-sections/cipher-negotiation.rst b/doc/man-sections/cipher-negotiation.rst new file mode 100644 index 00000000..1bd57258 --- /dev/null +++ b/doc/man-sections/cipher-negotiation.rst @@ -0,0 +1,92 @@ +Data channel cipher negotiation +=============================== + +OpenVPN 2.4 and higher have the capability to negotiate the data cipher that +is used to encrypt data packets. This section describes the mechanism in more detail and the +different backwards compatibility mechanism with older server and clients. + +OpenVPN 2.5 and higher behaviour +-------------------------------- +When both client and server are at least running OpenVPN 2.5, that the order of +the ciphers of the server's ``--data-ciphers`` is used to pick the the data cipher. +That means that the first cipher in that list that is also in the client's +``--data-ciphers`` list is chosen. If no common cipher is found the client is rejected +with a AUTH_FAILED message (as seen in client log): + + AUTH: Received control message: AUTH_FAILED,Data channel cipher negotiation failed (no shared cipher) + +OpenVPN 2.5 will only allow the ciphers specified in ``--data-ciphers``. To ensure +backwards compatibility also if a cipher is specified using the ``--cipher`` option +it is automatically added to this list. If both options are unset the default is +:code:`AES-256-GCM:AES-128-GCM`. + +OpenVPN 2.4 clients +------------------- +The negotiation support in OpenVPN 2.4 was a first implementation and still had some +quirks. Its main goal was "upgrade to AES-256-GCM when possible". +An OpenVPN 2.4 client that is built against a crypto library that supports AES in GCM +mode and does not have ``--ncp-disable`` will always announce support for +`AES-256-GCM` and `AES-128-GCM` even if the ``--ncp-ciphers`` option does not include +those two ciphers. It is therefore recommended to add `AES-256-GCM` and `AES-128-GCM` +to the ``--ncp-ciphers`` options to workaround this bug. + + +OpenVPN 3 clients +----------------- +Clients based on the OpenVPN 3.x library (https://github.com/openvpn/openvpn3/) +do not have a configurable ``--ncp-ciphers`` or ``--data-cipher`` option. Instead +these clients will announce support for all their supported AEAD ciphers +(`AES-256-GCM`, `AES-128-GCM` and in newer versions also `Chacha20-Poly1305`). + +To support OpenVPN 3.x based clients at least one of these ciphers needs to be +included in the server's ``--data-ciphers`` option. + + +OpenVPN 2.3 clients and older (and clients with ``--ncp-disable``) +------------------------------------------------------------------ +When a client without cipher negotiation support connects to a server the +cipher specified with the ``--cipher`` option in the client configuration +must be included in the ``--data-ciphers`` option of the server to allow +the client to connect. Otherwise the client will be sent the ``AUTH_FAILED`` +message that indicates no shared cipher. + +If the client has been configured with the ``--enable-small`` +:code:``./configure`` argument, using ``data-ciphers-fallback cipher`` +in the server config file with the explicit cipher used by the client +is necessary. + +OpenVPN 2.4 server +------------------ +When a client indicates support for `AES-128-GCM` and `AES-256-GCM` +(with ``IV_NCP=2``) an OpenVPN 2.4 server will send the first +cipher of the ``--ncp-ciphers`` to the OpenVPN client regardless of what +the cipher is. To emulate the behaviour of an OpenVPN 2.4 client as close +as possible and have compatibility to a setup that depends on this quirk, +adding `AES-128-GCM` and `AES-256-GCM` to the client's ``--data-ciphers`` +option is required. OpenVPN 2.5+ will only announce the ``IV_NCP=2`` flag if +those ciphers are present. + +OpenVPN 2.3 and older servers (and servers with ``-ncp-disable``) +----------------------------------------------------------------- +The cipher used by the server must be included in ``--data-ciphers`` to +allow the client connecting to a server without cipher negotiation +support. +(For compatibility OpenVPN 2.5 will also accept the cipher set with +``--cipher``) + +If the server has been configured with the ``--enable-small`` +:code:``./configure` argument, adding ``data-ciphers-fallback cipher`` +to the client config with the explicit cipher used by the server +is necessary. + +Blowfish in CBC mode (BFB-CBC) deprecation +------------------------------------------ +The ``--cipher`` option defaulted to ``BF-CBC`` in OpenVPN 2.4 and older +version. The default was never changed to ensure backwards compatibility. +In OpenVPN 2.5 this behaviour has now been changed so that if the ``--cipher`` +is not explicitly set it does not allow the weak ``BF-CBC`` cipher any more +and needs to explicitly added as ``--cipher BFC-CBC`` or added to +``-data-ciphers``. + +We strongly recommend to switching away from BF-CBC to a +more secure cipher as soon as possible instead. \ No newline at end of file diff --git a/doc/openvpn.8.rst b/doc/openvpn.8.rst index 4a7ca3aa..db81274f 100644 --- a/doc/openvpn.8.rst +++ b/doc/openvpn.8.rst @@ -75,6 +75,7 @@ placed in a configuration file. .. include:: man-sections/client-options.rst .. include:: man-sections/server-options.rst .. include:: man-sections/encryption-options.rst +.. include:: man-sections/cipher-negotiation.rst .. include:: man-sections/network-config.rst .. include:: man-sections/script-options.rst .. include:: man-sections/management-options.rst