[Openvpn-devel] autoconf: Fix engine checks for openssl 1.1

Message ID 1509291288.3116.14.camel@HansenPartnership.com
State Accepted
Headers show
Series [Openvpn-devel] autoconf: Fix engine checks for openssl 1.1 | expand

Commit Message

James Bottomley Oct. 29, 2017, 4:34 a.m. UTC
In openssl 1.1, ENGINE_cleanup became a #define instead of a function
(because it's no longer needed as engines are self cleaning).  Update
the autoconf.ac script to check for ENGINE_cleanup as a declaration to
avoid falsely underfinig HAVE_OPENSSL_ENGINE in openssl 1.1+

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Steffan Karger Nov. 1, 2017, 7:33 a.m. UTC | #1
Hi,

On 29-10-17 16:34, James Bottomley wrote:
> In openssl 1.1, ENGINE_cleanup became a #define instead of a function
> (because it's no longer needed as engines are self cleaning).  Update
> the autoconf.ac script to check for ENGINE_cleanup as a declaration to
> avoid falsely underfinig HAVE_OPENSSL_ENGINE in openssl 1.1+

Typo in "underfinig", but that should be fixable when applying the patch.

> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
> ---
>  configure.ac | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/configure.ac b/configure.ac
> index 6f59baef..45aa5017 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -899,6 +899,13 @@ if test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "openssl"; then
>  		,
>  		[have_openssl_engine="no"; break]
>  	)
> +	if test "${have_openssl_engine}" = "no"; then
> +		AC_CHECK_DECL( [ENGINE_cleanup], [have_openssl_engine="yes"],,
> +			[[
> +				#include <openssl/engine.h>
> +			]]
> +		)
> +	fi
>  	if test "${have_openssl_engine}" = "yes"; then
>  		AC_DEFINE([HAVE_OPENSSL_ENGINE], [1], [OpenSSL engine support available])
>  	fi
> 

Change looks good, and does what it says on the tin.  ACK.

-Steffan

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Gert Doering Nov. 4, 2017, 6:55 a.m. UTC | #2
Your patch has been applied to the master and release/2.4 branch.

commit 6b5dbf6c8da0ff82fa1dca4eb4665be0a4fe31d3 (master)
commit 7e047e93f5d5317be1d491c6269524cee9a07085 (release/2.4)
Author: James Bottomley
Date:   Sun Oct 29 15:34:48 2017 +0000

     autoconf: Fix engine checks for openssl 1.1

     Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
     Acked-by: Steffan Karger <steffan.karger@fox-it.com>
     Message-Id: <1509291288.3116.14.camel@HansenPartnership.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15676.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

Patch

diff --git a/configure.ac b/configure.ac
index 6f59baef..45aa5017 100644
--- a/configure.ac
+++ b/configure.ac
@@ -899,6 +899,13 @@  if test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "openssl"; then
 		,
 		[have_openssl_engine="no"; break]
 	)
+	if test "${have_openssl_engine}" = "no"; then
+		AC_CHECK_DECL( [ENGINE_cleanup], [have_openssl_engine="yes"],,
+			[[
+				#include <openssl/engine.h>
+			]]
+		)
+	fi
 	if test "${have_openssl_engine}" = "yes"; then
 		AC_DEFINE([HAVE_OPENSSL_ENGINE], [1], [OpenSSL engine support available])
 	fi