From 97366ede73d1d65c0baeb8ed1e681d91629e5011 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Sun, 28 Jul 2019 13:16:34 +0300 Subject: [PATCH] Do not save hidden service parameters if onionhostname is set --- src/plugins/proxyconfig_stem.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/plugins/proxyconfig_stem.py b/src/plugins/proxyconfig_stem.py index 567d8253..75605c07 100644 --- a/src/plugins/proxyconfig_stem.py +++ b/src/plugins/proxyconfig_stem.py @@ -87,7 +87,7 @@ def connect_plugin(config): response = controller.create_ephemeral_hidden_service( config.safeGetInt('bitmessagesettings', 'onionport', 8444), key_type=(onionkeytype or 'NEW'), - key_content=(onionkey or 'BEST') + key_content=(onionkey or onionhostname and 'ED25519-V3' or 'BEST') ) if not response.is_ok(): @@ -95,17 +95,16 @@ def connect_plugin(config): return if not onionkey: + logwrite('Started hidden service %s.onion' % response.service_id) + # only save new service keys if onionhostname was not set previously if not onionhostname: onionhostname = response.service_id + '.onion' config.set( 'bitmessagesettings', 'onionhostname', onionhostname) - else: - onionhostname = response.service_id + '.onion' - logwrite('Started hidden service %s' % onionhostname) - config.add_section(onionhostname) - config.set( - onionhostname, 'privsigningkey', response.private_key) - config.set( - onionhostname, 'keytype', response.private_key_type) - config.save() + config.add_section(onionhostname) + config.set( + onionhostname, 'privsigningkey', response.private_key) + config.set( + onionhostname, 'keytype', response.private_key_type) + config.save() config.set('bitmessagesettings', 'socksproxytype', 'SOCKS5')