NSEC3PARAMRecordContent ns3pr;
bool narrow;
- dk.getNSEC3PARAM(zone, &ns3pr, &narrow);
+ bool haveNSEC3=dk.getNSEC3PARAM(zone, &ns3pr, &narrow);
string hashed;
- if(ns3pr.d_salt.empty())
+ if(!haveNSEC3)
cerr<<"Adding NSEC ordering information"<<endl;
else if(!narrow)
cerr<<"Adding NSEC3 hashed ordering information for '"<<zone<<"'"<<endl;
}
}while(chopOff(shorter));
- if(ns3pr.d_salt.empty()) // NSEC
+ if(!haveNSEC3) // NSEC
sd.db->updateDNSSECOrderAndAuth(sd.domain_id, zone, qname, auth);
else {
if(!narrow) {
{
NSEC3PARAMRecordContent ns3pr;
bool narrow;
- dk.getNSEC3PARAM(zone, &ns3pr, &narrow);
+ bool haveNSEC3=dk.getNSEC3PARAM(zone, &ns3pr, &narrow);
- if(ns3pr.d_salt.empty())
+ if(!haveNSEC3)
cout<<"Zone has NSEC semantics"<<endl;
else
cout<<"Zone has " << (narrow ? "NARROW " : "") <<"hashed NSEC3 semantics, configuration: "<<ns3pr.getZoneRepresentation()<<endl;
void HEXDecode(const char* begin, const char* end, string& val)
{
+ if(end - begin == 1 && *begin=='-') {
+ val.clear();
+ return;
+ }
+
if((end - begin)%2)
throw RecordTextException("Hexadecimal blob with odd number of characters");
if(!d_string.empty())
d_string.append(1,' ');
+ if(val.empty()) {
+ d_string.append(1,'-');
+ return;
+ }
+
string::size_type limit=val.size();
char tmp[5];
for(string::size_type n = 0; n < limit; ++n) {
bool narrow;
DNSSECKeeper dk;
bool dnssecZone = false;
+ bool haveNSEC3=false;
if(dk.haveActiveKSKFor(domain)) {
dnssecZone=true;
- dk.getNSEC3PARAM(domain, &ns3pr, &narrow);
+ haveNSEC3=dk.getNSEC3PARAM(domain, &ns3pr, &narrow);
string hashed;
- if(ns3pr.d_salt.empty())
+ if(!haveNSEC3)
cerr<<"Adding NSEC ordering information"<<endl;
else if(!narrow)
cerr<<"Adding NSEC3 hashed ordering information for '"<<domain<<"'"<<endl;
}
}while(chopOff(shorter));
- if(ns3pr.d_salt.empty()) // NSEC
+ if(!haveNSEC3) // NSEC
di.backend->updateDNSSECOrderAndAuth(domain_id, domain, qname, auth);
else {
if(!narrow) {