Commit 38c8e9a9 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1176] Test it asks for DNSSEC data

While backends are allowed to pass DNSSEC data when not asked to, they
don't have to, so we need to ask for it. Test backend therefore doesn't
return the DNSSEC data when not asked to, to check it really asks.
parent ddf9da51
...@@ -215,8 +215,25 @@ MockZoneFinder::find(const Name& name, const RRType& type, ...@@ -215,8 +215,25 @@ MockZoneFinder::find(const Name& name, const RRType& type,
RRsetStore::const_iterator found_rrset = RRsetStore::const_iterator found_rrset =
found_domain->second.find(type); found_domain->second.find(type);
if (found_rrset != found_domain->second.end()) { if (found_rrset != found_domain->second.end()) {
// TODO: Drop whatever rrsig is there if options doesn't have the dnssec ConstRRsetPtr rrset;
return (FindResult(SUCCESS, found_rrset->second)); // Strip whatever signature there is in case DNSSEC is not required
// Just to make sure the Query asks for it when it is needed
if (options & ZoneFinder::FIND_DNSSEC ||
!found_rrset->second->getRRsig()) {
rrset = found_rrset->second;
} else {
RRsetPtr noconst(new RRset(found_rrset->second->getName(),
found_rrset->second->getClass(),
found_rrset->second->getType(),
found_rrset->second->getTTL()));
for (RdataIteratorPtr
i(found_rrset->second->getRdataIterator());
!i->isLast(); i->next()) {
noconst->addRdata(i->getCurrent());
}
rrset = noconst;
}
return (FindResult(SUCCESS, rrset));
} }
// If not found but we have a target, fill it with all RRsets here // If not found but we have a target, fill it with all RRsets here
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment