summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/keymanager/__init__.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-11-30 10:20:08 +0100
committerKali Kaneko (leap communications) <kali@leap.se>2016-11-30 10:34:20 +0100
commit7e7e54c5ef5a53e66e4bd0578b24bb1fc62db797 (patch)
tree3bed438067025f6c7bb79713598b3ad959c45456 /src/leap/bitmask/keymanager/__init__.py
parent2d700b6785d583782bbb3d76690866b64b969f52 (diff)
[bug] make srp token changes propagate to nicknym object
the token is set when we get the srp token in the keymanager service, but it wasn't been propagated properly to the internal nicknym object that was refactored recently. here I make the setter write the same token to both keymanager itself and the nicknym. some little additional refactors: - move gpg initialization to a helper method in this way it becomes easier to stub the soledad and keymanager components, for testing. - name nicknym token as publicly visible, since i'm accessing it from the keymanager object. - Resolves: #8651
Diffstat (limited to 'src/leap/bitmask/keymanager/__init__.py')
-rw-r--r--src/leap/bitmask/keymanager/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/leap/bitmask/keymanager/__init__.py b/src/leap/bitmask/keymanager/__init__.py
index ed3726ad..f0f82676 100644
--- a/src/leap/bitmask/keymanager/__init__.py
+++ b/src/leap/bitmask/keymanager/__init__.py
@@ -90,7 +90,6 @@ class KeyManager(object):
self.api_uri = api_uri
self.api_version = api_version
self.uid = uid
- self._openpgp = OpenPGPScheme(soledad, gpgbinary=gpgbinary)
create = self._create_combined_bundle_file
try:
self._combined_ca_bundle = combined_ca_bundle or create()
@@ -102,11 +101,15 @@ class KeyManager(object):
self._nicknym = Nicknym(self._nickserver_uri,
self._ca_cert_path, self._token)
self.refresher = None
+ self._init_gpg(soledad, gpgbinary)
#
# utilities
#
+ def _init_gpg(self, soledad, gpgbinary):
+ self._openpgp = OpenPGPScheme(soledad, gpgbinary=gpgbinary)
+
def start_refresher(self):
self.refresher = RandomRefreshPublicKey(self._openpgp, self)
self.refresher.start()
@@ -376,6 +379,7 @@ class KeyManager(object):
def _set_token(self, token):
self._token = token
+ self._nicknym.token = token
token = property(
_get_token, _set_token, doc='The session token.')