From cecb59abd4edcbb6036369c5eb0413a274866a7f Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Thu, 23 Sep 2010 20:44:47 +0000 Subject: [PATCH] fix up pdnssec compilation git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1724 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/dnsseckeeper.cc | 24 ++++++++++++++---------- pdns/dnsseckeeper.hh | 9 ++++++--- pdns/pdnssec.cc | 8 ++++---- 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/pdns/dnsseckeeper.cc b/pdns/dnsseckeeper.cc index 7bfe76b72..0fc061de2 100644 --- a/pdns/dnsseckeeper.cc +++ b/pdns/dnsseckeeper.cc @@ -77,15 +77,15 @@ bool DNSSECKeeper::haveKSKFor(const std::string& zone, DNSSECPrivateKey* dpk) // cerr<<"Hit!"<d_key.getContext(), dir_itr->path().file_string().c_str()); + getRSAKeyFromISC(&dpk->d_key.getContext(), dir_itr->path().file_string().c_str()); - if(getNSEC3PARAM(zone)) { - dpk->d_algorithm = 7; - } - else { - dpk->d_algorithm = 5; - } - + if(getNSEC3PARAM(zone)) { + dpk->d_algorithm = 7; + } + else { + dpk->d_algorithm = 5; + } + } return true; } @@ -138,12 +138,14 @@ void DNSSECKeeper::addZSKFor(const std::string& name, int algorithm, bool next) } +/* bool zskSortByDates(const DNSSECKeeper::zskset_t::value_type& a, const DNSSECKeeper::zskset_t::value_type& b) { return tie(a.second.beginValidity, a.second.endValidity) < tie(b.second.beginValidity, b.second.endValidity); } +* */ void DNSSECKeeper::deleteZSKFor(const std::string& zname, const std::string& fname) { unlink((d_dirname +"/"+ zname +"/zsks/"+fname).c_str()); @@ -234,14 +236,16 @@ DNSSECKeeper::zskset_t DNSSECKeeper::getZSKsFor(const std::string& zone, bool al ts2.tm_mon--; KeyMetaData kmd; + /* kmd.beginValidity=timegm(&ts1); kmd.endValidity=timegm(&ts2); time_t now=time(0); - kmd.active = now > kmd.beginValidity && now < kmd.endValidity; + */ + kmd.active = 1; // XXX FIXME GOOD ONE! // now > kmd.beginValidity && now < kmd.endValidity; kmd.fname = dir_itr->leaf(); zskset.push_back(make_pair(dpk, kmd)); } - sort(zskset.begin(), zskset.end(), zskSortByDates); + // sort(zskset.begin(), zskset.end(), zskSortByDates); } return zskset; diff --git a/pdns/dnsseckeeper.hh b/pdns/dnsseckeeper.hh index f76d2c6de..f777c7197 100644 --- a/pdns/dnsseckeeper.hh +++ b/pdns/dnsseckeeper.hh @@ -84,20 +84,23 @@ class DNSSECKeeper public: struct KeyMetaData { - time_t beginValidity, endValidity; // wart bool active; string fname; - }; + }; + typedef std::vector > zskset_t; + public: explicit DNSSECKeeper(const std::string& dirname) : d_dirname(dirname){} + bool haveKSKFor(const std::string& zone, DNSSECPrivateKey* ksk=0); - typedef std::vector > zskset_t; zskset_t getZSKsFor(const std::string& zone, bool all=false); void addZSKFor(const std::string& zname, int algorithm, bool next=false); + void deleteZSKFor(const std::string& zname, const std::string& fname); void secureZone(const std::string& fname, int algorithm); + bool getNSEC3PARAM(const std::string& zname, NSEC3PARAMRecordContent* n3p=0); void setNSEC3PARAM(const std::string& zname, const NSEC3PARAMRecordContent* n3p); diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index 5f82893e7..6732cadde 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -233,13 +233,13 @@ try cout<<"There were ZSKs already for zone '"<