summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/keymanager/refresher.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/keymanager/refresher.py')
-rw-r--r--src/leap/bitmask/keymanager/refresher.py17
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