diff options
author | Ruben Pollan <meskio@sindominio.net> | 2017-10-24 11:50:30 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-10-26 18:37:04 +0200 |
commit | d16b25da0962156601615587a612b57b918b0dc6 (patch) | |
tree | a12a9b3bd7b9ed75c9515da8293ea115e132106a /src/leap/bitmask/keymanager/refresher.py | |
parent | beb9f0449ec680d5adfab09e5969819aba99b7ef (diff) |
[bug] make nicknym return key data
There was a mismatch on the return values of Nicknym class and the
expectations. As most of the code was expecting an OpenPGPKey, but it
was returning the json as it came from the nickserver. Now is just
returning the key data.
Diffstat (limited to 'src/leap/bitmask/keymanager/refresher.py')
-rw-r--r-- | src/leap/bitmask/keymanager/refresher.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/leap/bitmask/keymanager/refresher.py b/src/leap/bitmask/keymanager/refresher.py index d89a7508..9ccc81e1 100644 --- a/src/leap/bitmask/keymanager/refresher.py +++ b/src/leap/bitmask/keymanager/refresher.py @@ -106,17 +106,24 @@ class RandomRefreshPublicKey(object): if old_key is None: defer.returnValue(None) - old_updated_key = yield self._keymanger._nicknym.\ + updated_key_data = yield self._keymanger._nicknym.\ fetch_key_with_fingerprint(old_key.fingerprint) + updated_key, _ = self._openpgp.parse_key(updated_key_data, + old_key.address) - if old_updated_key.fingerprint != old_key.fingerprint: + if updated_key.fingerprint != old_key.fingerprint: self.log.error( ERROR_UNEQUAL_FINGERPRINTS % ( - old_key.fingerprint, old_updated_key.fingerprint)) + old_key.fingerprint, updated_key.fingerprint)) defer.returnValue(None) - yield self._maybe_unactivate_key(old_updated_key) - yield self._openpgp.put_key(old_updated_key) + updated_key.validation = old_key.validation + updated_key.last_audited_at = old_key.last_audited_at + updated_key.encr_used = old_key.encr_used + updated_key.sign_used = old_key.sign_used + + yield self._maybe_unactivate_key(updated_key) + yield self._openpgp.put_key(updated_key) # No new fetch by address needed, bc that will happen before sending an # email could be discussed since fetching before sending an email |