From patchwork Sun Mar 4 06:44:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 260 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.27.255.1]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id SyvgKakwnFoPPgAAIUCqbw for ; Sun, 04 Mar 2018 12:45:13 -0500 Received: from proxy9.mail.iad3a.rsapps.net ([172.27.255.1]) by director8.mail.ord1d.rsapps.net (Dovecot) with LMTP id YQVWFakwnFp5aAAAfY0hYg ; Sun, 04 Mar 2018 12:45:13 -0500 Received: from smtp15.gate.iad3a ([172.27.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy9.mail.iad3a.rsapps.net with LMTP id cJSrIqkwnFoEZgAAGuSQww ; Sun, 04 Mar 2018 12:45:13 -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: smtp15.gate.iad3a.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; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Classification-ID: ca22fac2-1fd3-11e8-acfc-525400f46865-1-1 Received: from [216.105.38.7] ([216.105.38.7:41739] helo=lists.sourceforge.net) by smtp15.gate.iad3a.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 07/D9-09394-9A03C9A5; Sun, 04 Mar 2018 12:45:13 -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.89) (envelope-from ) id 1esXgV-000AW9-26; Sun, 04 Mar 2018 17:44:31 +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.89) (envelope-from ) id 1esXgU-000AW3-1n for openvpn-devel@lists.sourceforge.net; Sun, 04 Mar 2018 17:44:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: 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=e3jE70UcONKDlch0oryym2qWT2UMAIa2Xzf8Pq3jJCs=; b=GGNzHVczKFSZfhDZN5IFaT6JCf weEBP4nnl4FiguXe2Qtwdopegb/otthmErZQLZh/lYHQ11ne8peCyR5u9/4vetOck6VqRPZIeXhTa WwMAlT8t4GO9BhyHR3CQ9I5447rp8OrZ+RpFeAB3grqoLzEP7ygXMHOTQ6TXa+SDUAiA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=e3jE70UcONKDlch0oryym2qWT2UMAIa2Xzf8Pq3jJCs=; b=Y/dVpm3+B9mAZFM9lDk7jxkt8e NpOXyi2W3q1Uct6aYfnHVTGjvf2faiwViijG2aB2eJ8R6UN6/BxncWm22LiRH0mG6MHSC5sfjKqdN 8XxcBb7EO13LyOUCuAhW5GvJIXtCx1psddWQrJVdR6DJyHbM9Iw4IakJxENEY9I2QZGQ=; Received: from sfi-lb-mx.v20.lw.sourceforge.com ([172.30.20.201] helo=mail-io0-f193.google.com) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) id 1esXgM-000pCw-Hz for openvpn-devel@lists.sourceforge.net; Sun, 04 Mar 2018 17:44:29 +0000 Received: by mail-io0-f193.google.com with SMTP id d71so15523895iog.4 for ; Sun, 04 Mar 2018 09:44:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=e3jE70UcONKDlch0oryym2qWT2UMAIa2Xzf8Pq3jJCs=; b=iPHxqfR3cDlcZvR6GSBmKB61jS4i3Yv/aeNeRRWyYiLSE1pTEkcxBO/UDSCKVv6f5+ 5tUNBtgRjXIjBwVBwDRM9TAEkh9ZjtSbE1N1dhhiyBeIfVh7Anelvv1YorekKOwNIcrn 8DJl04AilIXQOWXyybLG8BbbUf8G588V6dvdJsU3OBxJAkW0g4q53wUNMl/l9Zjmh+Kd jRMu2s1T+MqLq8eB6UOx9ji1CbNgfv9uWWI0wAzMTXOa0kmeye11+zvH5jTRZtGMiiZH oJ2FtgFkNdNqmeT+B8kdHIWqLfgk1vndxEMv3QgRJxdFhQECHyinLfOJloVWZT4e4/lq dOTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=e3jE70UcONKDlch0oryym2qWT2UMAIa2Xzf8Pq3jJCs=; b=SBgmM/W36uEkcnlO+VfXhO8zu7c4/81megg1puV5I2hLSnWe07Q/El3xyYCy6ilsk6 TROREDeSaIpW/3cX0yIlpovQGAoxC+KuT7psmdB5ORaHYLZeOozKZ55TSfzccgcGyGSL VTEMRaF4Wijd1iFSK32QKC6syGK3S3UoV1JRkZ4EGuovSev+W8+CxoIimgwmVec7Aq9O DJua6NL6YZcV3E+zUiVrtNeKhxp6vvuTcMxGypnK0PPceDtScUnrQeWqMH6fRgIhL/zH sDuIDJ3FCVePnIxivSDk3ULT6bEU7XZxKejFE5HtRsoXNB5rsgI9Wefsdk/SqDKFdn7i YPlQ== X-Gm-Message-State: AElRT7HrDG2kAWLmnNBZFdlFDS4SfIZxDbfaJ3wtZw73Oito+8xe3ka9 lYzyavMsH7nwLQRpK56LlR+GdWLX X-Google-Smtp-Source: AG47ELvkIGS2SqoUgDXPiWdU8pizYhUHokTtsivHdJuCHfsqvQzDRUDUcCNUgpo/WnWxqUGiYbBVig== X-Received: by 10.107.190.67 with SMTP id o64mr13791430iof.94.1520185456703; Sun, 04 Mar 2018 09:44:16 -0800 (PST) Received: from saturn.home.sansel.ca (CPE40167ea0e1c2-CM788df74daaa0.cpe.net.cable.rogers.com. [99.228.215.92]) by smtp.gmail.com with ESMTPSA id p10sm3415433itb.24.2018.03.04.09.44.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Mar 2018 09:44:15 -0800 (PST) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Sun, 4 Mar 2018 12:44:02 -0500 Message-Id: <1520185442-22901-1-git-send-email-selva.nair@gmail.com> X-Mailer: git-send-email 2.1.4 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (selva.nair[at]gmail.com) 3.6 RCVD_IN_PBL RBL: Received via a relay in Spamhaus PBL [99.228.215.92 listed in zen.spamhaus.org] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -1.7 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1esXgM-000pCw-Hz Subject: [Openvpn-devel] [PATCH] Do not assume that SSL_CTX_get/set_min/max_proto_version are macros 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 From: Selva Nair Openssl docs do not explicitly state these to be macros although they are currently defined as such. Use AC_CHECK_DECLS to test for these so that both function and macro forms could be detected. Signed-off-by: Selva Nair --- Though not meant as a fixup for libressl, as a side effect this also makes 2.4.5 build with newer libressl versions. (built on freebsd 11 using libressl 2.6.4 while testing patch 238) Notes: (i) libressl defines only the set functions and neither are macros. So get functions will get used from the compat layer. configure.ac | 12 ++++++++++++ src/openvpn/openssl_compat.h | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 626b4dd..2a8e87f 100644 --- a/configure.ac +++ b/configure.ac @@ -948,6 +948,18 @@ if test "${with_crypto_library}" = "openssl"; then EC_GROUP_order_bits ] ) + AC_CHECK_DECLS( + [ + SSL_CTX_get_min_proto_version, + SSL_CTX_get_max_proto_version, + SSL_CTX_set_min_proto_version, + SSL_CTX_set_max_proto_version, + ], + , + , + [[#include ]] + + ) CFLAGS="${saved_CFLAGS}" LIBS="${saved_LIBS}" diff --git a/src/openvpn/openssl_compat.h b/src/openvpn/openssl_compat.h index d375fab..340d452 100644 --- a/src/openvpn/openssl_compat.h +++ b/src/openvpn/openssl_compat.h @@ -661,7 +661,7 @@ EC_GROUP_order_bits(const EC_GROUP *group) #define RSA_F_RSA_OSSL_PRIVATE_ENCRYPT RSA_F_RSA_EAY_PRIVATE_ENCRYPT #endif -#ifndef SSL_CTX_get_min_proto_version +#if !HAVE_DECL_SSL_CTX_GET_MIN_PROTO_VERSION /** Return the min SSL protocol version currently enabled in the context. * If no valid version >= TLS1.0 is found, return 0. */ static inline int @@ -684,7 +684,7 @@ SSL_CTX_get_min_proto_version(SSL_CTX *ctx) } #endif /* SSL_CTX_get_min_proto_version */ -#ifndef SSL_CTX_get_max_proto_version +#if !HAVE_DECL_SSL_CTX_GET_MAX_PROTO_VERSION /** Return the max SSL protocol version currently enabled in the context. * If no valid version >= TLS1.0 is found, return 0. */ static inline int @@ -707,7 +707,7 @@ SSL_CTX_get_max_proto_version(SSL_CTX *ctx) } #endif /* SSL_CTX_get_max_proto_version */ -#ifndef SSL_CTX_set_min_proto_version +#if !HAVE_DECL_SSL_CTX_SET_MIN_PROTO_VERSION /** Mimics SSL_CTX_set_min_proto_version for OpenSSL < 1.1 */ static inline int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, long tls_ver_min) @@ -736,7 +736,7 @@ SSL_CTX_set_min_proto_version(SSL_CTX *ctx, long tls_ver_min) } #endif /* SSL_CTX_set_min_proto_version */ -#ifndef SSL_CTX_set_max_proto_version +#if !HAVE_DECL_SSL_CTX_SET_MAX_PROTO_VERSION /** Mimics SSL_CTX_set_max_proto_version for OpenSSL < 1.1 */ static inline int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, long tls_ver_max)