From 82ee5aa5c5b77213924a917eb7d97126aa083300 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 18 Sep 2017 10:14:28 +0200 Subject: [PATCH] auth: Warn on startup if default key size is req'd --- pdns/common_startup.cc | 12 ++++++++++++ pdns/common_startup.hh | 1 + 2 files changed, 13 insertions(+) diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index ef6689adb..336426a86 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -28,6 +28,7 @@ #include #include #include "dynhandler.hh" +#include "dnsseckeeper.hh" #ifdef HAVE_SYSTEMD #include @@ -524,6 +525,17 @@ void mainthread() } catch(...) {} + // Some sanity checking on default key settings + for (const string& algotype : {"ksk", "zsk"}) { + int algo, size; + algo = DNSSECKeeper::shorthand2algorithm(::arg()["default-"+algotype+"-algorithm"]); + size = ::arg().asNum("default-"+algotype+"-size"); + if (algo == -1) + L<go(); diff --git a/pdns/common_startup.hh b/pdns/common_startup.hh index 25e98a493..a46e2ba1f 100644 --- a/pdns/common_startup.hh +++ b/pdns/common_startup.hh @@ -34,6 +34,7 @@ #include "nameserver.hh" #include "statbag.hh" #include "tcpreceiver.hh" +#include "dnsseckeeper.hh" extern ArgvMap theArg; extern StatBag S; //!< Statistics are gathered across PDNS via the StatBag class S -- 2.40.0