summaryrefslogtreecommitdiff
path: root/onionshare/onion.py
diff options
context:
space:
mode:
Diffstat (limited to 'onionshare/onion.py')
-rw-r--r--onionshare/onion.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/onionshare/onion.py b/onionshare/onion.py
index 6066f059..3d7b4514 100644
--- a/onionshare/onion.py
+++ b/onionshare/onion.py
@@ -146,6 +146,9 @@ class Onion(object):
# The tor process
self.tor_proc = None
+ # The Tor controller
+ self.c = None
+
# Start out not connected to Tor
self.connected_to_tor = False
@@ -387,6 +390,7 @@ class Onion(object):
# Get the tor version
self.tor_version = self.c.get_version().version_str
+ self.common.log('Onion', 'connect', 'Connected to tor {}'.format(self.tor_version))
# Do the versions of stem and tor that I'm using support ephemeral onion services?
list_ephemeral_hidden_services = getattr(self.c, "list_ephemeral_hidden_services", None)
@@ -403,7 +407,9 @@ class Onion(object):
self.supports_stealth = False
# Does this version of Tor support next-gen ('v3') onions?
- self.supports_next_gen_onions = self.tor_version > Version('0.3.3.1')
+ # Note, this is the version of Tor where this bug was fixed:
+ # https://trac.torproject.org/projects/tor/ticket/28619
+ self.supports_v3_onions = self.tor_version >= Version('0.4.0.0')
def is_authenticated(self):
"""
@@ -461,7 +467,7 @@ class Onion(object):
else:
key_type = "NEW"
# Work out if we can support v3 onion services, which are preferred
- if Version(self.tor_version) >= Version('0.3.3.1') and not self.settings.get('use_legacy_v2_onions'):
+ if self.supports_v3_onions and not self.settings.get('use_legacy_v2_onions'):
key_content = "ED25519-V3"
else:
# fall back to v2 onion services