From patchwork Fri Oct 5 02:23:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 483 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director10.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 2MJ4MvhXt1tfAwAAIUCqbw for ; Fri, 05 Oct 2018 08:24:24 -0400 Received: from proxy20.mail.iad3b.rsapps.net ([172.31.255.6]) by director10.mail.ord1d.rsapps.net with LMTP id 8CvhL/hXt1udFAAApN4f7A ; Fri, 05 Oct 2018 08:24:24 -0400 Received: from smtp23.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy20.mail.iad3b.rsapps.net with LMTP id OG0NKvhXt1ukGgAAcDxLoQ ; Fri, 05 Oct 2018 08:24:24 -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: smtp23.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: 97a75826-c899-11e8-ba6d-525400aa5716-1-1 Received: from [216.105.38.7] ([216.105.38.7:3510] helo=lists.sourceforge.net) by smtp23.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 1D/85-13000-8F757BB5; Fri, 05 Oct 2018 08:24:24 -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 1g8P93-0003J2-8o; Fri, 05 Oct 2018 12:23:49 +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 1g8P92-0003Iw-4t for openvpn-devel@lists.sourceforge.NET; Fri, 05 Oct 2018 12:23:48 +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=0azkxTi+mqRF+7xDn61/kHmAYCOiqfb/+ZraclSotvc=; b=Rdm9HyfSeO/bGD69rYcHaOxX+b OaVVnDljuUsZ2NonhrdbTgD3gqBGAstLgtOQIJ4mh/Kai1fH0WcSv4NkRDRNXWXhdj/Ga4iZsVX9+ 5VTleyg8GddxJDeKE2ocU4GKllZ+5PCvUIifK/KUmX1nfwYrqIbKTGASZj59bXKZzUpk=; 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=0azkxTi+mqRF+7xDn61/kHmAYCOiqfb/+ZraclSotvc=; b=BcbdMF6v3YCx63DrqrSQPuBOv6 PpZjjj14xZxh7Sks3Uc0wgfEwt2RZn4XZaBbcugjBpM9mMp9qxen5FsSv3V1FCgoX+WFsIq5NRWtI lD8qMArGkWUReaa0i1vskeL6wSPGOBqQEjO8lFvBQv35iMTv6xoEuXaII8FS81x9xK2o=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1g8P8v-00169h-12 for openvpn-devel@lists.sourceforge.NET; Fri, 05 Oct 2018 12:23:48 +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 1g8P8k-000KIg-W7 for openvpn-devel@lists.sourceforge.net; Fri, 05 Oct 2018 14:23:31 +0200 Received: (nullmailer pid 31475 invoked by uid 10006); Fri, 05 Oct 2018 12:23:30 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Fri, 5 Oct 2018 14:23:30 +0200 Message-Id: <20181005122330.31431-1-arne@rfc2549.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005114918.30626-1-arne@rfc2549.org> References: <20181005114918.30626-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.2 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1g8P8v-00169h-12 Subject: [Openvpn-devel] [PATCH v3] 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. Acked-by: Gert Doering --- configure.ac | 1 + src/openvpn/openssl_compat.h | 20 ++++++++++++++++++++ 2 files changed, 21 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..9560b29f 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_METH_SET_SIGN) +/** + * Set the sign function of an RSA_METHOD object + * + * @param meth The RSA_METHOD object + * @param sign The sign 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