[Pkg-gnupg-commit] [gnupg2] 03/05: skip over missing signing keys (Closes: #834922)

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Apr 26 07:11:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gnupg2.

commit b6fedaf0f0b1718f12428140f1d85cd2b03d5e4a
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Wed Apr 26 01:47:48 2017 -0400

    skip over missing signing keys (Closes: #834922)
---
 debian/patches/series                              |  1 +
 ...gning-keys-where-no-secret-key-is-availab.patch | 51 ++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 5082707..85a7f5e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -73,3 +73,4 @@ gpg-agent-idling/0004-agent-Avoid-scheduled-checks-on-socket-when-inotify-.patch
 0073-dirmngr-Fix-final-close-of-LISTEN_FD.patch
 0074-g10-invalidate-the-fd-cache-for-keyring.patch
 0075-dirmngr-Fix-aliasing-problem-in-dns.c.patch
+skip-missing-signing-keys/0076-g10-Skip-signing-keys-where-no-secret-key-is-availab.patch
diff --git a/debian/patches/skip-missing-signing-keys/0076-g10-Skip-signing-keys-where-no-secret-key-is-availab.patch b/debian/patches/skip-missing-signing-keys/0076-g10-Skip-signing-keys-where-no-secret-key-is-availab.patch
new file mode 100644
index 0000000..628565d
--- /dev/null
+++ b/debian/patches/skip-missing-signing-keys/0076-g10-Skip-signing-keys-where-no-secret-key-is-availab.patch
@@ -0,0 +1,51 @@
+From: Simon Arlott <simon at arlott.org>
+Date: Sun, 5 Feb 2017 16:31:35 -0500
+Subject: g10: Skip signing keys where no secret key is available.
+
+* g10/getkey.c (finish_lookup): When requiring PUBKEY_USAGE_SIG, skip
+over keys where no signing key is available.
+
+--
+
+This should only be relevant when gpg is required to choose which key
+to sign with -- if verifying signatures, we already know which subkey
+to look at, and indeed gpg doesn't seem to have a problem with this.
+
+This patch comes from
+https://bugs.gnupg.org/gnupg/file793/sign-fix.patch
+
+I (dkg) have reviewed and tested it with missing local keys, and it
+makes sense to me as the default behavior.  If the user has the secret
+key for a signing-capable subkey available and the command is --sign,
+it should be used.
+
+If the user has explicitly specified a subkey that happens to be
+missing (e.g. with the trailing ! for --default-key 0x${FPR}!) then
+this does not override that behavior (the signature will still fail).
+
+GnuPG-bug-id: 1967
+Debian-bug-id: 834922
+
+Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
+---
+ g10/getkey.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/g10/getkey.c b/g10/getkey.c
+index 961d7de..bb31dfb 100644
+--- a/g10/getkey.c
++++ b/g10/getkey.c
+@@ -3529,6 +3529,13 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
+ 	      continue;
+ 	    }
+ 
++	  if ((req_usage & PUBKEY_USAGE_SIG) && agent_probe_secret_key (NULL, pk))
++	    {
++	      if (DBG_LOOKUP)
++		log_debug ("\tno secret key for signing\n");
++	      continue;
++	    }
++
+ 	  if (DBG_LOOKUP)
+ 	    log_debug ("\tsubkey might be fine\n");
+ 	  /* In case a key has a timestamp of 0 set, we make sure

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list