From: bert hubert Date: Sat, 28 Nov 2015 10:05:07 +0000 (+0100) Subject: hook up ECDSA in git pdns_recursor build, not yet in separate tarball. Fix up CNAME... X-Git-Tag: dnsdist-1.0.0-alpha1~179 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2fec75a57b31466ba3ad1d0af934bfdda82fe22;p=pdns hook up ECDSA in git pdns_recursor build, not yet in separate tarball. Fix up CNAME chains and resolving insecure domains with do=1 --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 14880cfd4..315e84a42 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -1158,6 +1158,12 @@ pdns_recursor_SOURCES += pkcs11signers.cc pkcs11signers.hh pdns_recursor_LDADD += $(P11KIT1_LIBS) endif +if BOTAN110 +pdns_recursor_SOURCES += botan110signers.cc botansigners.cc +pdns_recursor_LDADD += $(BOTAN110_LIBS) +endif + + pdns_recursor_LDFLAGS = $(AM_LDFLAGS) if MALLOC_TRACE diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index dc0ba748f..8346d5669 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -801,9 +801,14 @@ void startDoResolve(void *p) pw.getHeader()->rcode=res; if(edo.d_Z & EDNSOpts::DNSSECOK) { - if(validateRecords(ret)) + auto state=validateRecords(ret); + if(state == Secure) { pw.getHeader()->ad=1; - else { + } + else if(state == Insecure) { + pw.getHeader()->ad=0; + } + else if(state == Bogus && !pw.getHeader()->cd) { pw.getHeader()->rcode=RCode::ServFail; goto sendit; } diff --git a/pdns/validate-recursor.cc b/pdns/validate-recursor.cc index 89fd1de85..df1b549d6 100644 --- a/pdns/validate-recursor.cc +++ b/pdns/validate-recursor.cc @@ -12,9 +12,8 @@ public: SyncRes sr(tv); vector ret; - int res; sr.d_doDNSSEC=true; - res=sr.beginResolve(qname, QType(qtype), 1, ret); + sr.beginResolve(qname, QType(qtype), 1, ret); d_queries += sr.d_outqueries; return ret; } @@ -22,14 +21,14 @@ public: }; -bool validateRecords(const vector& recs) +vState validateRecords(const vector& recs) { g_rootDS = "19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5"; cspmap_t cspmap=harvestCSPFromRecs(recs); // cerr<<"Got "<& recs) if(numsigs) { for(const auto& csp : cspmap) { for(const auto& sig : csp.second.signatures) { - // cerr<<"got rrsig "<d_signer<<"/"<d_tag<d_signer, keys); // cerr<<"! state = "<& recs) // cerr<<"no sigs, hoping for Insecure"<d_name, keys); // um WHAT DOES THIS MEAN - try first qname?? // cerr<<"! state = "<& recs) } } // cerr<<"Took "<& recs); +vState validateRecords(const vector& recs);