]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
hook up ed25519 signer in the recursor
authorKees Monshouwer <mind04@monshouwer.org>
Tue, 10 Jan 2017 21:50:12 +0000 (22:50 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 9 May 2017 09:46:15 +0000 (11:46 +0200)
(cherry picked from commit d1b28475acae46cf39d2a883791953910b89ea67)

pdns/pdns_recursor.cc
pdns/recursordist/Makefile.am
pdns/recursordist/configure.ac
pdns/recursordist/m4/pdns_check_libsodium.m4 [new symlink]
pdns/recursordist/sodiumsigners.cc [new symlink]

index 02ec0b97be8cb0b1240f8d16c22d4322a8ba15b5..7cbc352da5810150ad986cfd5703c3b1c5137dff 100644 (file)
@@ -33,6 +33,9 @@
 #include "recpacketcache.hh"
 #include "utility.hh"
 #include "dns_random.hh"
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+#endif
 #include "opensslsigners.hh"
 #include <iostream>
 #include <errno.h>
@@ -2777,6 +2780,13 @@ int serviceMain(int argc, char*argv[])
   g_maxMThreads = ::arg().asNum("max-mthreads");
   checkOrFixFDS();
 
+#ifdef HAVE_LIBSODIUM
+  if (sodium_init() == -1) {
+    L<<Logger::Error<<"Unable to initialize sodium crypto library"<<endl;
+    exit(99);
+  }
+#endif
+
   openssl_thread_setup();
   openssl_seed();
 
index 567aab096f0abc68740edab8a06a6f00ccfdc8d0..2899bb37fdafe0bc399910923e33dd9ff400400a 100644 (file)
@@ -230,6 +230,12 @@ pdns_recursor_SOURCES += \
 pdns_recursor_LDADD += $(BOTAN110_LIBS)
 endif
 
+if LIBSODIUM
+pdns_recursor_SOURCES += \
+       sodiumsigners.cc
+pdns_recursor_LDADD += $(LIBSODIUM_LIBS)
+endif
+
 if MALLOC_TRACE
 pdns_recursor_SOURCES += \
        malloctrace.cc \
index d623f2efe61301473ebe97ee5032afd6dc30f000..19b69b21220e0bed013b8bc25b3b14676c09f1f9 100644 (file)
@@ -113,6 +113,7 @@ PDNS_CHECK_LIBCRYPTO([
   ]
 )
 PDNS_CHECK_LIBCRYPTO_ECDSA
+PDNS_CHECK_LIBSODIUM
 
 # check for tools we might need
 PDNS_CHECK_RAGEL
diff --git a/pdns/recursordist/m4/pdns_check_libsodium.m4 b/pdns/recursordist/m4/pdns_check_libsodium.m4
new file mode 120000 (symlink)
index 0000000..2dbf381
--- /dev/null
@@ -0,0 +1 @@
+../../../m4/pdns_check_libsodium.m4
\ No newline at end of file
diff --git a/pdns/recursordist/sodiumsigners.cc b/pdns/recursordist/sodiumsigners.cc
new file mode 120000 (symlink)
index 0000000..ef247a5
--- /dev/null
@@ -0,0 +1 @@
+../sodiumsigners.cc
\ No newline at end of file