summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/tests/test_keymanager.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-11-15 10:04:50 -0300
committerTomás Touceda <chiiph@leap.se>2013-11-15 10:04:50 -0300
commitae80ea1f0a748c2746026bd1a17815d786722b84 (patch)
treecb1809f49f532422e54cf8b30e829f87c88847a5 /src/leap/keymanager/tests/test_keymanager.py
parenta22efb595cee79fbcab830d8024a173a6a68d6aa (diff)
parentb4b46883df55ffeccfdda975f0b61b32436d8ee8 (diff)
Merge branch 'release-0.3.6'0.3.6
Diffstat (limited to 'src/leap/keymanager/tests/test_keymanager.py')
-rw-r--r--src/leap/keymanager/tests/test_keymanager.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/leap/keymanager/tests/test_keymanager.py b/src/leap/keymanager/tests/test_keymanager.py
index 2512604..67676e9 100644
--- a/src/leap/keymanager/tests/test_keymanager.py
+++ b/src/leap/keymanager/tests/test_keymanager.py
@@ -294,7 +294,7 @@ class OpenPGPCryptoTestCase(KeyManagerWithSoledadTestCase):
pgp.put_ascii_key(PRIVATE_KEY)
data = 'data'
privkey = pgp.get_key(ADDRESS, private=True)
- signed = pgp.sign(data, privkey)
+ signed = pgp.sign(data, privkey, detach=False)
pubkey = pgp.get_key(ADDRESS, private=False)
self.assertTrue(pgp.verify(signed, pubkey))
@@ -314,6 +314,16 @@ class OpenPGPCryptoTestCase(KeyManagerWithSoledadTestCase):
encrypted_and_signed, privkey2, verify=pubkey)
self.assertTrue(data, res)
+ def test_sign_verify_detached_sig(self):
+ pgp = openpgp.OpenPGPScheme(
+ self._soledad, gpgbinary=GPG_BINARY_PATH)
+ pgp.put_ascii_key(PRIVATE_KEY)
+ data = 'data'
+ privkey = pgp.get_key(ADDRESS, private=True)
+ signature = pgp.sign(data, privkey, detach=True)
+ pubkey = pgp.get_key(ADDRESS, private=False)
+ self.assertTrue(pgp.verify(data, pubkey, detached_sig=signature))
+
class KeyManagerKeyManagementTestCase(KeyManagerWithSoledadTestCase):
@@ -490,7 +500,7 @@ class KeyManagerCryptoTestCase(KeyManagerWithSoledadTestCase):
privkey = km.get_key(
ADDRESS, OpenPGPKey, private=True, fetch_remote=False)
# encrypt
- signdata = km.sign(self.RAW_DATA, privkey)
+ signdata = km.sign(self.RAW_DATA, privkey, detach=False)
self.assertNotEqual(self.RAW_DATA, signdata)
# get public key for verifying
pubkey = km.get_key(