summaryrefslogtreecommitdiff
path: root/keymanager
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2016-01-21 18:48:23 +0100
committerRuben Pollan <meskio@sindominio.net>2016-02-25 11:35:25 -0600
commit940903fbc6e96e2fc9d745b49a482a698682fd4b (patch)
tree6b05d18223b9b98291757003b66ba45b25b736e6 /keymanager
parentcdf9496a87157476f792187859e54c3c2504772e (diff)
[feat] update usage only if needed
During encryption we where updating 'enc_used' in the key without checking if it was already set.
Diffstat (limited to 'keymanager')
-rw-r--r--keymanager/src/leap/keymanager/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/keymanager/src/leap/keymanager/__init__.py b/keymanager/src/leap/keymanager/__init__.py
index 99ee163..9e3b6ee 100644
--- a/keymanager/src/leap/keymanager/__init__.py
+++ b/keymanager/src/leap/keymanager/__init__.py
@@ -579,8 +579,9 @@ class KeyManager(object):
encrypted = yield _keys.encrypt(
data, pubkey, passphrase, sign=signkey,
cipher_algo=cipher_algo)
- pubkey.encr_used = True
- yield _keys.put_key(pubkey)
+ if not pubkey.encr_used:
+ pubkey.encr_used = True
+ yield _keys.put_key(pubkey)
defer.returnValue(encrypted)
dpub = self.get_key(address, ktype, private=False,