From 0e1449135d9de9fd05c393c4c85364a7241d98c1 Mon Sep 17 00:00:00 2001 From: Thomas Winget Date: Thu, 25 Sep 2014 00:14:22 -0400 Subject: updated DNSResolver/things that use it for DNSSEC Note: DNSResolver does not yet *use* DNSSEC, but rather this commit is preparation for including DNSSEC validation. The function in src/wallet/wallet2.cpp that uses DNSResolver still needs its parameters updated accordingly. --- src/common/dns_utils.cpp | 12 +++++++++--- src/common/dns_utils.h | 8 +++++--- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src/common') diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp index 346761e74..0376ab9a9 100644 --- a/src/common/dns_utils.cpp +++ b/src/common/dns_utils.cpp @@ -118,9 +118,11 @@ DNSResolver::~DNSResolver() } } -std::vector DNSResolver::get_ipv4(const std::string& url) +std::vector DNSResolver::get_ipv4(const std::string& url, bool& dnssec_available, bool& dnssec_valid) { std::vector addresses; + dnssec_available = false; + dnssec_valid = false; char urlC[1000]; // waaaay too big, but just in case... strncpy(urlC, url.c_str(), 999); @@ -148,9 +150,11 @@ std::vector DNSResolver::get_ipv4(const std::string& url) return addresses; } -std::vector DNSResolver::get_ipv6(const std::string& url) +std::vector DNSResolver::get_ipv6(const std::string& url, bool& dnssec_available, bool& dnssec_valid) { std::vector addresses; + dnssec_available = false; + dnssec_valid = false; char urlC[1000]; // waaaay too big, but just in case... strncpy(urlC, url.c_str(), 999); @@ -178,9 +182,11 @@ std::vector DNSResolver::get_ipv6(const std::string& url) return addresses; } -std::vector DNSResolver::get_txt_record(const std::string& url) +std::vector DNSResolver::get_txt_record(const std::string& url, bool& dnssec_available, bool& dnssec_valid) { std::vector records; + dnssec_available = false; + dnssec_valid = false; char urlC[1000]; // waaaay too big, but just in case... strncpy(urlC, url.c_str(), 999); diff --git a/src/common/dns_utils.h b/src/common/dns_utils.h index dd6946dc4..9958e4ca2 100644 --- a/src/common/dns_utils.h +++ b/src/common/dns_utils.h @@ -71,9 +71,11 @@ public: * * @param url A string containing a URL to query for * + * @param dnssec_available + * * @return vector of strings containing ipv4 addresses */ - std::vector get_ipv4(const std::string& url); + std::vector get_ipv4(const std::string& url, bool& dnssec_available, bool& dnssec_valid); /** * @brief gets ipv6 addresses from DNS query @@ -85,7 +87,7 @@ public: * * @return vector of strings containing ipv6 addresses */ - std::vector get_ipv6(const std::string& url); + std::vector get_ipv6(const std::string& url, bool& dnssec_available, bool& dnssec_valid); /** * @brief gets all TXT records from a DNS query for the supplied URL; @@ -96,7 +98,7 @@ public: * @return A vector of strings containing a TXT record; or an empty vector */ // TODO: modify this to accomodate DNSSEC - std::vector get_txt_record(const std::string& url); + std::vector get_txt_record(const std::string& url, bool& dnssec_available, bool& dnssec_valid); /** * @brief Gets the singleton instance of DNSResolver -- cgit v1.2.3