Show
Ignore:
Timestamp:
01/19/11 20:26:27 (2 years ago)
Author:
ahu
Message:

fix up us putting the RRSIG in the wrong place for DS records. Spotted by Marco Davids of SIDN.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/dnssecsigner.cc

    r1893 r1899  
    8383  vector<RRSIGRecordContent> rrcs; 
    8484  if(dk.isPresigned(signer)) { 
    85         dk.getPreRRSIGs(signer, signQName, QType(signQType), signPlace, outsigned); 
     85    dk.getPreRRSIGs(signer, signQName, QType(signQType), signPlace, outsigned); // does it all 
    8686  } 
    87   else if(getRRSIGsForRRSET(dk, signer, wildcardname.empty() ? signQName : wildcardname, signQType, signTTL, toSign, rrcs, signQType == QType::DNSKEY) < 0) { 
    88     // cerr<<"Error signing a record!"<<endl; 
    89     return; 
     87  else { 
     88    if(getRRSIGsForRRSET(dk, signer, wildcardname.empty() ? signQName : wildcardname, signQType, signTTL, toSign, rrcs, signQType == QType::DNSKEY) < 0)  { 
     89      // cerr<<"Error signing a record!"<<endl; 
     90      return; 
     91    }  
     92   
     93    DNSResourceRecord rr; 
     94    rr.qname=signQName; 
     95    rr.qtype=QType::RRSIG; 
     96    rr.ttl=signTTL; 
     97    rr.auth=false; 
     98    rr.d_place = (DNSResourceRecord::Place) signPlace; 
     99    BOOST_FOREACH(RRSIGRecordContent& rrc, rrcs) { 
     100      rr.content = rrc.getZoneRepresentation(); 
     101      outsigned.push_back(rr); 
     102    } 
    90103  } 
    91    
    92   DNSResourceRecord rr; 
    93   rr.qname=signQName; 
    94   rr.qtype=QType::RRSIG; 
    95   rr.ttl=signTTL; 
    96   rr.auth=false; 
    97    
    98   BOOST_FOREACH(RRSIGRecordContent& rrc, rrcs) { 
    99     rr.content = rrc.getZoneRepresentation(); 
    100     outsigned.push_back(rr); 
    101   } 
    102  
    103104  toSign.clear(); 
    104105} 
     
    176177    signPlace = (DNSPacketWriter::Place) pos->d_place; 
    177178    if(pos->auth || pos->qtype.getCode() == QType::DS) { 
    178       string content = pos ->content; 
     179      string content = pos->content; 
    179180      if(pos->qtype.getCode()==QType::MX || pos->qtype.getCode() == QType::SRV) {   
    180181        content = lexical_cast<string>(pos->priority) + " " + pos->content;