mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-26 11:13:00 -03:00
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
This commit is contained in:
parent
ddf1532eed
commit
eb0b37e677
1 changed files with 7 additions and 3 deletions
|
@ -181,6 +181,9 @@ class Onion(object):
|
||||||
# Start out not connected to Tor
|
# Start out not connected to Tor
|
||||||
self.connected_to_tor = False
|
self.connected_to_tor = False
|
||||||
|
|
||||||
|
# Assigned later if we are using stealth mode
|
||||||
|
self.auth_string = None
|
||||||
|
|
||||||
def connect(
|
def connect(
|
||||||
self,
|
self,
|
||||||
custom_settings=None,
|
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?
|
# Do the versions of stem and tor that I'm using support stealth onion services?
|
||||||
try:
|
try:
|
||||||
res = self.c.create_ephemeral_hidden_service(
|
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
|
tmp_service_id = res.service_id
|
||||||
self.c.remove_ephemeral_hidden_service(tmp_service_id)
|
self.c.remove_ephemeral_hidden_service(tmp_service_id)
|
||||||
|
@ -655,8 +659,8 @@ class Onion(object):
|
||||||
"onion", "hidservauth_string"
|
"onion", "hidservauth_string"
|
||||||
):
|
):
|
||||||
auth_cookie = list(res.client_auth.values())[0]
|
auth_cookie = list(res.client_auth.values())[0]
|
||||||
auth_string = f"HidServAuth {onion_host} {auth_cookie}"
|
self.auth_string = f"HidServAuth {onion_host} {auth_cookie}"
|
||||||
mode_settings.set("onion", "hidservauth_string", auth_string)
|
mode_settings.set("onion", "hidservauth_string", self.auth_string)
|
||||||
|
|
||||||
return onion_host
|
return onion_host
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue