From patchwork Fri Oct 5 02:20:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 482 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 0GKgCWNXt1vrIQAAIUCqbw for ; Fri, 05 Oct 2018 08:21:55 -0400 Received: from proxy2.mail.ord1d.rsapps.net ([172.30.191.6]) by director8.mail.ord1d.rsapps.net with LMTP id IHxpCWNXt1u/fwAAfY0hYg ; Fri, 05 Oct 2018 08:21:55 -0400 Received: from smtp30.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy2.mail.ord1d.rsapps.net with LMTP id ME4PCWNXt1vZawAAfawv4w ; Fri, 05 Oct 2018 08:21:55 -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: smtp30.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: 3e289238-c899-11e8-9769-5254001e8e38-1-1 Received: from [216.105.38.7] ([216.105.38.7:43219] helo=lists.sourceforge.net) by smtp30.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 82/82-12036-16757BB5; Fri, 05 Oct 2018 08:21:54 -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 1g8P6A-0003ES-Vy; Fri, 05 Oct 2018 12:20:50 +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 1g8P69-0003EG-GN for openvpn-devel@lists.sourceforge.NET; Fri, 05 Oct 2018 12:20:49 +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=xL4DniJbo4IUnm6ONSCqMAYLxEdIAjL2ILRnFJKrjZU=; b=MXrLDLWGVXOXZQ0l1NGlsAMA+4 grzLsw+ZaC1SLVdn/7IlW1fsQ32fdeGeZdMam3+NrrYecUBPur29xo6KrHHyLbI+iHCvK1InDc6lF AYRM0IZqOVlhCkmg/vt/cDX5OjykPHkY8/zGvv2OCmt0JRuiI81Ig9Zhs8RiYH9DI+pM=; 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=xL4DniJbo4IUnm6ONSCqMAYLxEdIAjL2ILRnFJKrjZU=; b=hAkqEYE0nIKLoc/i46iSHPwi/i rOOP46xjmlXIQU4w92qt61m+TNYgN3T/5Sy0NLZDJ4s9kQ9OuXMFI9A/sg7dvi8vmQpRC4rOfzBdc fUGmKGowz4XxDgg3q7UaloQkjtMklyr6R5omUhCxzQ/SARHuL2Rzp9Kwpz8D/M1gBJOw=; Received: from [192.26.174.232] (helo=mail.blinkt.de) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1g8P65-00163r-4u for openvpn-devel@lists.sourceforge.NET; Fri, 05 Oct 2018 12:20:49 +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 1g8P5s-000KII-M9 for openvpn-devel@lists.sourceforge.net; Fri, 05 Oct 2018 14:20:32 +0200 Received: (nullmailer pid 31252 invoked by uid 10006); Fri, 05 Oct 2018 12:20:32 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Fri, 5 Oct 2018 14:20:32 +0200 Message-Id: <20181005122032.31208-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 1.0 RDNS_NONE Delivered to internal network by a host with no rDNS -0.5 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1g8P65-00163r-4u 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. --- 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..d2c8d4a6 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 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