From ecc7af31e423f705228a592b5fd8f9dbd7e7d172 Mon Sep 17 00:00:00 2001 From: Till Maas Date: Aug 22 2013 07:25:47 +0000 Subject: Add patches for ENCRYPT_NO_ENCRYPT_TO, pubkey_algo and hash_algo (#975815) --- diff --git a/pygpgme-no-encrypt-to.patch b/pygpgme-no-encrypt-to.patch new file mode 100644 index 0000000..c65b20d --- /dev/null +++ b/pygpgme-no-encrypt-to.patch @@ -0,0 +1,12 @@ +diff: +=== modified file 'src/pygpgme-constants.c' +--- src/pygpgme-constants.c 2013-02-13 02:17:54 +0000 ++++ src/pygpgme-constants.c 2013-06-19 12:01:23 +0000 +@@ -164,6 +164,7 @@ + + /* gpgme_encrypt_flags_t */ + CONST(ENCRYPT_ALWAYS_TRUST), ++ CONST(ENCRYPT_NO_ENCRYPT_TO), + + /* gpgme_sigsum_t */ + CONST(SIGSUM_VALID), diff --git a/pygpgme-pubkey-hash-algo.patch b/pygpgme-pubkey-hash-algo.patch new file mode 100644 index 0000000..adf09d4 --- /dev/null +++ b/pygpgme-pubkey-hash-algo.patch @@ -0,0 +1,93 @@ +=== modified file 'src/pygpgme-signature.c' +--- src/pygpgme-signature.c 2009-04-01 09:46:01 +0000 ++++ src/pygpgme-signature.c 2013-05-14 09:58:05 +0000 +@@ -101,6 +101,8 @@ + Py_XDECREF(self->wrong_key_usage); + Py_XDECREF(self->validity); + Py_XDECREF(self->validity_reason); ++ Py_XDECREF(self->pubkey_algo); ++ Py_XDECREF(self->hash_algo); + PyObject_Del(self); + } + +@@ -117,6 +119,8 @@ + { "validity", T_OBJECT, offsetof(PyGpgmeSignature, validity), READONLY}, + { "validity_reason", T_OBJECT, + offsetof(PyGpgmeSignature, validity_reason), READONLY}, ++ { "pubkey_algo", T_OBJECT, offsetof(PyGpgmeSignature, pubkey_algo), READONLY}, ++ { "hash_algo", T_OBJECT, offsetof(PyGpgmeSignature, hash_algo), READONLY}, + { NULL, 0, 0, 0} + }; + +@@ -173,6 +177,8 @@ + item->wrong_key_usage = PyBool_FromLong(sig->wrong_key_usage); + item->validity = PyInt_FromLong(sig->validity); + item->validity_reason = pygpgme_error_object(sig->validity_reason); ++ item->pubkey_algo = PyInt_FromLong(sig->pubkey_algo); ++ item->hash_algo = PyInt_FromLong(sig->hash_algo); + if (PyErr_Occurred()) { + Py_DECREF(item); + Py_DECREF(list); + +=== modified file 'src/pygpgme.h' +--- src/pygpgme.h 2013-02-13 02:18:22 +0000 ++++ src/pygpgme.h 2013-05-14 09:32:17 +0000 +@@ -90,6 +90,8 @@ + PyObject *wrong_key_usage; + PyObject *validity; + PyObject *validity_reason; ++ PyObject *pubkey_algo; ++ PyObject *hash_algo; + } PyGpgmeSignature; + + typedef struct { + +=== modified file 'tests/test_sign_verify.py' +--- tests/test_sign_verify.py 2012-02-29 03:11:10 +0000 ++++ tests/test_sign_verify.py 2013-05-14 10:49:01 +0000 +@@ -57,6 +57,8 @@ + self.assertEqual(sigs[0].wrong_key_usage, False) + self.assertEqual(sigs[0].validity, gpgme.VALIDITY_UNKNOWN) + self.assertEqual(sigs[0].validity_reason, None) ++ self.assertEqual(sigs[0].pubkey_algo, gpgme.PK_DSA) ++ self.assertEqual(sigs[0].hash_algo, gpgme.MD_SHA1) + + def test_verify_detached(self): + signature = BytesIO(dedent(''' +@@ -83,6 +85,8 @@ + self.assertEqual(sigs[0].wrong_key_usage, False) + self.assertEqual(sigs[0].validity, gpgme.VALIDITY_UNKNOWN) + self.assertEqual(sigs[0].validity_reason, None) ++ self.assertEqual(sigs[0].pubkey_algo, gpgme.PK_DSA) ++ self.assertEqual(sigs[0].hash_algo, gpgme.MD_SHA1) + + def test_verify_clearsign(self): + signature = BytesIO(dedent(''' +@@ -114,6 +118,8 @@ + self.assertEqual(sigs[0].wrong_key_usage, False) + self.assertEqual(sigs[0].validity, gpgme.VALIDITY_UNKNOWN) + self.assertEqual(sigs[0].validity_reason, None) ++ self.assertEqual(sigs[0].pubkey_algo, gpgme.PK_DSA) ++ self.assertEqual(sigs[0].hash_algo, gpgme.MD_SHA1) + + def test_verify_multiple_sigs(self): + signature = BytesIO(dedent(''' +@@ -156,6 +162,8 @@ + self.assertEqual(sigs[0].wrong_key_usage, False) + self.assertEqual(sigs[0].validity, gpgme.VALIDITY_UNKNOWN) + self.assertEqual(sigs[0].validity_reason, None) ++ self.assertEqual(sigs[0].pubkey_algo, gpgme.PK_DSA) ++ self.assertEqual(sigs[0].hash_algo, gpgme.MD_SHA1) + + self.assertEqual(sigs[1].summary, 0) + self.assertEqual(sigs[1].fpr, +@@ -167,6 +175,8 @@ + self.assertEqual(sigs[1].wrong_key_usage, False) + self.assertEqual(sigs[1].validity, gpgme.VALIDITY_UNKNOWN) + self.assertEqual(sigs[1].validity_reason, None) ++ self.assertEqual(sigs[1].pubkey_algo, gpgme.PK_RSA) ++ self.assertEqual(sigs[1].hash_algo, gpgme.MD_SHA1) + + def test_verify_no_signature(self): + signature = BytesIO(dedent(''' + diff --git a/pygpgme.spec b/pygpgme.spec index c06fa3a..d394f75 100644 --- a/pygpgme.spec +++ b/pygpgme.spec @@ -7,7 +7,7 @@ Name: pygpgme Version: 0.3 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Python module for working with OpenPGP messages Group: Development/Languages @@ -24,6 +24,14 @@ URL: http://cheeseshop.python.org/pypi/pygpgme # tarball is in dist/pygpgme-0.1.tar.gz #Source0: pygpgme-0.1.tar.gz Source0: http://cheeseshop.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz +# 2013-08-22: Upstreamed 2013-05-14, upstream unresponsive: +# https://bugs.launchpad.net/pygpgme/+bug/1002421 +# https://bugs.launchpad.net/pygpgme/+bug/1002421/+attachment/3676331/+files/gpgme-pubkey-hash-algo.patch +Patch0: pygpgme-pubkey-hash-algo.patch +# 2013-08-22: Upstreamed 2013-06-19, upstream unresponsive: +# https://bugs.launchpad.net/pygpgme/+bug/1192545 +# https://bugs.launchpad.net/pygpgme/+bug/1192545/+attachment/3707307/+files/pygpgme-no-encrypt-to.patch +Patch1: pygpgme-no-encrypt-to.patch BuildRequires: python2-devel BuildRequires: gpgme-devel @@ -52,6 +60,8 @@ the GPGME library. This package installs the module for use with python3. %prep %setup -q +%patch0 -p0 -b .pubkey-hash-algo +%patch1 -p0 -b .no-encrypt-to %if 0%{?with_python3} rm -rf %{py3dir} @@ -106,6 +116,9 @@ find tests -name '*.pyc' -delete %endif # with_python3 %changelog +* Thu Aug 22 2013 Till Maas - 0.3-8 +- Add patches for ENCRYPT_NO_ENCRYPT_TO, pubkey_algo and hash_algo (#975815) + * Sun Aug 04 2013 Fedora Release Engineering - 0.3-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild