From: Pieter Lexis Date: Wed, 23 Sep 2020 11:39:06 +0000 (+0200) Subject: Add SVCB/HTTPS checks to pdnsutil X-Git-Tag: auth-4.4.0-alpha1~2^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95455b3887fb00ce8bdc81a775d17bb68935cf42;p=thirdparty%2Fpdns.git Add SVCB/HTTPS checks to pdnsutil --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index d824af6e81..3a6859428e 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -324,10 +324,11 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con bool hasNsAtApex = false; - set tlsas, cnames, noncnames, glue, checkglue; + set tlsas, cnames, noncnames, glue, checkglue, addresses, svcbAliases, httpsAliases, svcbRecords, httpsRecords; set > checkOcclusion; set recordcontents; map ttl; + set > svcbTargets, httpsTargets; ostringstream content; pair::iterator,bool> ret; @@ -346,6 +347,9 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con for(auto &rr : records) { // we modify this if(rr.qtype.getCode() == QType::TLSA) tlsas.insert(rr.qname); + if(rr.qtype.getCode() == QType::A || rr.qtype.getCode() == QType::AAAA) { + addresses.insert(rr.qname); + } if(rr.qtype.getCode() == QType::SOA) { vectorparts; stringtok(parts, rr.content); @@ -401,6 +405,39 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con continue; } + if (rr.qtype.getCode() == QType::SVCB || rr.qtype.getCode() == QType::HTTPS) { + vector parts; + stringtok(parts, rr.content); + if (std::atoi(parts.at(0).c_str()) == 0 && parts.size() > 2) { + cout<<"[Warning] Aliasform "<(svcb); + auto target = std::get<2>(svcb); + auto prio = std::get<1>(svcb); + + if (name == target) { + cout<<"[Error] SVCB record "<(httpsRecord); + auto target = std::get<2>(httpsRecord); + auto prio = std::get<1>(httpsRecord); + + if (name == target) { + cout<<"[Error] HTTPS record "<