Blame SOURCES/opencryptoki-openssl3-dd9cfe2ef89dad185397df46227f9392a6317d35.patch

2c1758
commit dd9cfe2ef89dad185397df46227f9392a6317d35
2c1758
Author: Ingo Franzki <ifranzki@linux.ibm.com>
2c1758
Date:   Wed Jul 21 13:54:59 2021 +0200
2c1758
2c1758
    CONFIGURE: Check that OpenSSL 1.1.1 or later is available
2c1758
    
2c1758
    Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2c1758
2c1758
diff --git a/configure.ac b/configure.ac
2c1758
index 286b7408..f47060d9 100644
2c1758
--- a/configure.ac
2c1758
+++ b/configure.ac
2c1758
@@ -277,21 +277,14 @@ if test "x$with_openssl" != "xno"; then
2c1758
 	old_libs="$LIBS"
2c1758
 	CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
2c1758
 	LIBS="$LIBS $OPENSSL_LIBS"
2c1758
-	AC_CHECK_HEADER([openssl/ssl.h], [], [
2c1758
-		if test "x$with_openssl" != "xcheck"; then
2c1758
-			AC_MSG_ERROR([Build with OpenSSL requested but OpenSSL headers couldn't be found])
2c1758
-		fi
2c1758
-		with_openssl=no
2c1758
+	AC_CHECK_HEADER([openssl/evp.h], [], [
2c1758
+		AC_MSG_ERROR([OpenSSL 1.1.1 or later is required but OpenSSL headers couldn't be found])
2c1758
 	])
2c1758
 	if test "x$with_openssl" != "xno"; then
2c1758
-		AC_CHECK_LIB([crypto], [RSA_generate_key], [
2c1758
+		AC_CHECK_LIB([crypto], [EVP_sha3_256], [
2c1758
 			OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto"
2c1758
-			with_openssl=yes
2c1758
-			], [
2c1758
-				if test "x$with_openssl" != "xcheck"; then
2c1758
-					AC_MSG_ERROR([Build with OpenSSL requested but OpenSSL libraries couldn't be found])
2c1758
-				fi
2c1758
-				with_openssl=no
2c1758
+			with_openssl=yes], [
2c1758
+			AC_MSG_ERROR([OpenSSL 1.1.1 or later is required but OpenSSL libraries version 1.1.1 or later couldn't be found])
2c1758
 		])
2c1758
 	fi
2c1758
 	if test "x$with_openssl" = "xno"; then
2c1758
@@ -299,6 +292,9 @@ if test "x$with_openssl" != "xno"; then
2c1758
 		LIBS="$old_libs"
2c1758
 	fi
2c1758
 fi
2c1758
+if test "x$with_openssl" != "xyes"; then
2c1758
+	AC_MSG_ERROR([OpenSSL 1.1.1 or later is required but build without OpenSSL was requested])
2c1758
+fi
2c1758
 AC_SUBST([OPENSSL_CFLAGS])
2c1758
 AC_SUBST([OPENSSL_LIBS])
2c1758