diff options
author | Zara Gebru <zgebru@thoughtworks.com> | 2016-06-16 14:41:54 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2017-01-26 14:55:11 +0100 |
commit | 847bc7ddd051c4656d86a6eda1b4e6cbdb5b1c5e (patch) | |
tree | fd61837900c65efd44021b7d1fff59c8085a8bff /tests/integration/keymanager/test_openpgp.py | |
parent | 9932121dd3da2611f14a59b27c40042dadff80a3 (diff) |
Check validity of key signature
Check if a new fetched key was signed by a old key with the same address.
Please do not merge before: https://github.com/isislovecruft/python-gnupg/pull/150
- Resolves #8112
Diffstat (limited to 'tests/integration/keymanager/test_openpgp.py')
-rw-r--r-- | tests/integration/keymanager/test_openpgp.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/integration/keymanager/test_openpgp.py b/tests/integration/keymanager/test_openpgp.py index b16e52fd..d04f5d01 100644 --- a/tests/integration/keymanager/test_openpgp.py +++ b/tests/integration/keymanager/test_openpgp.py @@ -37,6 +37,9 @@ from common import ( PUBLIC_KEY_2, PRIVATE_KEY, PRIVATE_KEY_2, + NEW_PUB_KEY, + OLD_AND_NEW_KEY_ADDRESS, + OLD_PUB_KEY ) @@ -339,6 +342,15 @@ class OpenPGPCryptoTestCase(KeyManagerWithSoledadTestCase): d = pgp.get_key(address, private=private) return self.assertFailure(d, KeyNotFound) + def test_key_is_signed_by(self): + pgp = openpgp.OpenPGPScheme( + self._soledad, gpgbinary=self.gpg_binary_path) + old_pubkey, old_privkey = pgp.parse_key( + OLD_PUB_KEY, OLD_AND_NEW_KEY_ADDRESS) + new_pubkey, new_privkey = pgp.parse_key( + NEW_PUB_KEY, OLD_AND_NEW_KEY_ADDRESS) + self.assertTrue(new_pubkey.is_signed_by(old_pubkey)) + @inlineCallbacks def _insert_key_docs(self, refreshed_at): for date in refreshed_at: |