summaryrefslogtreecommitdiff
path: root/keymanager
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2014-12-05 12:28:37 -0600
committerRuben Pollan <meskio@sindominio.net>2014-12-16 11:55:16 -0600
commit12684222d47a670b4e7790fa63348c5d2d966b6a (patch)
tree06a06d2dbffd6bf0c1383590fd53d18f01d0465d /keymanager
parent7094981e43794558fe3542c3d381dfe43c4fa56b (diff)
Fix key generation
Diffstat (limited to 'keymanager')
-rw-r--r--keymanager/src/leap/keymanager/openpgp.py8
-rw-r--r--keymanager/src/leap/keymanager/tests/test_openpgp.py3
2 files changed, 5 insertions, 6 deletions
diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py
index f81fb0a..c95b381 100644
--- a/keymanager/src/leap/keymanager/openpgp.py
+++ b/keymanager/src/leap/keymanager/openpgp.py
@@ -282,11 +282,6 @@ class OpenPGPScheme(EncryptionScheme):
pubkeys = gpg.list_keys()
# assert for new key characteristics
-
- # XXX This exception is not properly catched by the soledad
- # bootstrapping, so if we do not finish generating the keys
- # we end with a blocked thread -- kali
-
leap_assert(
len(pubkeys) is 1, # a unitary keyring!
'Keyring has wrong number of keys: %d.' % len(pubkeys))
@@ -298,8 +293,9 @@ class OpenPGPScheme(EncryptionScheme):
for uid in key['uids']:
if re.match('.*<%s>$' % address, uid) is not None:
uid_match = True
- return
+ break
leap_assert(uid_match, 'Key not correctly bound to address.')
+
# insert both public and private keys in storage
deferreds = []
for secret in [True, False]:
diff --git a/keymanager/src/leap/keymanager/tests/test_openpgp.py b/keymanager/src/leap/keymanager/tests/test_openpgp.py
index 01cf341..e6f56e2 100644
--- a/keymanager/src/leap/keymanager/tests/test_openpgp.py
+++ b/keymanager/src/leap/keymanager/tests/test_openpgp.py
@@ -43,6 +43,9 @@ from leap.keymanager.tests import (
class OpenPGPCryptoTestCase(KeyManagerWithSoledadTestCase):
+ # set the trial timeout to 20min, needed by the key generation test
+ timeout = 1200
+
@inlineCallbacks
def _test_openpgp_gen_key(self):
pgp = openpgp.OpenPGPScheme(