summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-11-27 19:19:38 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-11-27 19:55:54 +0100
commit2f516f9ceaaf5b964de953aae82498818db9091b (patch)
tree90a4b7b26347429dd76ca8d6053c444156dbcf59 /src/fastd.c
parentc62a0f592c49b41d393fae580ce9f1293ee7a16d (diff)
downloadfastd-2f516f9ceaaf5b964de953aae82498818db9091b.tar
fastd-2f516f9ceaaf5b964de953aae82498818db9091b.zip
Correctly initialize OpenSSL
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c18
1 files changed, 18 insertions, 0 deletions
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;
}