[git] GPGME - branch, master, updated. gpgme-1.11.1-298-g6878126
by Werner Koch
cvs at cvs.gnupg.org
Thu Sep 20 17:54:54 CEST 2018
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 6878126b6f53cdf7daeeaf68116dda008564c2fa (commit)
via dcdabf5f2ef84e1f304fcc0590ec4bb160354af5 (commit)
from ec2d2b78bc61a730d0d33bd997f386ba381720c5 (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 6878126b6f53cdf7daeeaf68116dda008564c2fa
Author: Werner Koch <wk at gnupg.org>
Date: Thu Sep 20 17:30:48 2018 +0200
python: Fix a couple of syntax errors.
* lang/python/tests/t-keylist-from-data.py: Add missing line
continuation.
* lang/python/tests/t-keylist.py: Ditto.
* lang/python/tests/t-quick-key-creation.py: Ditto.
* lang/python/tests/t-quick-subkey-creation.py: Ditto.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/lang/python/tests/t-keylist-from-data.py b/lang/python/tests/t-keylist-from-data.py
index f82ca84..4fd9ba0 100755
--- a/lang/python/tests/t-keylist-from-data.py
+++ b/lang/python/tests/t-keylist-from-data.py
@@ -162,18 +162,18 @@ def check_global(key, uids, n_subkeys):
assert key.can_sign, "Key unexpectedly unusable for signing"
assert key.can_certify, "Key unexpectedly unusable for certifications"
assert not key.secret, "Key unexpectedly secret"
- assert not key.protocol != gpg.constants.protocol.
- OpenPGP, "Key has unexpected protocol: {}".format(key.protocol)
- assert not key.issuer_serial,
- "Key unexpectedly carries issuer serial: {}".format(key.issuer_serial)
- assert not key.issuer_name,
- "Key unexpectedly carries issuer name: {}".format(key.issuer_name)
- assert not key.chain_id,
- "Key unexpectedly carries chain ID: {}".format(key.chain_id)
- assert key.owner_trust == gpg.constants.validity.UNKNOWN,
- "Key has unexpected owner trust: {}".format(key.owner_trust)
- assert len(key.subkeys) - 1 == n_subkeys,
- "Key `{}' has unexpected number of subkeys".format(uids[0][0])
+ assert not key.protocol != gpg.constants.protocol.OpenPGP, \
+ "Key has unexpected protocol: {}".format(key.protocol)
+ assert not key.issuer_serial, \
+ "Key unexpectedly carries issuer serial: {}".format(key.issuer_serial)
+ assert not key.issuer_name, \
+ "Key unexpectedly carries issuer name: {}".format(key.issuer_name)
+ assert not key.chain_id, \
+ "Key unexpectedly carries chain ID: {}".format(key.chain_id)
+ assert key.owner_trust == gpg.constants.validity.UNKNOWN, \
+ "Key has unexpected owner trust: {}".format(key.owner_trust)
+ assert len(key.subkeys) - 1 == n_subkeys, \
+ "Key `{}' has unexpected number of subkeys".format(uids[0][0])
def check_subkey(fpr, which, subkey):
@@ -183,49 +183,51 @@ def check_subkey(fpr, which, subkey):
assert not subkey.invalid, which + " key unexpectedly invalid"
if which == "Primary":
- assert not subkey.can_encrypt,
- which + " key unexpectedly usable for encryption"
- assert subkey.can_sign,
- which + " key unexpectedly unusable for signing"
- assert subkey.can_certify,
- which + " key unexpectedly unusable for certifications"
+ assert not subkey.can_encrypt, \
+ which + " key unexpectedly usable for encryption"
+ assert subkey.can_sign, \
+ which + " key unexpectedly unusable for signing"
+ assert subkey.can_certify, \
+ which + " key unexpectedly unusable for certifications"
else:
- assert subkey.can_encrypt,
- which + " key unexpectedly unusable for encryption"
- assert not subkey.can_sign,
- which + " key unexpectedly usable for signing"
- assert not subkey.can_certify,
- which + " key unexpectedly usable for certifications"
+ assert subkey.can_encrypt, \
+ which + " key unexpectedly unusable for encryption"
+ assert not subkey.can_sign, \
+ which + " key unexpectedly usable for signing"
+ assert not subkey.can_certify, \
+ which + " key unexpectedly usable for certifications"
assert not subkey.secret, which + " key unexpectedly secret"
assert not subkey.is_cardkey, "Public key marked as card key"
assert not subkey.card_number, "Public key with card number set"
- assert not subkey.pubkey_algo !=
- (gpg.constants.pk.DSA if which == "Primary" else gpg.constants.pk.ELG_E),
- which + " key has unexpected public key algo: {}".format(subkey.
- pubkey_algo)
- assert subkey.length == 1024,
- which + " key has unexpected length: {}".format(subkey.length)
- assert fpr.endswith(subkey.keyid),
- which + " key has unexpected key ID: {}".format(subkey.keyid)
- assert which == "Secondary" or subkey.fpr == fpr,
- which + " key has unexpected fingerprint: {}".format(subkey.fpr)
- assert not subkey.expires,
- which + " key unexpectedly expires: {}".format(subkey.expires)
+ assert not subkey.pubkey_algo != \
+ (gpg.constants.pk.DSA if which == "Primary"
+ else gpg.constants.pk.ELG_E), \
+ which + " key has unexpected public key algo: {}".format(subkey.
+ pubkey_algo)
+ assert subkey.length == 1024, \
+ which + " key has unexpected length: {}".format(subkey.length)
+ assert fpr.endswith(subkey.keyid), \
+ which + " key has unexpected key ID: {}".format(subkey.keyid)
+ assert which == "Secondary" or subkey.fpr == fpr, \
+ which + " key has unexpected fingerprint: {}".format(subkey.fpr)
+ assert not subkey.expires, \
+ which + " key unexpectedly expires: {}".format(subkey.expires)
def check_uid(which, ref, uid):
assert not uid.revoked, which + " user ID unexpectedly revoked"
assert not uid.invalid, which + " user ID unexpectedly invalid"
- assert uid.validity == gpg.constants.validity.UNKNOWN,
- which + " user ID has unexpected validity: {}".format(uid.validity)
+ assert uid.validity == gpg.constants.validity.UNKNOWN, \
+ which + " user ID has unexpected validity: {}".format(uid.validity)
assert not uid.signatures, which + " user ID unexpectedly signed"
- assert uid.name == ref[0],
- "Unexpected name in {} user ID: {!r}".format(which.lower(), uid.name)
- assert uid.comment == ref[1],
- "Unexpected comment in {} user ID: {!r}".format(which.lower(), uid.comment)
- assert uid.email == ref[2],
- "Unexpected email in {} user ID: {!r}".format(which.lower(), uid.email)
+ assert uid.name == ref[0], \
+ "Unexpected name in {} user ID: {!r}".format(which.lower(), uid.name)
+ assert uid.comment == ref[1], \
+ "Unexpected comment in {} user ID: {!r}".format(which.lower(),
+ uid.comment)
+ assert uid.email == ref[2], \
+ "Unexpected email in {} user ID: {!r}".format(which.lower(), uid.email)
# Export all the data from our keyring...
diff --git a/lang/python/tests/t-keylist.py b/lang/python/tests/t-keylist.py
index b725fc3..9cbada5 100755
--- a/lang/python/tests/t-keylist.py
+++ b/lang/python/tests/t-keylist.py
@@ -162,25 +162,25 @@ def check_global(key, uids, n_subkeys):
assert key.can_sign, "Key unexpectedly unusable for signing"
assert key.can_certify, "Key unexpectedly unusable for certifications"
assert not key.secret, "Key unexpectedly secret"
- assert not key.protocol != gpg.constants.protocol.OpenPGP,
- "Key has unexpected protocol: {}".format(key.protocol)
- assert not key.issuer_serial,
- "Key unexpectedly carries issuer serial: {}".format(key.issuer_serial)
- assert not key.issuer_name,
- "Key unexpectedly carries issuer name: {}".format(key.issuer_name)
- assert not key.chain_id,
- "Key unexpectedly carries chain ID: {}".format(key.chain_id)
+ assert not key.protocol != gpg.constants.protocol.OpenPGP, \
+ "Key has unexpected protocol: {}".format(key.protocol)
+ assert not key.issuer_serial, \
+ "Key unexpectedly carries issuer serial: {}".format(key.issuer_serial)
+ assert not key.issuer_name, \
+ "Key unexpectedly carries issuer name: {}".format(key.issuer_name)
+ assert not key.chain_id, \
+ "Key unexpectedly carries chain ID: {}".format(key.chain_id)
# Only key Alfa is trusted
- assert key.uids[0].name == 'Alfa Test' or
- key.owner_trust == gpg.constants.validity.UNKNOWN,
- "Key has unexpected owner trust: {}".format(key.owner_trust)
- assert key.uids[0].name != 'Alfa Test' or key.owner_trust == gpg.constants.
- validity.ULTIMATE, "Key has unexpected owner trust: {}".
- format(key.owner_trust)
+ assert (key.uids[0].name == 'Alfa Test'
+ or key.owner_trust == gpg.constants.validity.UNKNOWN), \
+ "Key has unexpected owner trust: {}".format(key.owner_trust)
+ assert (key.uids[0].name != 'Alfa Test'
+ or key.owner_trust == gpg.constants.validity.ULTIMATE), \
+ "Key has unexpected owner trust: {}".format(key.owner_trust)
- assert len(key.subkeys) - 1 == n_subkeys,
- "Key `{}' has unexpected number of subkeys".format(uids[0][0])
+ assert len(key.subkeys) - 1 == n_subkeys, \
+ "Key `{}' has unexpected number of subkeys".format(uids[0][0])
def check_subkey(fpr, which, subkey):
@@ -207,18 +207,19 @@ def check_subkey(fpr, which, subkey):
assert not subkey.secret, which + " key unexpectedly secret"
assert not subkey.is_cardkey, "Public key marked as card key"
assert not subkey.card_number, "Public key with card number set"
- assert not subkey.pubkey_algo !=
- (gpg.constants.pk.DSA if which == "Primary" else gpg.constants.pk.ELG_E),
- which + " key has unexpected public key algo: {}".format(subkey.
+ assert not subkey.pubkey_algo != \
+ (gpg.constants.pk.DSA if which == "Primary"
+ else gpg.constants.pk.ELG_E), \
+ which + " key has unexpected public key algo: {}".format(subkey.
pubkey_algo)
- assert subkey.length == 1024,
- which + " key has unexpected length: {}".format(subkey.length)
- assert fpr.endswith(subkey.keyid),
- which + " key has unexpected key ID: {}".format(subkey.keyid)
- assert which == "Secondary" or subkey.fpr == fpr,
- which + " key has unexpected fingerprint: {}".format(subkey.fpr)
- assert not subkey.expires,
- which + " key unexpectedly expires: {}".format(subkey.expires)
+ assert subkey.length == 1024, \
+ which + " key has unexpected length: {}".format(subkey.length)
+ assert fpr.endswith(subkey.keyid), \
+ which + " key has unexpected key ID: {}".format(subkey.keyid)
+ assert which == "Secondary" or subkey.fpr == fpr, \
+ which + " key has unexpected fingerprint: {}".format(subkey.fpr)
+ assert not subkey.expires, \
+ which + " key unexpectedly expires: {}".format(subkey.expires)
def check_uid(which, ref, uid):
@@ -227,16 +228,16 @@ def check_uid(which, ref, uid):
assert uid.validity == (gpg.constants.validity.UNKNOWN
if uid.name.split()[0]
not in {'Alfa', 'Alpha', 'Alice'} else
- gpg.constants.validity.ULTIMATE),
- which + " user ID has unexpectedly validity: {}".format(uid.validity)
+ gpg.constants.validity.ULTIMATE), \
+ which + " user ID has unexpectedly validity: {}".format(uid.validity)
assert not uid.signatures, which + " user ID unexpectedly signed"
- assert uid.name == ref[0],
- "Unexpected name in {} user ID: {!r}".format(which.lower(), uid.name)
- assert uid.comment == ref[1],
- "Unexpected comment in {} user ID: {!r}".format(which.lower(),
- uid.comment)
- assert uid.email == ref[2],
- "Unexpected email in {} user ID: {!r}".format(which.lower(), uid.email)
+ assert uid.name == ref[0], \
+ "Unexpected name in {} user ID: {!r}".format(which.lower(), uid.name)
+ assert uid.comment == ref[1], \
+ "Unexpected comment in {} user ID: {!r}".\
+ format(which.lower(), uid.comment)
+ assert uid.email == ref[2], \
+ "Unexpected email in {} user ID: {!r}".format(which.lower(), uid.email)
i = 0
diff --git a/lang/python/tests/t-quick-key-creation.py b/lang/python/tests/t-quick-key-creation.py
index 4720928..b3303ff 100755
--- a/lang/python/tests/t-quick-key-creation.py
+++ b/lang/python/tests/t-quick-key-creation.py
@@ -80,8 +80,11 @@ with support.EphemeralContext() as ctx:
"Primary keys expiration time is off"
# Check capabilities
- for sign, encrypt, certify, authenticate in itertools.
- product([False, True], [False, True], [False, True], [False, True]):
+ for sign, encrypt, certify, authenticate \
+ in itertools.product([False, True],
+ [False, True],
+ [False, True],
+ [False, True]):
# Filter some out
if not (sign or encrypt or certify or authenticate):
# This triggers the default capabilities tested before.
diff --git a/lang/python/tests/t-quick-subkey-creation.py b/lang/python/tests/t-quick-subkey-creation.py
index 30424c1..cdbb71b 100755
--- a/lang/python/tests/t-quick-subkey-creation.py
+++ b/lang/python/tests/t-quick-subkey-creation.py
@@ -60,8 +60,10 @@ with support.EphemeralContext() as ctx:
"subkeys expiration time is off"
# Check capabilities
- for sign, encrypt, authenticate in itertools.
- product([False, True], [False, True], [False, True]):
+ for sign, encrypt, authenticate \
+ in itertools.product([False, True],
+ [False, True],
+ [False, True]):
# Filter some out
if not (sign or encrypt or authenticate):
# This triggers the default capabilities tested before.
commit dcdabf5f2ef84e1f304fcc0590ec4bb160354af5
Author: Werner Koch <wk at gnupg.org>
Date: Thu Sep 20 17:28:25 2018 +0200
python: Silence a few warnings.
* src/gpgme.h.in: Obsolete "class" also for Python.
* lang/python/gpgme.i: Silenece a swig warning. Silence a gcc
warning.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/lang/python/gpgme.i b/lang/python/gpgme.i
index 492326b..f3d14a7 100644
--- a/lang/python/gpgme.i
+++ b/lang/python/gpgme.i
@@ -21,6 +21,12 @@
%include "cpointer.i"
%include "cstring.i"
+%{
+/* We use public symbols (eg. "_obsolete_class") which are marked as
+ * deprecated but we need to keep them. Silence the warning. */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+%}
+
/* Generate doc strings for all methods.
This will generate docstrings of the form
@@ -575,7 +581,8 @@ off_t gpgme_data_seek (gpgme_data_t dh, off_t offset, int whence=SEEK_SET);
%}
/* This is for notations, where we want to hide the length fields, and
- the unused bit field block. */
+ * the unused bit field block. We silence the warning. */
+%warnfilter(302) _gpgme_sig_notation;
struct _gpgme_sig_notation
{
struct _gpgme_sig_notation *next;
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index e4ea466..9c9ea5a 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -95,6 +95,12 @@ extern "C" {
#define _GPGME_DEPRECATED_OUTSIDE_GPGME(a,b) _GPGME_DEPRECATED(a,b)
#endif
+/* We used to use some symbols which clash with keywords in some
+ * languages. This macro is used to obsolete them. */
+#if defined(__cplusplus) || defined(SWIGPYTHON)
+# define _GPGME_OBSOLETE_SOME_SYMBOLS 1
+#endif
+
/* Check for a matching _FILE_OFFSET_BITS definition. */
#if @NEED__FILE_OFFSET_BITS@
@@ -640,7 +646,7 @@ struct _gpgme_key_sig
gpgme_error_t status;
/* Deprecated; use SIG_CLASS instead. */
-#ifdef __cplusplus
+#ifdef _GPGME_OBSOLETE_SOME_SYMBOLS
unsigned int _obsolete_class _GPGME_DEPRECATED(0,4);
#else
unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);
@@ -1466,7 +1472,7 @@ struct _gpgme_new_signature
char *fpr;
/* Deprecated; use SIG_CLASS instead. */
-#ifdef __cplusplus
+#ifdef _GPGME_OBSOLETE_SOME_SYMBOLS
unsigned int _obsolete_class_2;
#else
unsigned int class _GPGME_DEPRECATED_OUTSIDE_GPGME(0,4);
-----------------------------------------------------------------------
Summary of changes:
lang/python/gpgme.i | 9 ++-
lang/python/tests/t-keylist-from-data.py | 90 ++++++++++++++--------------
lang/python/tests/t-keylist.py | 73 +++++++++++-----------
lang/python/tests/t-quick-key-creation.py | 7 ++-
lang/python/tests/t-quick-subkey-creation.py | 6 +-
src/gpgme.h.in | 10 +++-
6 files changed, 108 insertions(+), 87 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list