From: Pieter Lexis Date: Tue, 23 Aug 2016 14:53:40 +0000 (+0200) Subject: Move the root DNSSEC data to a header file X-Git-Tag: rec-4.0.2~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4357%2Fhead;p=thirdparty%2Fpdns.git Move the root DNSSEC data to a header file Fixes #4253 --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index eee30caf35..b12a0e4320 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -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 \ diff --git a/pdns/rec-lua-conf.cc b/pdns/rec-lua-conf.cc index 73822342e1..abccedbd63 100644 --- a/pdns/rec-lua-conf.cc +++ b/pdns/rec-lua-conf.cc @@ -15,6 +15,7 @@ #include "base64.hh" #include "remote_logger.hh" #include "validate.hh" +#include "root-dnssec.hh" GlobalStateHolder g_luaconfs; @@ -33,8 +34,10 @@ GlobalStateHolder g_luaconfs; LuaConfigItems::LuaConfigItems() { - auto ds=unique_ptr(dynamic_cast(DSRecordContent::make("19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5"))); - dsAnchors[DNSName(".")].insert(*ds); + for (const auto &dsRecord : rootDSs) { + auto ds=unique_ptr(dynamic_cast(DSRecordContent::make(dsRecord))); + dsAnchors[DNSName(".")].insert(*ds); + } } /* DID YOU READ THE STORY ABOVE? */ diff --git a/pdns/recursordist/Makefile.am b/pdns/recursordist/Makefile.am index dbed2fad11..733c76f1d2 100644 --- a/pdns/recursordist/Makefile.am +++ b/pdns/recursordist/Makefile.am @@ -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 index 0000000000..2d290c1c5b --- /dev/null +++ b/pdns/recursordist/root-dnssec.hh @@ -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 index 0000000000..0d4b3b4ea1 --- /dev/null +++ b/pdns/root-dnssec.hh @@ -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"}; diff --git a/pdns/toysdig.cc b/pdns/toysdig.cc index fefe414609..4992b05741 100644 --- a/pdns/toysdig.cc +++ b/pdns/toysdig.cc @@ -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 g_luaconfs; LuaConfigItems::LuaConfigItems() { - auto ds=std::unique_ptr(dynamic_cast(DSRecordContent::make("19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5"))); - dsAnchors[DNSName(".")].insert(*ds); + for (const auto &dsRecord : rootDSs) { + auto ds=unique_ptr(dynamic_cast(DSRecordContent::make(dsRecord))); + dsAnchors[DNSName(".")].insert(*ds); + } } DNSFilterEngine::DNSFilterEngine() {}