Blob Blame History Raw
commit dd9cfe2ef89dad185397df46227f9392a6317d35
Author: Ingo Franzki <ifranzki@linux.ibm.com>
Date:   Wed Jul 21 13:54:59 2021 +0200

    CONFIGURE: Check that OpenSSL 1.1.1 or later is available
    
    Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>

diff --git a/configure.ac b/configure.ac
index 286b7408..f47060d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -277,21 +277,14 @@ if test "x$with_openssl" != "xno"; then
 	old_libs="$LIBS"
 	CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
 	LIBS="$LIBS $OPENSSL_LIBS"
-	AC_CHECK_HEADER([openssl/ssl.h], [], [
-		if test "x$with_openssl" != "xcheck"; then
-			AC_MSG_ERROR([Build with OpenSSL requested but OpenSSL headers couldn't be found])
-		fi
-		with_openssl=no
+	AC_CHECK_HEADER([openssl/evp.h], [], [
+		AC_MSG_ERROR([OpenSSL 1.1.1 or later is required but OpenSSL headers couldn't be found])
 	])
 	if test "x$with_openssl" != "xno"; then
-		AC_CHECK_LIB([crypto], [RSA_generate_key], [
+		AC_CHECK_LIB([crypto], [EVP_sha3_256], [
 			OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto"
-			with_openssl=yes
-			], [
-				if test "x$with_openssl" != "xcheck"; then
-					AC_MSG_ERROR([Build with OpenSSL requested but OpenSSL libraries couldn't be found])
-				fi
-				with_openssl=no
+			with_openssl=yes], [
+			AC_MSG_ERROR([OpenSSL 1.1.1 or later is required but OpenSSL libraries version 1.1.1 or later couldn't be found])
 		])
 	fi
 	if test "x$with_openssl" = "xno"; then
@@ -299,6 +292,9 @@ if test "x$with_openssl" != "xno"; then
 		LIBS="$old_libs"
 	fi
 fi
+if test "x$with_openssl" != "xyes"; then
+	AC_MSG_ERROR([OpenSSL 1.1.1 or later is required but build without OpenSSL was requested])
+fi
 AC_SUBST([OPENSSL_CFLAGS])
 AC_SUBST([OPENSSL_LIBS])