if (have.count("retryOnErrorPeriod")) {
conf.d_retryOnError = boost::get<uint32_t>(have.at("retryOnErrorPeriod"));
}
+ if (have.count("zonemdValidation")) {
+ string zonemdValidation = boost::get<string>(have.at("zonemdValidation"));
+ const map<string, pdns::ZoneMD::Config> nameToVal = {
+ { "ignore", pdns::ZoneMD::Config::Ignore},
+ { "process", pdns::ZoneMD::Config::Process},
+ { "logonly", pdns::ZoneMD::Config::LogOnly},
+ { "required", pdns::ZoneMD::Config::Required},
+ { "requiredWithDNSSEC", pdns::ZoneMD::Config::RequiredWithDNSSEC},
+ { "requiredIgnoreDNSSEC", pdns::ZoneMD::Config::RequiredIgnoreDNSSEC},
+ };
+ auto it = nameToVal.find(zonemdValidation);
+ if (it == nameToVal.end()) {
+ throw std::runtime_error(zonemdValidation + " is not a valid value for `zonemdValidation`");
+ } else {
+ conf.d_zonemd = it->second;
+ }
+ }
}
delayedThreads.ztcConfigs.push_back(conf);
result = processLines(lines, config);
}
- if (config.d_zonemd == pdns::ZoneMD::Config::Required && result != pdns::ZoneMD::Result::OK) {
+ if (pdns::ZoneMD::validationRequired(config.d_zonemd) && result != pdns::ZoneMD::Result::OK) {
// We do not accept NoValidationDone in this case
throw PDNSException("ZoneMD validation failure");
return;
void readRecord(const DNSRecord& record);
void verify(bool& validationDone, bool& validationOK);
+ static bool validationRequired(Config config)
+ {
+ return config == Config::Required || config == Config::RequiredWithDNSSEC || config == Config::RequiredIgnoreDNSSEC;
+ }
+
private:
typedef std::pair<DNSName, QType> RRSetKey_t;
typedef std::vector<std::shared_ptr<DNSRecordContent>> RRVector_t;