From patchwork Fri Oct 5 01:49:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 480 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id KOiOEChQt1vBHwAAIUCqbw for ; Fri, 05 Oct 2018 07:51:04 -0400 Received: from proxy16.mail.ord1d.rsapps.net ([172.30.191.6]) by director12.mail.ord1d.rsapps.net with LMTP id 8IdoEChQt1sZGQAAIasKDg ; Fri, 05 Oct 2018 07:51:04 -0400 Received: from smtp13.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy16.mail.ord1d.rsapps.net with LMTP id 4IP6DyhQt1s8BwAAetu3IA ; Fri, 05 Oct 2018 07:51:04 -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: smtp13.gate.ord1d.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: ef437d8a-c894-11e8-bc05-525400b197d9-1-1 Received: from [216.105.38.7] ([216.105.38.7:28476] helo=lists.sourceforge.net) by smtp13.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 14/12-21675-72057BB5; Fri, 05 Oct 2018 07:51:03 -0400 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 1g8Oc3-0001DX-VK; Fri, 05 Oct 2018 11:49:43 +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 1g8Oc3-0001DR-6F for openvpn-devel@lists.sourceforge.NET; Fri, 05 Oct 2018 11:49:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pwpJfrVms63PFpuqxsscxKoJsw9/en/QK3zQe31fSig=; b=jnIGB+NQGLOkvlc9Rvkehm0BV9 wRdL75DtJeeGAIRAZFJyfM6e1PyfAeXQXD6tXhEP0w9Hpn5XVhKrnlRqidDQE5j/W8rYUM3olws6U awQmpJ8usoRCKJSCNqXgEvkNG/zFuQ6u8QkvpGVCjxGqRZVW/7ofT/7L2I3Wp8R7pSxo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pwpJfrVms63PFpuqxsscxKoJsw9/en/QK3zQe31fSig=; b=Eo9jfEthnpxAtwY+ZvC6yebAFS e6gsU4xA1n1ic1ZU56vreDFlW1mGfM++ecibmpA75OroWXViECzDWR1r4RVKfnANf3bkziOnLOflQ 2lq6gX+GaLDpjpT04PRzliPNcyuUNytA7R0mhAHfC7AR7yCZJh0nQv40dHWFZrBzbcG0=; 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.90_1) id 1g8Obt-00CNBJ-LV for openvpn-devel@lists.sourceforge.NET; Fri, 05 Oct 2018 11:49:43 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1g8Obe-000KEm-GO for openvpn-devel@lists.sourceforge.net; Fri, 05 Oct 2018 13:49:18 +0200 Received: (nullmailer pid 30670 invoked by uid 10006); Fri, 05 Oct 2018 11:49:18 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Fri, 5 Oct 2018 13:49:18 +0200 Message-Id: <20181005114918.30626-1-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 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 X-Headers-End: 1g8Obt-00CNBJ-LV Subject: [Openvpn-devel] [PATCH] Add OpenSSL compat definition for RSA_meth_set_sign 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 Commit 6b495dc4c5cfc118091ddc9c19330b3c9e3e3dff introduced RSA_meth_set_sign, which is OpenSSL 1.1.0 and newer. Add a compatibility definition. --- configure.ac | 1 + src/openvpn/openssl_compat.h | 20 ++++++++++++++++++++ src/openvpn/ssl_openssl.c | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/configure.ac b/configure.ac index 3d8e15bd..399cdf4e 100644 --- a/configure.ac +++ b/configure.ac @@ -943,6 +943,7 @@ if test "${with_crypto_library}" = "openssl"; then RSA_meth_set_priv_enc \ RSA_meth_set_priv_dec \ RSA_meth_set_init \ + RSA_meth_set_sign \ RSA_meth_set_finish \ RSA_meth_set0_app_data \ RSA_meth_get0_app_data \ diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h index f5328c4c..3877734f 100644 --- a/src/openvpn/openssl_compat.h +++ b/src/openvpn/openssl_compat.h @@ -585,6 +585,26 @@ RSA_meth_set_init(RSA_METHOD *meth, int (*init) (RSA *rsa)) } #endif +#if !(defined HAVE_RSA_MATH_SET_SIGN) +/** + * Set the init function of an RSA_METHOD object + * + * @param meth The RSA_METHOD object + * @param init the init function + * @return 1 on success, 0 on error + */ +static inline +int RSA_meth_set_sign(RSA_METHOD *meth, + int (*sign) (int type, const unsigned char *m, + unsigned int m_length, + unsigned char *sigret, unsigned int *siglen, + const RSA *rsa)) +{ + meth->rsa_sign = sign; + return 1; +} +#endif + #if !defined(HAVE_RSA_METH_SET_FINISH) /** * Set the finish function of an RSA_METHOD object diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c index cfc628b6..0861db4f 100644 --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c @@ -2000,6 +2000,10 @@ show_available_tls_ciphers_list(const char *cipher_list, tls_ctx_set_cert_profile(&tls_ctx, tls_cert_profile); tls_ctx_restrict_ciphers(&tls_ctx, cipher_list); + /* Even though setting the version does not seem to work, + * we do this because it might get fixed in future SSL + * versions + */ #if (OPENSSL_VERSION_NUMBER >= 0x1010100fL) if (tls13) {