summaryrefslogtreecommitdiff
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
commit18d8fc8ab26885e24eaa05cc7843937b2381e4a8 (patch)
treeb6cbf80e97ad1b9a7bb62ff7ca2a07ef2362293b
parent7bd310c0b67c337f4a13ffac631a2068c57e9740 (diff)
Fix key generation
-rw-r--r--src/leap/keymanager/openpgp.py8
-rw-r--r--src/leap/keymanager/tests/test_openpgp.py3
2 files changed, 5 insertions, 6 deletions
diff --git a/src/leap/keymanager/openpgp.py b/src/leap/keymanager/openpgp.py
index f81fb0a0..c95b3817 100644
--- a/src/leap/keymanager/openpgp.py
+++ b/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/src/leap/keymanager/tests/test_openpgp.py b/src/leap/keymanager/tests/test_openpgp.py
index 01cf3417..e6f56e26 100644
--- a/src/leap/keymanager/tests/test_openpgp.py
+++ b/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(