]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move the root DNSSEC data to a header file 4357/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 23 Aug 2016 14:53:40 +0000 (16:53 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 23 Aug 2016 14:53:40 +0000 (16:53 +0200)
Fixes #4253

pdns/Makefile.am
pdns/rec-lua-conf.cc
pdns/recursordist/Makefile.am
pdns/recursordist/root-dnssec.hh [new symlink]
pdns/root-dnssec.hh [new file with mode: 0644]
pdns/toysdig.cc

index eee30caf3595a5865c3789c6092fb215850f871c..b12a0e4320b54b691dbbeaca1cd5965768e62fbf 100644 (file)
@@ -678,6 +678,7 @@ toysdig_SOURCES = \
        opensslsigners.cc opensslsigners.hh \
        qtype.cc \
        randomhelper.cc \
+       root-dnssec.hh \
        rcpgenerator.cc rcpgenerator.hh \
        rec-lua-conf.hh \
        recursor_cache.hh \
index 73822342e17c9f267d5b5c29cfececda2a64dbd0..abccedbd639d4a5f30a74829763f401473a95517 100644 (file)
@@ -15,6 +15,7 @@
 #include "base64.hh"
 #include "remote_logger.hh"
 #include "validate.hh"
+#include "root-dnssec.hh"
 
 GlobalStateHolder<LuaConfigItems> g_luaconfs; 
 
@@ -33,8 +34,10 @@ GlobalStateHolder<LuaConfigItems> g_luaconfs;
 
 LuaConfigItems::LuaConfigItems()
 {
-  auto ds=unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make("19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5")));
-  dsAnchors[DNSName(".")].insert(*ds);
+  for (const auto &dsRecord : rootDSs) {
+    auto ds=unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(dsRecord)));
+    dsAnchors[DNSName(".")].insert(*ds);
+  }
 }
 
 /* DID YOU READ THE STORY ABOVE? */
index dbed2fad116cf8feb79a0e3c5815b09f8cbc8f97..733c76f1d22be61f7b4a48db88e7f872a842772c 100644 (file)
@@ -117,6 +117,7 @@ pdns_recursor_SOURCES = \
        resolver.hh resolver.cc \
        responsestats.hh responsestats.cc \
        root-addresses.hh \
+       root-dnssec.hh \
        rpzloader.cc rpzloader.hh \
        secpoll-recursor.cc \
        secpoll-recursor.hh \
diff --git a/pdns/recursordist/root-dnssec.hh b/pdns/recursordist/root-dnssec.hh
new file mode 120000 (symlink)
index 0000000..2d290c1
--- /dev/null
@@ -0,0 +1 @@
+../root-dnssec.hh
\ No newline at end of file
diff --git a/pdns/root-dnssec.hh b/pdns/root-dnssec.hh
new file mode 100644 (file)
index 0000000..0d4b3b4
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#pragma once
+
+static const char*rootDSs[]={"19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5"};
index fefe41460954c9a93305be29b10d22bc0c2ff317..4992b05741d5fc96a79a72fbb979ea970b256bc9 100644 (file)
@@ -12,6 +12,7 @@
 #include "dnssecinfra.hh"
 #include "recursor_cache.hh"
 #include "base32.hh"
+#include "root-dnssec.hh"
 
 #include "validate.hh"
 StatBag S;
@@ -100,8 +101,10 @@ private:
 GlobalStateHolder<LuaConfigItems> g_luaconfs;
 LuaConfigItems::LuaConfigItems()
 {
-  auto ds=std::unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make("19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5")));
-  dsAnchors[DNSName(".")].insert(*ds);
+  for (const auto &dsRecord : rootDSs) {
+    auto ds=unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(dsRecord)));
+    dsAnchors[DNSName(".")].insert(*ds);
+  }
 }
 
 DNSFilterEngine::DNSFilterEngine() {}