mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Set dnssec_valid value correctly in dns_utils; fix address_from_url test
This commit is contained in:
parent
f43f0660aa
commit
3ade396406
2 changed files with 5 additions and 4 deletions
|
@ -232,7 +232,7 @@ std::vector<std::string> DNSResolver::get_ipv4(const std::string& url, bool& dns
|
||||||
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_A, DNS_CLASS_IN, &result))
|
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_A, DNS_CLASS_IN, &result))
|
||||||
{
|
{
|
||||||
dnssec_available = (result->secure || (!result->secure && result->bogus));
|
dnssec_available = (result->secure || (!result->secure && result->bogus));
|
||||||
dnssec_valid = !result->bogus;
|
dnssec_valid = result->secure && !result->bogus;
|
||||||
if (result->havedata)
|
if (result->havedata)
|
||||||
{
|
{
|
||||||
for (size_t i=0; result->data[i] != NULL; i++)
|
for (size_t i=0; result->data[i] != NULL; i++)
|
||||||
|
@ -263,7 +263,7 @@ std::vector<std::string> DNSResolver::get_ipv6(const std::string& url, bool& dns
|
||||||
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_AAAA, DNS_CLASS_IN, &result))
|
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_AAAA, DNS_CLASS_IN, &result))
|
||||||
{
|
{
|
||||||
dnssec_available = (result->secure || (!result->secure && result->bogus));
|
dnssec_available = (result->secure || (!result->secure && result->bogus));
|
||||||
dnssec_valid = !result->bogus;
|
dnssec_valid = result->secure && !result->bogus;
|
||||||
if (result->havedata)
|
if (result->havedata)
|
||||||
{
|
{
|
||||||
for (size_t i=0; result->data[i] != NULL; i++)
|
for (size_t i=0; result->data[i] != NULL; i++)
|
||||||
|
@ -294,7 +294,7 @@ std::vector<std::string> DNSResolver::get_txt_record(const std::string& url, boo
|
||||||
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_TXT, DNS_CLASS_IN, &result))
|
if (!ub_resolve(m_data->m_ub_context, urlC, DNS_TYPE_TXT, DNS_CLASS_IN, &result))
|
||||||
{
|
{
|
||||||
dnssec_available = (result->secure || (!result->secure && result->bogus));
|
dnssec_available = (result->secure || (!result->secure && result->bogus));
|
||||||
dnssec_valid = !result->bogus;
|
dnssec_valid = result->secure && !result->bogus;
|
||||||
if (result->havedata)
|
if (result->havedata)
|
||||||
{
|
{
|
||||||
for (size_t i=0; result->data[i] != NULL; i++)
|
for (size_t i=0; result->data[i] != NULL; i++)
|
||||||
|
|
|
@ -109,7 +109,8 @@ TEST(AddressFromURL, Failure)
|
||||||
|
|
||||||
std::vector<std::string> addresses = tools::wallet2::addresses_from_url("example.invalid", dnssec_result);
|
std::vector<std::string> addresses = tools::wallet2::addresses_from_url("example.invalid", dnssec_result);
|
||||||
|
|
||||||
ASSERT_FALSE(dnssec_result);
|
// for a non-existing domain such as "example.invalid", the non-existence is proved with NSEC records
|
||||||
|
ASSERT_TRUE(dnssec_result);
|
||||||
|
|
||||||
ASSERT_EQ(0, addresses.size());
|
ASSERT_EQ(0, addresses.size());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue