chantra / rpms / tpm2-tss

Forked from rpms/tpm2-tss 2 years ago
Clone

Blame SOURCES/0008-Require-OpenSSL-1.1.0.patch

a23473
From 090a10a69340dc0825f611eceac60bf3f904a5ec Mon Sep 17 00:00:00 2001
a23473
From: Petr Gotthard <petr.gotthard@centrum.cz>
a23473
Date: Sat, 17 Jul 2021 22:43:00 +0200
a23473
Subject: Require OpenSSL >= 1.1.0
a23473
MIME-Version: 1.0
a23473
Content-Type: text/plain; charset=UTF-8
a23473
Content-Transfer-Encoding: 8bit
a23473
a23473
To reduce the amount of version-specific code we drop support for
a23473
OpenSSL prior 1.1.0, including all forks such as LibreSSL, which are
a23473
not API compatible with OpenSSL >= 1.1.0.
a23473
a23473
Python 3.10 will even require OpenSSL >= 1.1.1. The corresponding
a23473
PEP 644 contains a detailed impact analysis which is also relevant
a23473
here.
a23473
a23473
Signed-off-by: Petr Gotthard <petr.gotthard@centrum.cz>
a23473
---
a23473
 INSTALL.md   | 3 +--
a23473
 configure.ac | 6 +++++-
a23473
 2 files changed, 6 insertions(+), 3 deletions(-)
a23473
a23473
diff --git a/INSTALL.md b/INSTALL.md
a23473
index eec94c45..658e1f28 100644
a23473
--- a/INSTALL.md
a23473
+++ b/INSTALL.md
a23473
@@ -14,7 +14,7 @@ following sections describe them for the supported platforms.
a23473
 * C library development libraries and header files
a23473
 * pkg-config
a23473
 * doxygen
a23473
-* OpenSSL development libraries and header files
a23473
+* OpenSSL development libraries and header files, version >= 1.1.0
a23473
 * libcurl development libraries
a23473
 
a23473
 The following are dependencies only required when building test suites.
a23473
@@ -71,7 +71,6 @@ C Runtime (UCRT) version 10.0.16299.0. Building the type marshaling library
a23473
 (tss2-mu.dll) and the system API (tss2-sapi.dll) should be as simple as
a23473
 loading the tpm2-tss solution (tpm2-tss.sln) with a compatible and properly
a23473
 configured version of Visual Studio 2017 and pressing the 'build' button.
a23473
-Windows build setup requires OpenSSL >= v1.0.2 crypto library.
a23473
 
a23473
 ### References
a23473
 Visual Studio 2017 with "Clang for Windows": https://blogs.msdn.microsoft.com/vcblog/2017/03/07/use-any-c-compiler-with-visual-studio/
a23473
diff --git a/configure.ac b/configure.ac
a23473
index d4324c9a..12baa257 100755
a23473
--- a/configure.ac
a23473
+++ b/configure.ac
a23473
@@ -132,9 +132,13 @@ AC_ARG_WITH([crypto],
a23473
 AM_CONDITIONAL(ESYS_OSSL, test "x$with_crypto" = "xossl")
a23473
 AM_CONDITIONAL(ESYS_MBED, test "x$with_crypto" = "xmbed")
a23473
 
a23473
+m4_define([ossl_min_version], [1.1.0])
a23473
+m4_define([ossl_err], [OpenSSL libcrypto is missing or version requirements not met. OpenSSL version must be >= ossl_min_version])
a23473
 AS_IF([test "x$enable_esys" = xyes],
a23473
       [AS_IF([test "x$with_crypto" = xossl], [
a23473
-           PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
a23473
+           PKG_CHECK_MODULES([LIBCRYPTO],
a23473
+                             [libcrypto >= ossl_min_version],,
a23473
+                             [AC_MSG_ERROR([ossl_err])])
a23473
            AC_DEFINE([OSSL], [1], [OpenSSL cryptographic backend])
a23473
            TSS2_ESYS_CFLAGS_CRYPTO="$LIBCRYPTO_CFLAGS"
a23473
            TSS2_ESYS_LDFLAGS_CRYPTO="$LIBCRYPTO_LIBS"
a23473
-- 
a23473
2.26.3
a23473