From 558ff848c5f17594a63089ce722e2e15c02e2a47 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Mon, 4 Apr 2016 10:39:17 +0200 Subject: [PATCH] allow common signing key --- pdns/pdnssec.cc | 67 +++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index aea4a2790e..2b97d20605 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -1023,18 +1023,14 @@ bool secureZone(DNSSECKeeper& dk, const std::string& zone) throw runtime_error("KSK key size must be equal to or greater than 0"); } - if (k_algos.size() < 1) { - throw runtime_error("No algorithm(s) given for KSK"); + if (k_algos.size() < 1 && z_algos.size() < 1) { + throw runtime_error("Zero algorithms given for KSK+ZSK in total"); } if (z_size < 0) { throw runtime_error("ZSK key size must be equal to or greater than 0"); } - if (z_algos.size() < 1) { - throw runtime_error("No algorithm(s) given for ZSK"); - } - if(dk.isSecuredZone(zone)) { cerr << "Zone '"<::iterator i = k_algos.begin()+1; i != k_algos.end(); i++) - dk.addKey(zone, true, shorthand2algorithm(*i), k_size, true); // obvious errors will have been caught above BOOST_FOREACH(string z_algo, z_algos) { + cout << "Adding ZSK with algorithm " << z_algo << endl; + int algo = shorthand2algorithm(z_algo); - dk.addKey(zone, false, algo, z_size); + + if(!dk.addKey(zone, false, algo, z_size, true)) { + cerr<<"No backend was able to secure '"<