From 36b973564060729c6dd331435cbd602bc8fba84b Mon Sep 17 00:00:00 2001 From: Nickolay Olshevsky Date: Thu, 25 Jul 2024 13:46:37 +0300 Subject: [PATCH] Update g10 fuzzer with linking to Botan library. --- src/fuzzing/CMakeLists.txt | 6 +++++- src/lib/CMakeLists.txt | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/fuzzing/CMakeLists.txt b/src/fuzzing/CMakeLists.txt index c177035e1d..5b3a74c8ee 100644 --- a/src/fuzzing/CMakeLists.txt +++ b/src/fuzzing/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Ribose Inc. +# Copyright (c) 2020, 2024 Ribose Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -22,6 +22,7 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. +find_package(Botan 2.14.0 REQUIRED) if(NOT DEFINED ENV{LIB_FUZZING_ENGINE}) add_compile_options(-fsanitize=fuzzer-no-link) @@ -127,6 +128,8 @@ target_link_libraries(fuzz_keyring_kbx add_executable(fuzz_keyring_g10 keyring_g10.cpp) +set_target_properties(fuzz_keyring_g10 PROPERTIES CXX_STANDARD 20) + target_include_directories(fuzz_keyring_g10 PRIVATE "${PROJECT_SOURCE_DIR}/src" @@ -136,6 +139,7 @@ target_include_directories(fuzz_keyring_g10 target_link_libraries(fuzz_keyring_g10 PRIVATE librnp-static + Botan::Botan ) if (ENABLE_SANITIZERS) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 5d77df7eac..1e4443c757 100755 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -58,9 +58,9 @@ if(ENABLE_PQC) endif() # check that AEAD is enabled and not turned off for ENABLE_CRYPTO_REFRESH - if(ENABLE_CRYPTO_REFRESH AND (NOT ENABLE_AEAD)) - message(FATAL_ERROR "ENABLE_CRYPTO_REFRESH requires ENABLE_AEAD, but it's either Off or Auto and got turned off") - endif() +if(ENABLE_CRYPTO_REFRESH AND (NOT ENABLE_AEAD)) + message(FATAL_ERROR "ENABLE_CRYPTO_REFRESH requires ENABLE_AEAD, but it's either Off or Auto and got turned off") +endif() # generate a config.h include(CheckIncludeFileCXX)