Skip to content

Commit

Permalink
Update g10 fuzzer with linking to Botan library.
Browse files Browse the repository at this point in the history
  • Loading branch information
ni4 committed Jul 25, 2024
1 parent c5f6c60 commit 36b9735
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/fuzzing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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"
Expand All @@ -136,6 +139,7 @@ target_include_directories(fuzz_keyring_g10
target_link_libraries(fuzz_keyring_g10
PRIVATE
librnp-static
Botan::Botan
)

if (ENABLE_SANITIZERS)
Expand Down
6 changes: 3 additions & 3 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 36b9735

Please sign in to comment.