Remove the embedded sha1 code, and use one of botan or gcrypt

This adds a hard dependency on one of Botan or gcrypt. Botan is already a
recommended dependency, and gcrypt is probably packaged almost everywhere,
so this should not be a big deal.

ref #3241
This commit is contained in:
louiz’
2017-03-06 00:57:33 +01:00
parent d81c3ad5ac
commit 99a4ddedaf
8 changed files with 84 additions and 170 deletions
+11
View File
@@ -33,6 +33,10 @@ elseif(NOT WITHOUT_BOTAN)
find_package(BOTAN)
endif()
if(NOT BOTAN_FOUND)
find_package(GCRYPT REQUIRED)
endif()
if(WITH_UDNS)
find_package(UDNS REQUIRED)
elseif(NOT WITHOUT_UDNS)
@@ -67,6 +71,11 @@ if(BOTAN_FOUND)
set(BOTAN_FOUND ${BOTAN_FOUND} PARENT_SCOPE)
set(BOTAN_INCLUDE_DIRS ${BOTAN_INCLUDE_DIRS} PARENT_SCOPE)
endif()
if(GCRYPT_FOUND)
include_directories(SYSTEM ${GCRYPT_INCLUDE_DIRS})
set(GCRYPT_FOUND ${GCRYPT_FOUND} PARENT_SCOPE)
set(GCRYPT_INCLUDE_DIRS ${GCRYPT_INCLUDE_DIRS} PARENT_SCOPE)
endif()
if(UDNS_FOUND)
include_directories(${UDNS_INCLUDE_DIRS})
@@ -117,6 +126,8 @@ add_library(network STATIC ${source_network})
target_link_libraries(network logger)
if(BOTAN_FOUND)
target_link_libraries(network ${BOTAN_LIBRARIES})
elseif(GCRYPT_FOUND)
target_link_libraries(network ${GCRYPT_LIBRARIES})
endif()
if(UDNS_FOUND)
target_link_libraries(network ${UDNS_LIBRARIES})