From 6fdef85878413ececdc14f85437a4eeefe9eb822 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Thu, 22 Dec 2016 17:07:01 -0800 Subject: [PATCH] Catch all exceptions when checking for stealth support, not just TypeError, to successfully identity old versions of stem --- onionshare/onion.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/onionshare/onion.py b/onionshare/onion.py index 3da2935d..40fc30ae 100644 --- a/onionshare/onion.py +++ b/onionshare/onion.py @@ -99,12 +99,16 @@ class Onion(object): self.supports_ephemeral = callable(list_ephemeral_hidden_services) and tor_version >= '0.2.7.1' # do the versions of stem and tor that I'm using support stealth onion services? + if self.stealth: + self.check_for_stealth_support() + + def check_for_stealth_support(self): try: res = self.c.create_ephemeral_hidden_service({1:1}, basic_auth={'onionshare':None}, await_publication=False) tmp_service_id = res.content()[0][2].split('=')[1] self.c.remove_ephemeral_hidden_service(tmp_service_id) self.supports_stealth = True - except TypeError: + except: # ephemeral stealth onion services are not supported self.supports_stealth = False