diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python-pygpgme')
4 files changed, 0 insertions, 175 deletions
diff --git a/meta-python/recipes-devtools/python/python-pygpgme/0001-reflect-2.1-reporting-for-key-imports.patch b/meta-python/recipes-devtools/python/python-pygpgme/0001-reflect-2.1-reporting-for-key-imports.patch deleted file mode 100644 index 1f31cb805e..0000000000 --- a/meta-python/recipes-devtools/python/python-pygpgme/0001-reflect-2.1-reporting-for-key-imports.patch +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | From ed44474c11f577c1644910964a917a4cf701bb0f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> | ||
| 3 | Date: Tue, 26 Jan 2016 14:24:26 -0500 | ||
| 4 | Subject: [PATCH] reflect 2.1 reporting for key imports | ||
| 5 | |||
| 6 | GnuPG 2.1 changes how it reports key imports. These changes should | ||
| 7 | make the pygpgme test suite compatible with GnuPG 2.1. | ||
| 8 | |||
| 9 | See also: | ||
| 10 | https://lists.gnupg.org/pipermail/gnupg-devel/2016-January/030718.html | ||
| 11 | |||
| 12 | Upstream-Status: Backport | ||
| 13 | |||
| 14 | Signed-off-by: Catalin Enache <catalin.enache@windriver.com> | ||
| 15 | |||
| 16 | --- | ||
| 17 | tests/test_import.py | 22 +++++++++++----------- | ||
| 18 | 1 file changed, 11 insertions(+), 11 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/tests/test_import.py b/tests/test_import.py | ||
| 21 | index 10eb816..597eb47 100644 | ||
| 22 | --- a/tests/test_import.py | ||
| 23 | +++ b/tests/test_import.py | ||
| 24 | @@ -55,7 +55,7 @@ class ImportTestCase(GpgHomeTestCase): | ||
| 25 | ctx = gpgme.Context() | ||
| 26 | with self.keyfile('key1.sec') as fp: | ||
| 27 | result = ctx.import_(fp) | ||
| 28 | - self.assertEqual(result.considered, 1) | ||
| 29 | + self.assertEqual(result.considered, 3) | ||
| 30 | self.assertEqual(result.no_user_id, 0) | ||
| 31 | self.assertEqual(result.imported, 1) | ||
| 32 | self.assertEqual(result.imported_rsa, 0) | ||
| 33 | @@ -64,18 +64,18 @@ class ImportTestCase(GpgHomeTestCase): | ||
| 34 | self.assertEqual(result.new_sub_keys, 0) | ||
| 35 | self.assertEqual(result.new_signatures, 0) | ||
| 36 | self.assertEqual(result.new_revocations, 0) | ||
| 37 | - self.assertEqual(result.secret_read, 1) | ||
| 38 | - self.assertEqual(result.secret_imported, 1) | ||
| 39 | + self.assertEqual(result.secret_read, 3) | ||
| 40 | + self.assertEqual(result.secret_imported, 2) | ||
| 41 | self.assertEqual(result.secret_unchanged, 0) | ||
| 42 | self.assertEqual(result.skipped_new_keys, 0) | ||
| 43 | self.assertEqual(result.not_imported, 0) | ||
| 44 | self.assertEqual(len(result.imports), 2) | ||
| 45 | self.assertEqual(result.imports[0], | ||
| 46 | ('E79A842DA34A1CA383F64A1546BB55F0885C65A4', | ||
| 47 | - None, gpgme.IMPORT_NEW | gpgme.IMPORT_SECRET)) | ||
| 48 | + None, gpgme.IMPORT_NEW)) | ||
| 49 | self.assertEqual(result.imports[1], | ||
| 50 | ('E79A842DA34A1CA383F64A1546BB55F0885C65A4', | ||
| 51 | - None, gpgme.IMPORT_NEW)) | ||
| 52 | + None, gpgme.IMPORT_NEW | gpgme.IMPORT_SECRET)) | ||
| 53 | # can we get the public key? | ||
| 54 | key = ctx.get_key('E79A842DA34A1CA383F64A1546BB55F0885C65A4') | ||
| 55 | # can we get the secret key? | ||
| 56 | @@ -102,17 +102,17 @@ class ImportTestCase(GpgHomeTestCase): | ||
| 57 | fp = BytesIO(b'\n'.join(keys)) | ||
| 58 | ctx = gpgme.Context() | ||
| 59 | result = ctx.import_(fp) | ||
| 60 | - self.assertEqual(result.considered, 3) | ||
| 61 | + self.assertEqual(result.considered, 5) | ||
| 62 | self.assertEqual(result.no_user_id, 0) | ||
| 63 | self.assertEqual(result.imported, 2) | ||
| 64 | - self.assertEqual(result.imported_rsa, 1) | ||
| 65 | + self.assertEqual(result.imported_rsa, 0) | ||
| 66 | self.assertEqual(result.unchanged, 0) | ||
| 67 | self.assertEqual(result.new_user_ids, 0) | ||
| 68 | self.assertEqual(result.new_sub_keys, 0) | ||
| 69 | self.assertEqual(result.new_signatures, 1) | ||
| 70 | self.assertEqual(result.new_revocations, 0) | ||
| 71 | - self.assertEqual(result.secret_read, 1) | ||
| 72 | - self.assertEqual(result.secret_imported, 1) | ||
| 73 | + self.assertEqual(result.secret_read, 3) | ||
| 74 | + self.assertEqual(result.secret_imported, 2) | ||
| 75 | self.assertEqual(result.secret_unchanged, 0) | ||
| 76 | self.assertEqual(result.skipped_new_keys, 0) | ||
| 77 | self.assertEqual(result.not_imported, 0) | ||
| 78 | @@ -122,10 +122,10 @@ class ImportTestCase(GpgHomeTestCase): | ||
| 79 | None, gpgme.IMPORT_NEW)) | ||
| 80 | self.assertEqual(result.imports[1], | ||
| 81 | ('E79A842DA34A1CA383F64A1546BB55F0885C65A4', | ||
| 82 | - None, gpgme.IMPORT_NEW | gpgme.IMPORT_SECRET)) | ||
| 83 | + None, gpgme.IMPORT_SIG)) | ||
| 84 | self.assertEqual(result.imports[2], | ||
| 85 | ('E79A842DA34A1CA383F64A1546BB55F0885C65A4', | ||
| 86 | - None, gpgme.IMPORT_SIG)) | ||
| 87 | + None, gpgme.IMPORT_NEW | gpgme.IMPORT_SECRET)) | ||
| 88 | self.assertEqual(result.imports[3], | ||
| 89 | ('93C2240D6B8AA10AB28F701D2CF46B7FC97E6B0F', | ||
| 90 | None, gpgme.IMPORT_NEW)) | ||
diff --git a/meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch b/meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch deleted file mode 100644 index c18cf3feba..0000000000 --- a/meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | From ba0dc8273e4f83bcd2d43baa5910aae34b93048c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> | ||
| 3 | Date: Mon, 1 Feb 2016 19:25:12 -0500 | ||
| 4 | Subject: [PATCH] passphrase_cb is deprecated | ||
| 5 | |||
| 6 | https://bugs.gnupg.org/gnupg/issue767 indicates that | ||
| 7 | gpgme_set_passphrase_cb is a deprecated corner of the API and that | ||
| 8 | developers using gpgme should really rely on the gpg-agent to handle | ||
| 9 | this stuff. This should actually simplify things for most | ||
| 10 | installations -- just strip out all passphrase handling from your | ||
| 11 | application entirely, relying on gpg to figure out how to find the | ||
| 12 | agent, and relying on the agent figuring out how to prompt the user | ||
| 13 | (if necessary). | ||
| 14 | |||
| 15 | However, if a developer really wants to use the passphrase callback | ||
| 16 | approach, they'll have to use loopback pinentry. This sets up the | ||
| 17 | test suite to be able to make those tests. | ||
| 18 | |||
| 19 | Upstream-Status: Backport | ||
| 20 | |||
| 21 | Signed-off-by: Catalin Enache <catalin.enache@windriver.com> | ||
| 22 | |||
| 23 | --- | ||
| 24 | tests/util.py | 8 +++++++- | ||
| 25 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
| 26 | |||
| 27 | diff --git a/tests/util.py b/tests/util.py | ||
| 28 | index cd803c2..86892ca 100644 | ||
| 29 | --- a/tests/util.py | ||
| 30 | +++ b/tests/util.py | ||
| 31 | @@ -28,7 +28,9 @@ keydir = os.path.join(os.path.dirname(__file__), 'keys') | ||
| 32 | |||
| 33 | class GpgHomeTestCase(unittest.TestCase): | ||
| 34 | |||
| 35 | - gpg_conf_contents = '' | ||
| 36 | + gpg_conf_contents = 'pinentry-mode loopback' | ||
| 37 | + gpg_agent_conf_contents = 'allow-loopback-pinentry' | ||
| 38 | + | ||
| 39 | import_keys = [] | ||
| 40 | |||
| 41 | def keyfile(self, key): | ||
| 42 | @@ -41,6 +43,10 @@ class GpgHomeTestCase(unittest.TestCase): | ||
| 43 | fp.write(self.gpg_conf_contents.encode('UTF-8')) | ||
| 44 | fp.close() | ||
| 45 | |||
| 46 | + fp = open(os.path.join(self._gpghome, 'gpg-agent.conf'), 'wb') | ||
| 47 | + fp.write(self.gpg_agent_conf_contents.encode('UTF-8')) | ||
| 48 | + fp.close() | ||
| 49 | + | ||
| 50 | # import requested keys into the keyring | ||
| 51 | ctx = gpgme.Context() | ||
| 52 | for key in self.import_keys: | ||
diff --git a/meta-python/recipes-devtools/python/python-pygpgme/0003-handle-generic-error-when-no-passphrase-callback-pre.patch b/meta-python/recipes-devtools/python/python-pygpgme/0003-handle-generic-error-when-no-passphrase-callback-pre.patch deleted file mode 100644 index 6acb68bfe7..0000000000 --- a/meta-python/recipes-devtools/python/python-pygpgme/0003-handle-generic-error-when-no-passphrase-callback-pre.patch +++ /dev/null | |||
| @@ -1,30 +0,0 @@ | |||
| 1 | From 579b5930e15de8855bf63b3c20b6c3aaf894c3eb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> | ||
| 3 | Date: Mon, 1 Feb 2016 19:27:59 -0500 | ||
| 4 | Subject: [PATCH] handle generic error when no passphrase callback present | ||
| 5 | |||
| 6 | apparently gpg 2.1 returns ERR_GENERAL right now if the pinentry was | ||
| 7 | in loopback mode and no passphrase callback was supplied. Earlier | ||
| 8 | versions supplied ERR_BAD_PASSPHRASE. | ||
| 9 | |||
| 10 | Upstream-Status: Backport | ||
| 11 | |||
| 12 | Signed-off-by: Catalin Enache <catalin.enache@windriver.com> | ||
| 13 | |||
| 14 | --- | ||
| 15 | tests/test_passphrase.py | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/tests/test_passphrase.py b/tests/test_passphrase.py | ||
| 19 | index 0a235e9..35b3c59 100644 | ||
| 20 | --- a/tests/test_passphrase.py | ||
| 21 | +++ b/tests/test_passphrase.py | ||
| 22 | @@ -41,7 +41,7 @@ class PassphraseTestCase(GpgHomeTestCase): | ||
| 23 | new_sigs = ctx.sign(plaintext, signature, gpgme.SIG_MODE_CLEAR) | ||
| 24 | except gpgme.GpgmeError as exc: | ||
| 25 | self.assertEqual(exc.args[0], gpgme.ERR_SOURCE_GPGME) | ||
| 26 | - self.assertEqual(exc.args[1], gpgme.ERR_BAD_PASSPHRASE) | ||
| 27 | + self.assertEqual(exc.args[1], gpgme.ERR_GENERAL) | ||
| 28 | else: | ||
| 29 | self.fail('gpgme.GpgmeError not raised') | ||
| 30 | |||
diff --git a/meta-python/recipes-devtools/python/python-pygpgme/run-ptest b/meta-python/recipes-devtools/python/python-pygpgme/run-ptest deleted file mode 100644 index ce2abb66a5..0000000000 --- a/meta-python/recipes-devtools/python/python-pygpgme/run-ptest +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | GPG_AGENT_INFO= python test_all.py -v 2>&1 | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g' | ||
