BIND 10 trac2165_2, updated. f06012941410d267b59e83812168cb0254f808ef [2165] Strip RRSIGs in MockZoneFinder when DNSSEC find option is not specified
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Aug 20 22:24:12 UTC 2012
The branch, trac2165_2 has been updated
via f06012941410d267b59e83812168cb0254f808ef (commit)
from ef85853043e2d5f1fe3c2d494cd4af3b553d88fa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f06012941410d267b59e83812168cb0254f808ef
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue Aug 21 03:50:47 2012 +0530
[2165] Strip RRSIGs in MockZoneFinder when DNSSEC find option is not specified
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/tests/query_unittest.cc | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/tests/query_unittest.cc b/src/bin/auth/tests/query_unittest.cc
index 040dcf2..392b0c5 100644
--- a/src/bin/auth/tests/query_unittest.cc
+++ b/src/bin/auth/tests/query_unittest.cc
@@ -308,6 +308,27 @@ textToRRset(const string& text_rrset, const Name& origin = Name::ROOT_NAME()) {
return (rrset);
}
+ConstRRsetPtr
+prepareRRset(ConstRRsetPtr rr, const ZoneFinder::FindOptions options) {
+ ConstRRsetPtr sig_rrset = rr->getRRsig();
+ if (sig_rrset &&
+ ((options & ZoneFinder::FIND_DNSSEC) == 0)) {
+ RRsetPtr result_base(new RRset(rr->getName(),
+ rr->getClass(),
+ rr->getType(),
+ rr->getTTL()));
+ for (RdataIteratorPtr i(rr->getRdataIterator());
+ !i->isLast();
+ i->next()) {
+ result_base->addRdata(i->getCurrent());
+ }
+
+ return(result_base);
+ } else {
+ return(rr);
+ }
+}
+
// This is a mock Zone Finder class for testing.
// It is a derived class of ZoneFinder for the convenient of tests.
// Its find() method emulates the common behavior of protocol compliant
@@ -479,9 +500,10 @@ protected:
isc::dns::ConstRRsetPtr rrset,
FindResultFlags flags = RESULT_DEFAULT)
{
+ ConstRRsetPtr rr = (rrset ? prepareRRset(rrset, options) : rrset);
return (ZoneFinderContextPtr(
new Context(*this, options,
- ResultContext(code, rrset, flags))));
+ ResultContext(code, rr, flags))));
}
private:
@@ -594,7 +616,7 @@ MockZoneFinder::findAll(const Name& name, std::vector<ConstRRsetPtr>& target,
found_domain->second.begin();
found_rrset != found_domain->second.end(); ++found_rrset) {
// Insert RRs under the domain name into target
- target.push_back(found_rrset->second);
+ target.push_back(prepareRRset(found_rrset->second, options));
}
return (ZoneFinderContextPtr(
new Context(*this, options,
More information about the bind10-changes
mailing list