summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-12-28 12:44:27 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-12-28 12:44:27 +0100
commiteb70bf3fbc69459043196de96030ada6015ce27f (patch)
treeb30fe23d37368ac5dcd05feab4d4c4c169a43d25 /common.c
parentd86a68f510924d9afc4eec6970c68597783d245d (diff)
downloadxK-eb70bf3fbc69459043196de96030ada6015ce27f.tar.gz
xK-eb70bf3fbc69459043196de96030ada6015ce27f.tar.xz
xK-eb70bf3fbc69459043196de96030ada6015ce27f.zip
Cleanup
Diffstat (limited to 'common.c')
-rw-r--r--common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/common.c b/common.c
index 347e82b..a822847 100644
--- a/common.c
+++ b/common.c
@@ -34,6 +34,21 @@
#include <arpa/inet.h>
#include <netinet/tcp.h>
+static void
+init_openssl (void)
+{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ SSL_library_init ();
+ // XXX: this list is probably not complete
+ atexit (EVP_cleanup);
+ SSL_load_error_strings ();
+ atexit (ERR_free_strings);
+#else
+ // Cleanup is done automatically via atexit()
+ OPENSSL_init_ssl (0, NULL);
+#endif
+}
+
// --- To be moved to liberty --------------------------------------------------
static ssize_t