[git] GPGME - branch, master, updated. gpgme-1.8.0-104-g16b202d

by Justus Winter cvs at cvs.gnupg.org
Mon Mar 20 16:43:21 CET 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  16b202d9999591b71fb8bb49f6db10ef96d4cbe8 (commit)
       via  e1cf8bab319ba1dea41ba5d711dbb66ffd8e6fd6 (commit)
       via  4572e8d2ac1d3b45e75ce71265c99e591fbf0e28 (commit)
      from  9d6825be092f1590f28b5bab462eeb944d9b800c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 16b202d9999591b71fb8bb49f6db10ef96d4cbe8
Author: Justus Winter <justus at g10code.com>
Date:   Mon Mar 20 16:36:27 2017 +0100

    tests: Use 'gpg-agent --allow-loopback-pinentry' if applicable.
    
    * lang/python/tests/Makefile.am (gpg-agent.conf): Do not hard-code the
    option.  This breaks gpg-agent from GnuPG 2.0.
    * tests/start-stop-agent: Rather, check if the option is supported and
    add it to the configuration if it is.
    
    GnuPG-bug-id: 3008
    Fixes-commit: bbf19124bbec9eb6298cef2914baae7ac74382fe
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am
index 7251cd3..a935222 100644
--- a/lang/python/tests/Makefile.am
+++ b/lang/python/tests/Makefile.am
@@ -117,4 +117,3 @@ clean-local:
 ./gpg-agent.conf:
 # This is required for gpg2, which does not support command fd.
 	echo pinentry-program $(abs_top_srcdir)/tests/gpg/pinentry >$@
-	echo allow-loopback-pinentry >>$@
diff --git a/tests/start-stop-agent b/tests/start-stop-agent
index e843ce5..457f70d 100755
--- a/tests/start-stop-agent
+++ b/tests/start-stop-agent
@@ -38,6 +38,14 @@ fi
 
 echo "starting gpg-agent.." >&2
 
+# GnuPG prior to 2.1.12 needs --allow-loopback-pinentry for the
+# loopback entry to work.  Old versions do not understand this though,
+# so we need to be careful.
+if "$GPG_AGENT" --gpgconf-test --allow-loopback-pinentry &&
+   ! grep -q allow-loopback-pinentry "$GNUPGHOME/gpg-agent.conf"; then
+    echo allow-loopback-pinentry >> "$GNUPGHOME/gpg-agent.conf"
+fi
+
 gpg-connect-agent --agent-program="${GPG_AGENT}|--debug-quick-random" putval\ $token\ set /bye
 if [ $? -ne 0 -o "$(gpg-connect-agent getval\ $token /bye 2>/dev/null | head -1)" \
       != "D set" ]; then

commit e1cf8bab319ba1dea41ba5d711dbb66ffd8e6fd6
Author: Justus Winter <justus at g10code.com>
Date:   Mon Mar 20 16:00:13 2017 +0100

    python: Skip tests if GnuPG is too old.
    
    * lang/python/tests/support.py (assert_gpg_version): New function.
    * lang/python/tests/t-callbacks.py: Use the new function to skip the
    test if GnuPG is too old.
    * lang/python/tests/t-edit.py: Likewise.
    * lang/python/tests/t-encrypt-sym.py: Likewise.
    * lang/python/tests/t-quick-key-creation.py: Likewise.
    * lang/python/tests/t-quick-key-manipulation.py: Likewise.
    * lang/python/tests/t-quick-key-signing.py: Likewise.
    
    GnuPG-bug-id: 3008
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py
index 80c3a4b..8f9d645 100644
--- a/lang/python/tests/support.py
+++ b/lang/python/tests/support.py
@@ -26,6 +26,13 @@ import tempfile
 import time
 import gpg
 
+def assert_gpg_version(version=(2, 1, 0)):
+    with gpg.Context() as c:
+        if tuple(map(int, c.engine_info.version.split('.'))) < version:
+            print("GnuPG too old: have {0}, need {1}.".format(
+                c.engine_info.version, '.'.join(version)))
+            sys.exit(77)
+
 # known keys
 alpha = "A0FF4590BB6122EDEF6E3C542D727CC768697734"
 bob = "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2"
diff --git a/lang/python/tests/t-callbacks.py b/lang/python/tests/t-callbacks.py
index ae15787..94cf11e 100755
--- a/lang/python/tests/t-callbacks.py
+++ b/lang/python/tests/t-callbacks.py
@@ -24,6 +24,8 @@ import os
 import gpg
 import support
 
+support.assert_gpg_version()
+
 c = gpg.Context()
 c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
 
diff --git a/lang/python/tests/t-edit.py b/lang/python/tests/t-edit.py
index 7ac3626..ffc3296 100755
--- a/lang/python/tests/t-edit.py
+++ b/lang/python/tests/t-edit.py
@@ -26,6 +26,8 @@ import os
 import gpg
 import support
 
+support.assert_gpg_version()
+
 class KeyEditor(object):
     def __init__(self):
         self.steps = ["fpr", "expire", "1", "primary", "quit"]
diff --git a/lang/python/tests/t-encrypt-sym.py b/lang/python/tests/t-encrypt-sym.py
index c15955a..8ee9cd6 100755
--- a/lang/python/tests/t-encrypt-sym.py
+++ b/lang/python/tests/t-encrypt-sym.py
@@ -24,6 +24,8 @@ import os
 import gpg
 import support
 
+support.assert_gpg_version()
+
 for passphrase in ("abc", b"abc"):
     c = gpg.Context()
     c.set_armor(True)
diff --git a/lang/python/tests/t-quick-key-creation.py b/lang/python/tests/t-quick-key-creation.py
index c642c5b..8b7372e 100755
--- a/lang/python/tests/t-quick-key-creation.py
+++ b/lang/python/tests/t-quick-key-creation.py
@@ -25,6 +25,7 @@ import itertools
 import time
 
 import support
+support.assert_gpg_version((2, 1, 2))
 
 alpha = "Alpha <alpha at invalid.example.net>"
 
diff --git a/lang/python/tests/t-quick-key-manipulation.py b/lang/python/tests/t-quick-key-manipulation.py
index 45e4c0e..0f47006 100755
--- a/lang/python/tests/t-quick-key-manipulation.py
+++ b/lang/python/tests/t-quick-key-manipulation.py
@@ -24,6 +24,7 @@ import os
 import gpg
 
 import support
+support.assert_gpg_version((2, 1, 14))
 
 alpha = "Alpha <alpha at invalid.example.net>"
 bravo = "Bravo <bravo at invalid.example.net>"
diff --git a/lang/python/tests/t-quick-key-signing.py b/lang/python/tests/t-quick-key-signing.py
index f9778a3..3d648c5 100755
--- a/lang/python/tests/t-quick-key-signing.py
+++ b/lang/python/tests/t-quick-key-signing.py
@@ -25,6 +25,7 @@ import itertools
 import time
 
 import support
+support.assert_gpg_version((2, 1, 1))
 
 with support.EphemeralContext() as ctx:
     uid_counter = 0

commit 4572e8d2ac1d3b45e75ce71265c99e591fbf0e28
Author: Justus Winter <justus at g10code.com>
Date:   Mon Mar 20 16:07:07 2017 +0100

    python: Remove superfluous initialization.
    
    * lang/python/tests/support.py (init_gpgme): Remove.  This is an
    remnant from the c tests.  Nowadays, the Python bindings initialize
    GPGME automagically.
    * lang/python/tests/initial.py: Remove call to 'support.init_gpgme'.
    * lang/python/tests/t-callbacks.py: Likewise.
    * lang/python/tests/t-decrypt-verify.py: Likewise.
    * lang/python/tests/t-decrypt.py: Likewise.
    * lang/python/tests/t-edit.py: Likewise.
    * lang/python/tests/t-encrypt-large.py: Likewise.
    * lang/python/tests/t-encrypt-sign.py: Likewise.
    * lang/python/tests/t-encrypt-sym.py: Likewise.
    * lang/python/tests/t-encrypt.py: Likewise.
    * lang/python/tests/t-export.py: Likewise.
    * lang/python/tests/t-file-name.py: Likewise.
    * lang/python/tests/t-idiomatic.py: Likewise.
    * lang/python/tests/t-import.py: Likewise.
    * lang/python/tests/t-keylist.py: Likewise.
    * lang/python/tests/t-sig-notation.py: Likewise.
    * lang/python/tests/t-sign.py: Likewise.
    * lang/python/tests/t-signers.py: Likewise.
    * lang/python/tests/t-trustlist.py: Likewise.
    * lang/python/tests/t-verify.py: Likewise.
    * lang/python/tests/t-wait.py: Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/lang/python/tests/initial.py b/lang/python/tests/initial.py
index 4a02762..49e4f82 100755
--- a/lang/python/tests/initial.py
+++ b/lang/python/tests/initial.py
@@ -27,8 +27,6 @@ import support
 
 print("Using gpg module from {0!r}.".format(os.path.dirname(gpg.__file__)))
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
 subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
                                     "tests", "start-stop-agent"), "--start"])
 
diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py
index 69aa7a4..80c3a4b 100644
--- a/lang/python/tests/support.py
+++ b/lang/python/tests/support.py
@@ -39,9 +39,6 @@ def make_filename(name):
 def in_srcdir(name):
     return os.path.join(os.environ['srcdir'], name)
 
-def init_gpgme(proto):
-    gpg.core.engine_check_version(proto)
-
 verbose = int(os.environ.get('verbose', 0)) > 1
 def print_data(data):
     if verbose:
diff --git a/lang/python/tests/t-callbacks.py b/lang/python/tests/t-callbacks.py
index eed50bc..ae15787 100755
--- a/lang/python/tests/t-callbacks.py
+++ b/lang/python/tests/t-callbacks.py
@@ -24,8 +24,6 @@ import os
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
 c = gpg.Context()
 c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
 
diff --git a/lang/python/tests/t-decrypt-verify.py b/lang/python/tests/t-decrypt-verify.py
index 6243167..03bbc4b 100755
--- a/lang/python/tests/t-decrypt-verify.py
+++ b/lang/python/tests/t-decrypt-verify.py
@@ -34,7 +34,6 @@ def check_verify_result(result, summary, fpr, status):
     assert sig.validity == gpg.constants.validity.FULL
     assert gpg.errors.GPGMEError(sig.validity_reason).getcode() == gpg.errors.NO_ERROR
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 
 source = gpg.Data(file=support.make_filename("cipher-2.asc"))
diff --git a/lang/python/tests/t-decrypt.py b/lang/python/tests/t-decrypt.py
index 1af0562..05b6d8b 100755
--- a/lang/python/tests/t-decrypt.py
+++ b/lang/python/tests/t-decrypt.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 
 source = gpg.Data(file=support.make_filename("cipher-1.asc"))
diff --git a/lang/python/tests/t-edit.py b/lang/python/tests/t-edit.py
index bd70e7e..7ac3626 100755
--- a/lang/python/tests/t-edit.py
+++ b/lang/python/tests/t-edit.py
@@ -51,8 +51,6 @@ class KeyEditor(object):
 
         return result
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
 c = gpg.Context()
 c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
 c.set_passphrase_cb(lambda *args: "abc")
diff --git a/lang/python/tests/t-encrypt-large.py b/lang/python/tests/t-encrypt-large.py
index cdb4a32..5646085 100755
--- a/lang/python/tests/t-encrypt-large.py
+++ b/lang/python/tests/t-encrypt-large.py
@@ -30,7 +30,6 @@ if len(sys.argv) == 2:
 else:
     nbytes = 100000
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 
 ntoread = nbytes
diff --git a/lang/python/tests/t-encrypt-sign.py b/lang/python/tests/t-encrypt-sign.py
index 094a2b0..f04783f 100755
--- a/lang/python/tests/t-encrypt-sign.py
+++ b/lang/python/tests/t-encrypt-sign.py
@@ -24,7 +24,6 @@ import sys
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)
 
diff --git a/lang/python/tests/t-encrypt-sym.py b/lang/python/tests/t-encrypt-sym.py
index 07e6b62..c15955a 100755
--- a/lang/python/tests/t-encrypt-sym.py
+++ b/lang/python/tests/t-encrypt-sym.py
@@ -24,8 +24,6 @@ import os
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
 for passphrase in ("abc", b"abc"):
     c = gpg.Context()
     c.set_armor(True)
diff --git a/lang/python/tests/t-encrypt.py b/lang/python/tests/t-encrypt.py
index 3cbe8f2..921502a 100755
--- a/lang/python/tests/t-encrypt.py
+++ b/lang/python/tests/t-encrypt.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)
 
diff --git a/lang/python/tests/t-export.py b/lang/python/tests/t-export.py
index 4927beb..b9d5204 100755
--- a/lang/python/tests/t-export.py
+++ b/lang/python/tests/t-export.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)
 
diff --git a/lang/python/tests/t-file-name.py b/lang/python/tests/t-file-name.py
index d12afb8..aab5680 100755
--- a/lang/python/tests/t-file-name.py
+++ b/lang/python/tests/t-file-name.py
@@ -26,7 +26,6 @@ import support
 
 testname = "abcde12345"
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)
 
diff --git a/lang/python/tests/t-idiomatic.py b/lang/python/tests/t-idiomatic.py
index 485f048..826bc23 100755
--- a/lang/python/tests/t-idiomatic.py
+++ b/lang/python/tests/t-idiomatic.py
@@ -27,8 +27,6 @@ import tempfile
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
 # Both Context and Data can be used as context manager:
 with gpg.Context() as c, gpg.Data() as d:
     c.get_engine_info()
diff --git a/lang/python/tests/t-import.py b/lang/python/tests/t-import.py
index 5b0576f..e2edf5a 100755
--- a/lang/python/tests/t-import.py
+++ b/lang/python/tests/t-import.py
@@ -67,7 +67,6 @@ def check_result(result, fpr, secret):
     assert len(result.imports) == 1 or fpr == result.imports[1].fpr
     assert result.imports[0].result == 0
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 
 c.op_import(gpg.Data(file=support.make_filename("pubkey-1.asc")))
diff --git a/lang/python/tests/t-keylist.py b/lang/python/tests/t-keylist.py
index 5077ca6..76c793e 100755
--- a/lang/python/tests/t-keylist.py
+++ b/lang/python/tests/t-keylist.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 
 # Check expration of keys.  This test assumes three subkeys of which
diff --git a/lang/python/tests/t-sig-notation.py b/lang/python/tests/t-sig-notation.py
index f1342b1..2277497 100755
--- a/lang/python/tests/t-sig-notation.py
+++ b/lang/python/tests/t-sig-notation.py
@@ -62,8 +62,6 @@ def check_result(result):
 
     assert len(expected_notations) == 0
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
 source = gpg.Data("Hallo Leute\n")
 signed = gpg.Data()
 
diff --git a/lang/python/tests/t-sign.py b/lang/python/tests/t-sign.py
index 9418ed8..d375729 100755
--- a/lang/python/tests/t-sign.py
+++ b/lang/python/tests/t-sign.py
@@ -53,8 +53,6 @@ def check_result(r, typ):
     if signature.fpr != "A0FF4590BB6122EDEF6E3C542D727CC768697734":
         fail("Wrong fingerprint reported: {}".format(signature.fpr))
 
-
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_textmode(True)
 c.set_armor(True)
diff --git a/lang/python/tests/t-signers.py b/lang/python/tests/t-signers.py
index 80e797c..5864ee5 100755
--- a/lang/python/tests/t-signers.py
+++ b/lang/python/tests/t-signers.py
@@ -53,8 +53,6 @@ def check_result(r, typ):
                                  "23FD347A419429BACCD5E72D6BC4778054ACD246"):
             fail("Wrong fingerprint reported: {}".format(signature.fpr))
 
-
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_textmode(True)
 c.set_armor(True)
diff --git a/lang/python/tests/t-trustlist.py b/lang/python/tests/t-trustlist.py
index 8c5e214..8586596 100755
--- a/lang/python/tests/t-trustlist.py
+++ b/lang/python/tests/t-trustlist.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 
 def dump_item(item):
diff --git a/lang/python/tests/t-verify.py b/lang/python/tests/t-verify.py
index f18e1dd..0347638 100755
--- a/lang/python/tests/t-verify.py
+++ b/lang/python/tests/t-verify.py
@@ -97,8 +97,6 @@ def check_result(result, summary, validity, fpr, status, notation):
             sig.validity, validity)
     assert gpg.errors.GPGMEError(sig.validity_reason).getcode() == gpg.errors.NO_ERROR
 
-
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)
 
diff --git a/lang/python/tests/t-wait.py b/lang/python/tests/t-wait.py
index b1f2043..0c403fa 100755
--- a/lang/python/tests/t-wait.py
+++ b/lang/python/tests/t-wait.py
@@ -24,7 +24,6 @@ import time
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)
 

-----------------------------------------------------------------------

Summary of changes:
 lang/python/tests/Makefile.am                 |  1 -
 lang/python/tests/initial.py                  |  2 --
 lang/python/tests/support.py                  | 10 +++++++---
 lang/python/tests/t-callbacks.py              |  2 +-
 lang/python/tests/t-decrypt-verify.py         |  1 -
 lang/python/tests/t-decrypt.py                |  1 -
 lang/python/tests/t-edit.py                   |  4 ++--
 lang/python/tests/t-encrypt-large.py          |  1 -
 lang/python/tests/t-encrypt-sign.py           |  1 -
 lang/python/tests/t-encrypt-sym.py            |  2 +-
 lang/python/tests/t-encrypt.py                |  1 -
 lang/python/tests/t-export.py                 |  1 -
 lang/python/tests/t-file-name.py              |  1 -
 lang/python/tests/t-idiomatic.py              |  2 --
 lang/python/tests/t-import.py                 |  1 -
 lang/python/tests/t-keylist.py                |  1 -
 lang/python/tests/t-quick-key-creation.py     |  1 +
 lang/python/tests/t-quick-key-manipulation.py |  1 +
 lang/python/tests/t-quick-key-signing.py      |  1 +
 lang/python/tests/t-sig-notation.py           |  2 --
 lang/python/tests/t-sign.py                   |  2 --
 lang/python/tests/t-signers.py                |  2 --
 lang/python/tests/t-trustlist.py              |  1 -
 lang/python/tests/t-verify.py                 |  2 --
 lang/python/tests/t-wait.py                   |  1 -
 tests/start-stop-agent                        |  8 ++++++++
 26 files changed, 22 insertions(+), 31 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list