aboutsummaryrefslogtreecommitdiff
path: root/src/libmain/shared.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-01-06 16:43:09 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-01-06 16:43:09 +0100
commit146af4ee9bb03968a7322a1ac70dc60c8d5a35e2 (patch)
treeb88e88473010f822fd240c43864f072010259557 /src/libmain/shared.cc
parent3edcb198e5db69d0e5771a161a33115033b74af5 (diff)
Move sodium_init() call
Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r--src/libmain/shared.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 2247aeca4..e9f067e35 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -18,6 +18,10 @@
#include <openssl/crypto.h>
+#if HAVE_SODIUM
+#include <sodium.h>
+#endif
+
namespace nix {
@@ -126,6 +130,11 @@ void initNix()
CRYPTO_set_locking_callback(opensslLockCallback);
#endif
+#if HAVE_SODIUM
+ if (sodium_init() == -1)
+ throw Error("could not initialise libsodium");
+#endif
+
loadConfFile();
startSignalHandlerThread();