summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch
diff options
context:
space:
mode:
authorCatalin Enache <catalin.enache@windriver.com>2016-07-22 11:45:53 +0300
committerMartin Jansa <Martin.Jansa@gmail.com>2016-07-29 11:00:59 +0200
commitca6edca71a54cdfc91453d3e648d80a98ad1a963 (patch)
tree1c4b06d3b911cd6bc73b22240b56e1edcbbf6e0a /meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch
parent8dca4abac2743bbd241a3fe9e448b797dc561fbd (diff)
downloadmeta-openembedded-ca6edca71a54cdfc91453d3e648d80a98ad1a963.tar.gz
python-pygpgme: update tests
python-pygpgme tests need to be updated in order to be compatible with GnuPG 2.1 and newer versions. Signed-off-by: Catalin Enache <catalin.enache@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch')
-rw-r--r--meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch50
1 files changed, 50 insertions, 0 deletions
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
new file mode 100644
index 000000000..ccd941f7b
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch
@@ -0,0 +1,50 @@
1From dc75482af095d667a4a92655c4e7eb312e80c42d Mon Sep 17 00:00:00 2001
2From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
3Date: Mon, 1 Feb 2016 19:25:12 -0500
4Subject: [PATCH 2/5] passphrase_cb is deprecated
5
6https://bugs.gnupg.org/gnupg/issue767 indicates that
7gpgme_set_passphrase_cb is a deprecated corner of the API and that
8developers using gpgme should really rely on the gpg-agent to handle
9this stuff. This should actually simplify things for most
10installations -- just strip out all passphrase handling from your
11application entirely, relying on gpg to figure out how to find the
12agent, and relying on the agent figuring out how to prompt the user
13(if necessary).
14
15However, if a developer really wants to use the passphrase callback
16approach, they'll have to use loopback pinentry. This sets up the
17test suite to be able to make those tests.
18
19Upstream-Status: Backport
20
21Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
22---
23 tests/util.py | 8 +++++++-
24 1 file changed, 7 insertions(+), 1 deletion(-)
25
26diff --git a/tests/util.py b/tests/util.py
27index cd803c2..86892ca 100644
28--- a/tests/util.py
29+++ b/tests/util.py
30@@ -28,7 +28,9 @@ keydir = os.path.join(os.path.dirname(__file__), 'keys')
31
32 class GpgHomeTestCase(unittest.TestCase):
33
34- gpg_conf_contents = ''
35+ gpg_conf_contents = 'pinentry-mode loopback'
36+ gpg_agent_conf_contents = 'allow-loopback-pinentry'
37+
38 import_keys = []
39
40 def keyfile(self, key):
41@@ -41,6 +43,10 @@ class GpgHomeTestCase(unittest.TestCase):
42 fp.write(self.gpg_conf_contents.encode('UTF-8'))
43 fp.close()
44
45+ fp = open(os.path.join(self._gpghome, 'gpg-agent.conf'), 'wb')
46+ fp.write(self.gpg_agent_conf_contents.encode('UTF-8'))
47+ fp.close()
48+
49 # import requested keys into the keyring
50 ctx = gpgme.Context()