"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test-syncres_cc5.cc" between
pdns-recursor-4.5.1.tar.bz2 and pdns-recursor-4.5.2.tar.bz2

About: PowerDNS - a separate release of the PowerDNS Recursor (without the authoritative nameserver).

test-syncres_cc5.cc  (pdns-recursor-4.5.1.tar.bz2):test-syncres_cc5.cc  (pdns-recursor-4.5.2.tar.bz2)
skipping to change at line 1828 skipping to change at line 1828
}); });
vector<DNSRecord> ret; vector<DNSRecord> ret;
int res = sr->beginResolve(target, QType(QType::A), QClass::IN, ret); int res = sr->beginResolve(target, QType(QType::A), QClass::IN, ret);
BOOST_CHECK_EQUAL(res, RCode::NoError); BOOST_CHECK_EQUAL(res, RCode::NoError);
BOOST_CHECK_EQUAL(sr->getValidationState(), vState::Secure); BOOST_CHECK_EQUAL(sr->getValidationState(), vState::Secure);
/* A + RRSIG, NSEC + RRSIG */ /* A + RRSIG, NSEC + RRSIG */
BOOST_REQUIRE_EQUAL(ret.size(), 4U); BOOST_REQUIRE_EQUAL(ret.size(), 4U);
} }
BOOST_AUTO_TEST_CASE(test_dnssec_validation_wildcard_expanded_onto_itself_nodata
)
{
std::unique_ptr<SyncRes> sr;
initSR(sr, true);
setDNSSECValidation(sr, DNSSECMode::ValidateAll);
primeHints();
const DNSName target("*.powerdns.com.");
testkeysset_t keys;
auto luaconfsCopy = g_luaconfs.getCopy();
luaconfsCopy.dsAnchors.clear();
generateKeyMaterial(g_rootdnsname, DNSSECKeeper::ECDSA256, DNSSECKeeper::DIGES
T_SHA256, keys, luaconfsCopy.dsAnchors);
generateKeyMaterial(DNSName("com."), DNSSECKeeper::ECDSA256, DNSSECKeeper::DIG
EST_SHA256, keys, luaconfsCopy.dsAnchors);
generateKeyMaterial(DNSName("powerdns.com."), DNSSECKeeper::ECDSA256, DNSSECKe
eper::DIGEST_SHA256, keys, luaconfsCopy.dsAnchors);
g_luaconfs.setState(luaconfsCopy);
sr->setAsyncCallback([target, keys](const ComboAddress& ip, const DNSName& dom
ain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now
, boost::optional<Netmask>& srcmask, boost::optional<const ResolveContext&> cont
ext, LWResult* res, bool* chained) {
if (type == QType::DS || type == QType::DNSKEY) {
if (domain == target) {
const auto auth = DNSName("powerdns.com.");
/* we don't want a cut there */
setLWResult(res, 0, true, false, true);
addRecordToLW(res, auth, QType::SOA, "foo. bar. 2017032800 1800 900 6048
00 86400", DNSResourceRecord::AUTHORITY, 86400);
addRRSIG(keys, res->d_records, auth, 300);
/* add a NSEC denying the DS */
std::set<uint16_t> types = {QType::NSEC};
addNSECRecordToLW(domain, DNSName("z") + domain, types, 600, res->d_reco
rds);
addRRSIG(keys, res->d_records, auth, 300);
return LWResult::Result::Success;
}
return genericDSAndDNSKEYHandler(res, domain, domain, type, keys);
}
else {
setLWResult(res, 0, true, false, true);
addRecordToLW(res, domain, QType::SOA, "powerdns.com. bar. 2017032800 1800
900 604800 86400", DNSResourceRecord::AUTHORITY, 86400);
addRRSIG(keys, res->d_records, DNSName("powerdns.com."), 300);
/* add the proof that the exact name does exist but that this type does no
t */
addNSECRecordToLW(DNSName("*.powerdns.com."), DNSName("\\000.*.powerdns.co
m."), {QType::AAAA, QType::NSEC, QType::RRSIG}, 600, res->d_records);
addRRSIG(keys, res->d_records, DNSName("powerdns.com"), 300, false, boost:
:none, DNSName("*.powerdns.com"));
return LWResult::Result::Success;
}
});
vector<DNSRecord> ret;
int res = sr->beginResolve(target, QType(QType::A), QClass::IN, ret);
BOOST_CHECK_EQUAL(res, RCode::NoError);
BOOST_CHECK_EQUAL(sr->getValidationState(), vState::Secure);
/* SOA + RRSIG, NSEC + RRSIG */
BOOST_REQUIRE_EQUAL(ret.size(), 4U);
}
BOOST_AUTO_TEST_CASE(test_dnssec_validation_wildcard_like_expanded_from_wildcard ) BOOST_AUTO_TEST_CASE(test_dnssec_validation_wildcard_like_expanded_from_wildcard )
{ {
std::unique_ptr<SyncRes> sr; std::unique_ptr<SyncRes> sr;
initSR(sr, true); initSR(sr, true);
setDNSSECValidation(sr, DNSSECMode::ValidateAll); setDNSSECValidation(sr, DNSSECMode::ValidateAll);
primeHints(); primeHints();
const DNSName target("*.sub.powerdns.com."); const DNSName target("*.sub.powerdns.com.");
testkeysset_t keys; testkeysset_t keys;
 End of changes. 1 change blocks. 
0 lines changed or deleted 67 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)