From 6e2648af6b48cc24d3fe36489c961d22ddcda9d1 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 24 Aug 2022 17:05:58 +0200 Subject: [PATCH] CMake: Do not build PKCS#11 URI support with OpenSSL <1.1.1 The old version is missing the EVP_PKEY_up_ref(), which is needed to keep track of the EVP_PKEY references. Signed-off-by: Jakub Jelen Reviewed-by: Andreas Schneider Reviewed-by: Anderson Toshiyuki Sasaki --- ConfigureChecks.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 93038c59..0faa3150 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -477,6 +477,10 @@ if (WITH_PKCS11_URI) message(FATAL_ERROR "PKCS #11 is not supported for mbedcrypto") set(WITH_PKCS11_URI 0) endif() + if (HAVE_OPENSSL AND NOT OPENSSL_VERSION VERSION_GREATER_EQUAL "1.1.1") + message(FATAL_ERROR "PKCS #11 requires at least OpenSSL 1.1.1") + set(WITH_PKCS11_URI 0) + endif() endif() if (WITH_MBEDTLS)