From patchwork Mon Feb 17 03:43:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1007 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 8FDgAdymSl48bgAAIUCqbw for ; Mon, 17 Feb 2020 09:44:44 -0500 Received: from proxy14.mail.ord1d.rsapps.net ([172.30.191.6]) by director8.mail.ord1d.rsapps.net with LMTP id eOLLAdymSl6+GAAAfY0hYg ; Mon, 17 Feb 2020 09:44:44 -0500 Received: from smtp38.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy14.mail.ord1d.rsapps.net with LMTP id uEyBAdymSl6VIgAAtEH5vw ; Mon, 17 Feb 2020 09:44:44 -0500 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: smtp38.gate.ord1c.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: 08375c92-5194-11ea-b110-5452007bdf16-1-1 Received: from [216.105.38.7] ([216.105.38.7:44724] helo=lists.sourceforge.net) by smtp38.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id F5/8F-19939-AD6AA4E5; Mon, 17 Feb 2020 09:44:43 -0500 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1j3hcn-0008Iq-P0; Mon, 17 Feb 2020 14:43:53 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1j3hcm-0008Ij-If for openvpn-devel@lists.sourceforge.net; Mon, 17 Feb 2020 14:43:52 +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=HmNSCx0lWX1yNpclP8gEV2bmWSYkenxnR027iFwZ2Hs=; b=k9qWVCWtTurdfa4CzzT4C/elz+ iKqQ8YgM2AwpMj7MCUJArzsMk5zjYmHv84+adCX8UMYCGojm4PgAwcOkiDNGwoiaYsHhfQ9K1CCAt L/DKiVZJRd7cwZs8SX4W0sM5cDwqopooybYFwTIVW19KuPga/SQj0PAfNqkCGT8vpcJ8=; 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=HmNSCx0lWX1yNpclP8gEV2bmWSYkenxnR027iFwZ2Hs=; b=JHbD9WpCOp+FfapRSMWOLcSPTA ho2J+w0Izfm7UzkNVwe43rsdfwpuZZPY3cSV8m2gjL0aXFpa8Yj+j9Y2PsQb3drReedm/DQAr4CZP RgNoEqT44YoYue3bgRyBVviMZT06NprgZPcVRbo181dtCqyq/DntHmQZ70NUNnuhBY28=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1j3hcj-006UA5-6b for openvpn-devel@lists.sourceforge.net; Mon, 17 Feb 2020 14:43:52 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1j3hca-0004g2-4d for openvpn-devel@lists.sourceforge.net; Mon, 17 Feb 2020 15:43:40 +0100 Received: (nullmailer pid 3321 invoked by uid 10006); Mon, 17 Feb 2020 14:43:40 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Mon, 17 Feb 2020 15:43:35 +0100 Message-Id: <20200217144339.3273-2-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200217144339.3273-1-arne@rfc2549.org> References: <20200217144339.3273-1-arne@rfc2549.org> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.2 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 0.1 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1j3hcj-006UA5-6b Subject: [Openvpn-devel] [PATCH v4 1/5] Only announce IV_NCP=2 when we are willing to support these ciphers 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 We currently always announce IV_NCP=2 when we support these ciphers even when we do not accept them. This lead to a server pushing a AES-GCM-128 cipher to clients and the client then rejecting it. Patch V2: Remove unecessary restoring of ncp_ciphers Patch V3: Do not add ncp_ciphers in context Signed-off-by: Arne Schwabe Acked-by: Lev Stipakov --- doc/openvpn.8 | 2 ++ src/openvpn/init.c | 1 + src/openvpn/ssl.c | 4 +++- src/openvpn/ssl_common.h | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/openvpn.8 b/doc/openvpn.8 index 8feb3b9c..b8f2f042 100644 --- a/doc/openvpn.8 +++ b/doc/openvpn.8 @@ -4398,6 +4398,8 @@ NCP server (v2.4+) with "\-\-cipher BF\-CBC" and "\-\-ncp\-ciphers AES\-256\-GCM:AES\-256\-CBC" set can either specify "\-\-cipher BF\-CBC" or "\-\-cipher AES\-256\-CBC" and both will work. +Note, for using NCP with a OpenVPN 2.4 server this list must include +the AES\-256\-GCM and AES\-128\-GCM ciphers. .\"********************************************************* .TP .B \-\-ncp\-disable diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 04207b61..5c2f801a 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -2827,6 +2827,7 @@ do_init_crypto_tls(struct context *c, const unsigned int flags) to.tcp_mode = link_socket_proto_connection_oriented(options->ce.proto); to.config_ciphername = c->c1.ciphername; to.config_authname = c->c1.authname; + to.config_ncp_ciphers = options->ncp_ciphers; to.ncp_enabled = options->ncp_enabled; to.transition_window = options->transition_window; to.handshake_window = options->handshake_window; diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index e708fc93..b8351737 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -2322,7 +2322,9 @@ push_peer_info(struct buffer *buf, struct tls_session *session) /* support for Negotiable Crypto Parameters */ if (session->opt->ncp_enabled - && (session->opt->mode == MODE_SERVER || session->opt->pull)) + && (session->opt->mode == MODE_SERVER || session->opt->pull) + && tls_item_in_cipher_list("AES-128-GCM", session->opt->config_ncp_ciphers) + && tls_item_in_cipher_list("AES-256-GCM", session->opt->config_ncp_ciphers)) { buf_printf(&out, "IV_NCP=2\n"); } diff --git a/src/openvpn/ssl_common.h b/src/openvpn/ssl_common.h index 8dd08862..fb82f610 100644 --- a/src/openvpn/ssl_common.h +++ b/src/openvpn/ssl_common.h @@ -290,6 +290,7 @@ struct tls_options const char *config_ciphername; const char *config_authname; + const char *config_ncp_ciphers; bool ncp_enabled; bool tls_crypt_v2;