Skip to contentSkip to conversation

autoconf: Fix engine checks for openssl 1.1

PATCH In review James Bottomley 3 participants 3 messages Oct 29, 2017 – Nov 4, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autoconf: Fix engine checks for openssl 1.1

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+

---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)
configure.ac +7 -0
index 6f59baef..45aa5017 100644
@@ -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
Signature · 1 line
2.12.3
#1 lore raw

Hi,

Quoted 4 lines · James Bottomley

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.

Quoted 14 lines
---
 configure.ac | 7 +++++++
 1 file changed, 7 insertions(+)
configure.ac +0 -0
index 6f59baef..45aa5017 100644
@@ -899,6 +899,13 @@ if test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "openssl"; then
 		,
 		[have_openssl_engine="no"; break]
 	)

configure.ac if test "${enable_crypto}" = "yes" -a "${with_crypto_library}" = "openssl"; then · line 911

Quoted 10 lines
configure.ac +7 -0
+	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

#2 lore raw
In reply to James Bottomley

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 <[email protected]...>
     Acked-by: Steffan Karger <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg15676.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering