aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-05 11:32:35 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-05 16:55:23 +0100
commit941a608d52ce74eaad2c4c7dc49a8571111081bb (patch)
treeaed9c436c8baa7f2e5692dd996611054ceca3b8f /src/common/util.cpp
parentsimplewallet: add optional trusted/untrusted argument to set_daemon (diff)
downloadmonero-941a608d52ce74eaad2c4c7dc49a8571111081bb.tar.xz
util: consider Tor/I2P addresses to be non local
Diffstat (limited to 'src/common/util.cpp')
-rw-r--r--src/common/util.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp
index 7e77e19b1..d17d24928 100644
--- a/src/common/util.cpp
+++ b/src/common/util.cpp
@@ -657,6 +657,13 @@ std::string get_nix_version_display_string()
bool is_local_address(const std::string &address)
{
+ // always assume Tor/I2P addresses to be untrusted by default
+ if (boost::ends_with(address, ".onion") || boost::ends_with(address, ".i2p"))
+ {
+ MDEBUG("Address '" << address << "' is Tor/I2P, non local");
+ return false;
+ }
+
// extract host
epee::net_utils::http::url_content u_c;
if (!epee::net_utils::parse_url(address, u_c))