summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/fastd.c18
-rw-r--r--src/fastd_config.h.in1
3 files changed, 20 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index da20721..4bcbb65 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -40,7 +40,7 @@ add_executable(fastd
set_property(TARGET fastd PROPERTY COMPILE_FLAGS "${FASTD_CFLAGS}")
set_property(TARGET fastd PROPERTY LINK_FLAGS "-pthread ${UECC_LDFLAGS_OTHER} ${NACL_LDFLAGS_OTHER} ${OPENSSL_CRYPTO_LDFLAGS_OTHER}")
set_property(TARGET fastd APPEND PROPERTY INCLUDE_DIRECTORIES ${CAP_INCLUDE_DIR} ${NACL_INCLUDE_DIRS})
-target_link_libraries(fastd protocols methods ciphers macs ${RT_LIBRARY} ${CAP_LIBRARY} ${UECC_LIBRARIES} ${NACL_LIBRARIES})
+target_link_libraries(fastd protocols methods ciphers macs ${RT_LIBRARY} ${CAP_LIBRARY} ${UECC_LIBRARIES} ${NACL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
add_dependencies(fastd version)
diff --git a/src/fastd.c b/src/fastd.c
index 469fc6f..28ff207 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -44,6 +44,12 @@
#include <sodium/core.h>
#endif
+#ifdef USE_OPENSSL
+#include <openssl/conf.h>
+#include <openssl/evp.h>
+#include <openssl/err.h>
+#endif
+
static volatile bool sighup = false;
static volatile bool terminate = false;
@@ -744,6 +750,12 @@ int main(int argc, char *argv[]) {
sodium_init();
#endif
+#ifdef USE_OPENSSL
+ ERR_load_crypto_strings();
+ OpenSSL_add_all_algorithms();
+ OPENSSL_config(NULL);
+#endif
+
fastd_context_t ctx = {};
close_fds(&ctx);
@@ -878,5 +890,11 @@ int main(int argc, char *argv[]) {
close_log(&ctx);
fastd_config_release(&ctx, &conf);
+#ifdef USE_OPENSSL
+ CONF_modules_free();
+ EVP_cleanup();
+ ERR_free_strings();
+#endif
+
return 0;
}
diff --git a/src/fastd_config.h.in b/src/fastd_config.h.in
index 8ef3aa0..8a6ae22 100644
--- a/src/fastd_config.h.in
+++ b/src/fastd_config.h.in
@@ -46,6 +46,7 @@
#cmakedefine HAVE_LIBSODIUM
+#cmakedefine USE_OPENSSL
#define MAX_CONFIG_DEPTH @MAX_CONFIG_DEPTH_NUM@