summaryrefslogtreecommitdiff
path: root/onionshare
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2020-08-27 15:02:23 +1000
committerMiguel Jacq <mig@mig5.net>2020-08-27 15:02:23 +1000
commiteb0b37e677ff2b662472b43a7f181ba27a973333 (patch)
tree89fd79280d4a52e119a1fd0563c3f0c24cc5d226 /onionshare
parentddf1532eed9b9c9e0ab1219168a8dc88589a8abf (diff)
downloadonionshare-eb0b37e677ff2b662472b43a7f181ba27a973333.tar.gz
onionshare-eb0b37e677ff2b662472b43a7f181ba27a973333.zip
Explicitly try to start a v2 onion in order to evaluate the ability to support (legacy) stealth mode. Also set the auth_string attribute of the Onion object so we can pass it back to the clipboard in the UI
Diffstat (limited to 'onionshare')
-rw-r--r--onionshare/onion.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/onionshare/onion.py b/onionshare/onion.py
index 88d72496..4fca31d5 100644
--- a/onionshare/onion.py
+++ b/onionshare/onion.py
@@ -181,6 +181,9 @@ class Onion(object):
# Start out not connected to Tor
self.connected_to_tor = False
+ # Assigned later if we are using stealth mode
+ self.auth_string = None
+
def connect(
self,
custom_settings=None,
@@ -549,7 +552,8 @@ class Onion(object):
# Do the versions of stem and tor that I'm using support stealth onion services?
try:
res = self.c.create_ephemeral_hidden_service(
- {1: 1}, basic_auth={"onionshare": None}, await_publication=False
+ {1: 1}, basic_auth={"onionshare": None}, await_publication=False,
+ key_type="NEW",key_content="RSA1024"
)
tmp_service_id = res.service_id
self.c.remove_ephemeral_hidden_service(tmp_service_id)
@@ -655,8 +659,8 @@ class Onion(object):
"onion", "hidservauth_string"
):
auth_cookie = list(res.client_auth.values())[0]
- auth_string = f"HidServAuth {onion_host} {auth_cookie}"
- mode_settings.set("onion", "hidservauth_string", auth_string)
+ self.auth_string = f"HidServAuth {onion_host} {auth_cookie}"
+ mode_settings.set("onion", "hidservauth_string", self.auth_string)
return onion_host