aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-11 13:40:44 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-06-11 13:40:44 +0100
commit4eac8a4828fa434d94dc662fe3b5426bf396d7be (patch)
treed74cf37d71bb744b08fe8180daa06d93340500e6 /src/libutil
parente48dc88595c2ddd7be31512ba6677ceff09d7632 (diff)
downloadrspamd-4eac8a4828fa434d94dc662fe3b5426bf396d7be.tar.gz
rspamd-4eac8a4828fa434d94dc662fe3b5426bf396d7be.zip
[Feature] Allow to set ciphers and CA paths in config
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c
index 10753ec93..17dc0d644 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -29,6 +29,8 @@
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/ssl.h>
+#include <openssl/conf.h>
+#include <openssl/engine.h>
#endif
#ifdef HAVE_TERMIOS_H
@@ -2009,8 +2011,22 @@ rspamd_init_libs (void)
OpenSSL_add_all_algorithms ();
OpenSSL_add_all_digests ();
OpenSSL_add_all_ciphers ();
+
+#if OPENSSL_VERSION_NUMBER >= 0x1000104fL
+ ENGINE_load_builtin_engines ();
+
+ if ((ctx->crypto_ctx->cpu_config & CPUID_RDRAND) == 0) {
+ RAND_set_rand_engine (NULL);
+ }
+#endif
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ SSL_library_init ();
+#else
+ OPENSSL_init_ssl (0, NULL);
+#endif
SSL_library_init ();
SSL_load_error_strings ();
+ OPENSSL_config (NULL);
if (RAND_poll () == 0) {
guchar seed[128];