From patchwork Wed Apr 21 02:34:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 1750 X-Patchwork-Delegate: a@unstable.cc Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id mBOwAyYcgGAHbwAAIUCqbw (envelope-from ) for ; Wed, 21 Apr 2021 08:35:50 -0400 Received: from proxy10.mail.iad3b.rsapps.net ([172.31.255.6]) by director12.mail.ord1d.rsapps.net with LMTP id gEeoAyYcgGDONQAAIasKDg (envelope-from ) for ; Wed, 21 Apr 2021 08:35:50 -0400 Received: from smtp33.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy10.mail.iad3b.rsapps.net with LMTPS id QMaXOSUcgGA7BAAA/F5p9A (envelope-from ) for ; Wed, 21 Apr 2021 08:35:49 -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: smtp33.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: 198bc490-a29e-11eb-979c-525400fb5834-1-1 Received: from [216.105.38.7] ([216.105.38.7:51436] helo=lists.sourceforge.net) by smtp33.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 52/7A-18863-42C10806; Wed, 21 Apr 2021 08:35:49 -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 1lZC40-0000Xn-TE; Wed, 21 Apr 2021 12:34:40 +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 1lZC3y-0000XN-VG for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 12:34:38 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xsTL01T5CfESOSMevSG8ipe24cOL4LFNH6dDadHDnUA=; b=XHaRmewRJl7LVHjW8dLgfogfrj GQtvkz5arjuCkJWRKXYcU4y/aZ5PAAVLYGswqr4O6JqhwOKeeCTwTGDTVDUbn6duWu0f9sAN0oFEe fcUTH6WGgzS8tqIkWS/pkZcmp4Etg2tqstsMEmDuzGlNRfGlGe2QlnxoS0vC1JFt+Ims=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=xsTL01T5CfESOSMevSG8ipe24cOL4LFNH6dDadHDnUA=; b=A ShhmPJXJdpMwk0+/Zwx5qQ6ZcZd7NzfR0M3gETKre45HsFffr7z6S/mraqVx+hlFay6HyUMGFswD0 gttrjplSwqSV2vkfKV8vGSlfrb+zrm7o2M+G6wfGi8A86EtSl1kOYD3enSpRDHCc5GUzYERuyrtSr vJaik98zRPUOLq7g=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1lZC3n-0002Z1-JR for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 12:34:38 +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 1lZC3b-00048k-E9 for openvpn-devel@lists.sourceforge.net; Wed, 21 Apr 2021 14:34:15 +0200 Received: (nullmailer pid 1942963 invoked by uid 10006); Wed, 21 Apr 2021 12:34:15 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Wed, 21 Apr 2021 14:34:15 +0200 Message-Id: <20210421123415.1942917-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: rfc2549.org] 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 X-Headers-End: 1lZC3n-0002Z1-JR Subject: [Openvpn-devel] [PATCH v2] Allow all GCM 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: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox OpenSSL also allows ARIA-GCM and that works well with our implementation While the handpicked list was needed for earlier OpenSSL versions (and is still needed for Chacha20-Poly1305), the API nowadays with OpenSSL 1.0.2 and 1.1.x works as expected. Patch V2: Remove special cases for AES-GCM ciphers. Signed-off-by: Arne Schwabe Acked-by: Antonio Quartulli --- src/openvpn/crypto_openssl.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/openvpn/crypto_openssl.c b/src/openvpn/crypto_openssl.c index f8b36bf85..57731ed79 100644 --- a/src/openvpn/crypto_openssl.c +++ b/src/openvpn/crypto_openssl.c @@ -728,16 +728,17 @@ cipher_kt_mode_aead(const cipher_kt_t *cipher) { if (cipher) { - switch (EVP_CIPHER_nid(cipher)) + if (EVP_CIPHER_mode(cipher) == OPENVPN_MODE_GCM) { - case NID_aes_128_gcm: - case NID_aes_192_gcm: - case NID_aes_256_gcm: + return true; + } + #ifdef NID_chacha20_poly1305 - case NID_chacha20_poly1305: -#endif - return true; + if (EVP_CIPHER_nid(cipher) == NID_chacha20_poly1305) + { + return true; } +#endif } return false;