Accepting request 799240 from home:pmonrealgonzalez:branches:Base:System

- Fix build: [bsc#1170811]
  * Test t-json fails since the gpg-2.2.20 update
- Add patches:
  * gpgme-t-json-test-Bravo-key-no-secret-key-material.patch
  * gpgme-t-json-test-with-keygrip-when-listing-keys.patch

OBS-URL: https://build.opensuse.org/request/show/799240
OBS-URL: https://build.opensuse.org/package/show/Base:System/gpgme?expand=0&rev=113
This commit is contained in:
Pedro Monreal Gonzalez 2020-04-30 15:13:28 +00:00 committed by Git OBS Bridge
parent f35e64e0ca
commit 19c982d5db
4 changed files with 91 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Thu, 23 Jan 2020 16:43:13 -0500
Subject: tests/json: Bravo key does not have secret key material
* tests/json/t-keylist-secret.out.json: indicate correctly that the
"Bravo" test key does not have secret key material.
--
Some older versions of GnuPG are buggy, and will claim "secret: true"
for this key, even though the keyring in question has no secret key
material for it.
The underlying call to gpg looks something like:
gpg --with-colons --with-secret --list-keys -- \
alpha@example.net bravo@example.net
You can see the change in field 15 of the "pub" and "sub" output.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
tests/json/t-keylist-secret.out.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/json/t-keylist-secret.out.json b/tests/json/t-keylist-secret.out.json
index 5da20db..109eae3 100644
--- a/tests/json/t-keylist-secret.out.json
+++ b/tests/json/t-keylist-secret.out.json
@@ -91,7 +91,7 @@
"can_sign": true,
"can_certify": true,
"can_authenticate": true,
- "secret": true,
+ "secret": false,
"is_qualified": false,
"protocol": "OpenPGP",
"fingerprint": "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2",

View File

@ -0,0 +1,39 @@
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Thu, 23 Jan 2020 17:04:43 -0500
Subject: gpg: Send --with-keygrip when listing keys
* src/engine-gpg.c (gpg_keylist_build_options): Always pass
--with-keygrip when listing keys.
--
Some older versions of GnuPG (at least gpg in version
2.2.12-1+deb10u1) appear to unilaterally emit the keygrip, and it's
certainly useful to know that programmatically it will always be
present in the output needed.
However, as of GnuPG 2.2.19-1, the following command does not emit the
keygrip for non-secret keys:
gpg --with-colons --with-secret --list-keys
This change fixes tests/json/t-json by making the output comply with
tests/json/t-keylist-secret.out.json correctly.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
src/engine-gpg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index 4f4a06a..fc52a5d 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -2922,6 +2922,7 @@ gpg_keylist_build_options (engine_gpg_t gpg, int secret_only,
gpg_error_t err;
err = add_arg (gpg, "--with-colons");
+ err = add_arg (gpg, "--with-keygrip");
/* Since gpg 2.1.15 fingerprints are always printed, thus there is
* no more need to explicitly request them. */

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Apr 29 11:09:33 UTC 2020 - Pedro Monreal Gonzalez <pmonrealgonzalez@suse.com>
- Fix build: [bsc#1170811]
* Test t-json fails since the gpg-2.2.20 update
- Add patches:
* gpgme-t-json-test-Bravo-key-no-secret-key-material.patch
* gpgme-t-json-test-with-keygrip-when-listing-keys.patch
-------------------------------------------------------------------
Wed Oct 16 20:34:54 UTC 2019 - Michael Gorse <mgorse@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package gpgme
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -41,6 +41,8 @@ Source2: baselibs.conf
Source3: gpgme.keyring
# used to have a fixed timestamp
Source99: gpgme.changes
Patch1: gpgme-t-json-test-Bravo-key-no-secret-key-material.patch
Patch2: gpgme-t-json-test-with-keygrip-when-listing-keys.patch
BuildRequires: gcc-c++
BuildRequires: gpg2 >= 2.0.10
BuildRequires: libassuan-devel >= 2.4.2
@ -183,6 +185,8 @@ This package contains the bindings to use the library in Qt C++ applications.
%prep
%setup -q -n gpgme-%{version}
%patch1 -p1
%patch2 -p1
%ifarch %{ix86}
sed -i -e '/t-callbacks.py/d' lang/python/tests/Makefile.{am,in}