]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix up us putting the RRSIG in the wrong place for DS records. Spotted by Marco David...
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 19 Jan 2011 19:26:27 +0000 (19:26 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 19 Jan 2011 19:26:27 +0000 (19:26 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1899 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/dnssecsigner.cc

index 31295ffd8d9b4724d1aa5bec5972155f93705e54..3d0f0144a6b63c5e53e9ba17a619d09d73700620 100644 (file)
@@ -82,24 +82,25 @@ void addSignature(DNSSECKeeper& dk, const std::string& signer, const std::string
     return;
   vector<RRSIGRecordContent> rrcs;
   if(dk.isPresigned(signer)) {
-       dk.getPreRRSIGs(signer, signQName, QType(signQType), signPlace, outsigned);
+    dk.getPreRRSIGs(signer, signQName, QType(signQType), signPlace, outsigned); // does it all
   }
-  else if(getRRSIGsForRRSET(dk, signer, wildcardname.empty() ? signQName : wildcardname, signQType, signTTL, toSign, rrcs, signQType == QType::DNSKEY) < 0) {
-    // cerr<<"Error signing a record!"<<endl;
-    return;
-  }
-  
-  DNSResourceRecord rr;
-  rr.qname=signQName;
-  rr.qtype=QType::RRSIG;
-  rr.ttl=signTTL;
-  rr.auth=false;
+  else {
+    if(getRRSIGsForRRSET(dk, signer, wildcardname.empty() ? signQName : wildcardname, signQType, signTTL, toSign, rrcs, signQType == QType::DNSKEY) < 0)  {
+      // cerr<<"Error signing a record!"<<endl;
+      return;
+    } 
   
-  BOOST_FOREACH(RRSIGRecordContent& rrc, rrcs) {
-    rr.content = rrc.getZoneRepresentation();
-    outsigned.push_back(rr);
+    DNSResourceRecord rr;
+    rr.qname=signQName;
+    rr.qtype=QType::RRSIG;
+    rr.ttl=signTTL;
+    rr.auth=false;
+    rr.d_place = (DNSResourceRecord::Place) signPlace;
+    BOOST_FOREACH(RRSIGRecordContent& rrc, rrcs) {
+      rr.content = rrc.getZoneRepresentation();
+      outsigned.push_back(rr);
+    }
   }
-
   toSign.clear();
 }
 
@@ -175,7 +176,7 @@ void addRRSigs(DNSSECKeeper& dk, const std::string& signer, DNSPacket& p)
     signTTL = pos->ttl;
     signPlace = (DNSPacketWriter::Place) pos->d_place;
     if(pos->auth || pos->qtype.getCode() == QType::DS) {
-      string content = pos ->content;
+      string content = pos->content;
       if(pos->qtype.getCode()==QType::MX || pos->qtype.getCode() == QType::SRV) {  
         content = lexical_cast<string>(pos->priority) + " " + pos->content;
       }