only set self.private_key after the Onion service has started, if we received a new one

This commit is contained in:
Miguel Jacq 2017-12-09 08:18:06 +11:00
parent 7edd693071
commit bec03bb10e
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6
2 changed files with 4 additions and 1 deletions

View File

@ -425,6 +425,8 @@ class Onion(object):
# A new private key was generated and is in the Control port response. # A new private key was generated and is in the Control port response.
if not self.settings.get('private_key'): if not self.settings.get('private_key'):
self.private_key = res.private_key self.private_key = res.private_key
else:
self.private_key = ''
if self.stealth: if self.stealth:
# Similar to the PrivateKey, the Control port only returns the ClientAuth # Similar to the PrivateKey, the Control port only returns the ClientAuth

View File

@ -78,7 +78,8 @@ class OnionShare(object):
self.onion_host = self.onion.start_onion_service(self.port) self.onion_host = self.onion.start_onion_service(self.port)
self.private_key = self.onion.private_key if self.onion.private_key:
self.private_key = self.onion.private_key
if self.stealth: if self.stealth:
self.auth_string = self.onion.auth_string self.auth_string = self.onion.auth_string