From 2f516f9ceaaf5b964de953aae82498818db9091b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 27 Nov 2013 19:19:38 +0100 Subject: Correctly initialize OpenSSL --- src/fastd.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/fastd.c') 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 #endif +#ifdef USE_OPENSSL +#include +#include +#include +#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; } -- cgit v1.2.3