From 9f912c957bfe7f4b894aa9661168a310e8dd1a58 Mon Sep 17 00:00:00 2001 From: Michael Baentsch <57787676+baentsch@users.noreply.github.com> Date: Fri, 12 May 2023 06:53:06 +0200 Subject: [PATCH] disable OpenSSL if neither AES,SHA2, or SHA3 are OSSL-provided (#1453) --- .CMake/alg_support.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.CMake/alg_support.cmake b/.CMake/alg_support.cmake index abca328d2a..e84582643c 100644 --- a/.CMake/alg_support.cmake +++ b/.CMake/alg_support.cmake @@ -66,6 +66,9 @@ cmake_dependent_option(OQS_USE_SHA2_OPENSSL "" ON "OQS_USE_OPENSSL" OFF) # enough to support our incremental API. cmake_dependent_option(OQS_USE_SHA3_OPENSSL "" OFF "OQS_USE_OPENSSL" OFF) +# sanity check: Disable OpenSSL if not a single OpenSSL component define is on +cmake_dependent_option(OQS_USE_OPENSSL "" ON "OQS_USE_AES_OPENSSL OR OQS_USE_SHA2_OPENSSL OR OQS_USE_SHA3_OPENSSL" OFF) + if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") if(OQS_DIST_X86_64_BUILD OR OQS_USE_AVX2_INSTRUCTIONS) cmake_dependent_option(OQS_ENABLE_SHA3_xkcp_low_avx2 "" ON "NOT OQS_USE_SHA3_OPENSSL" OFF)