chiark / gitweb /
g10: Skip signing keys where no secret key is available.
authorSimon Arlott <simon@arlott.org>
Sun, 5 Feb 2017 21:31:35 +0000 (16:31 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 18 Sep 2017 20:41:12 +0000 (21:41 +0100)
commit7e6baac4abec207ae0995a39febb962cb757d468
tree94fa44d4ca7d263e9fb9b54472184cce2e49dda1
parente4a1cc4aef20d867597248b91091481b72fa5ef6
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@fifthhorseman.net>
Gbp-Pq: Topic skip-missing-signing-keys
Gbp-Pq: Name 0076-g10-Skip-signing-keys-where-no-secret-key-is-availab.patch
g10/getkey.c