From ca6edca71a54cdfc91453d3e648d80a98ad1a963 Mon Sep 17 00:00:00 2001 From: Catalin Enache Date: Fri, 22 Jul 2016 11:45:53 +0300 Subject: 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 Signed-off-by: Martin Jansa --- .../0002-passphrase_cb-is-deprecated.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch (limited to 'meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch') 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 0000000000..ccd941f7bb --- /dev/null +++ b/meta-python/recipes-devtools/python/python-pygpgme/0002-passphrase_cb-is-deprecated.patch @@ -0,0 +1,50 @@ +From dc75482af095d667a4a92655c4e7eb312e80c42d Mon Sep 17 00:00:00 2001 +From: Daniel Kahn Gillmor +Date: Mon, 1 Feb 2016 19:25:12 -0500 +Subject: [PATCH 2/5] passphrase_cb is deprecated + +https://bugs.gnupg.org/gnupg/issue767 indicates that +gpgme_set_passphrase_cb is a deprecated corner of the API and that +developers using gpgme should really rely on the gpg-agent to handle +this stuff. This should actually simplify things for most +installations -- just strip out all passphrase handling from your +application entirely, relying on gpg to figure out how to find the +agent, and relying on the agent figuring out how to prompt the user +(if necessary). + +However, if a developer really wants to use the passphrase callback +approach, they'll have to use loopback pinentry. This sets up the +test suite to be able to make those tests. + +Upstream-Status: Backport + +Signed-off-by: Catalin Enache +--- + tests/util.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/tests/util.py b/tests/util.py +index cd803c2..86892ca 100644 +--- a/tests/util.py ++++ b/tests/util.py +@@ -28,7 +28,9 @@ keydir = os.path.join(os.path.dirname(__file__), 'keys') + + class GpgHomeTestCase(unittest.TestCase): + +- gpg_conf_contents = '' ++ gpg_conf_contents = 'pinentry-mode loopback' ++ gpg_agent_conf_contents = 'allow-loopback-pinentry' ++ + import_keys = [] + + def keyfile(self, key): +@@ -41,6 +43,10 @@ class GpgHomeTestCase(unittest.TestCase): + fp.write(self.gpg_conf_contents.encode('UTF-8')) + fp.close() + ++ fp = open(os.path.join(self._gpghome, 'gpg-agent.conf'), 'wb') ++ fp.write(self.gpg_agent_conf_contents.encode('UTF-8')) ++ fp.close() ++ + # import requested keys into the keyring + ctx = gpgme.Context() -- cgit v1.2.3-54-g00ecf