summaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-01-15 06:27:36 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2020-01-15 06:27:36 +0100
commit9287f9e87b215e79fdb7fb9dfdf2b47666e6ea2f (patch)
tree00a8eaeecadf75e6ab1c9c88887d922362500f41 /g10/getkey.c
parentscd: Make the PIN cache robust against wrongdoing of gpg-agent. (diff)
downloadgnupg2-9287f9e87b215e79fdb7fb9dfdf2b47666e6ea2f.tar.xz
gnupg2-9287f9e87b215e79fdb7fb9dfdf2b47666e6ea2f.zip
gpg: Cert only key should be usable with --default-key.
* g10/getkey.c (parse_def_secret_key): Allow cert-only key. -- GnuPG-bug-id: 4810 Fixes-commit: e573e6188dada4d70f6897aa2fda3c3af8c50441 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/getkey.c')
-rw-r--r--g10/getkey.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index ad5dd8e01..cc908964e 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1860,7 +1860,8 @@ parse_def_secret_key (ctrl_t ctrl)
PKT_public_key *pk = node->pkt->pkt.public_key;
/* Check that the key has the signing capability. */
- if (! (pk->pubkey_usage & PUBKEY_USAGE_SIG))
+ if (! (pk->pubkey_usage & PUBKEY_USAGE_SIG)
+ && ! (pk->pubkey_usage & PUBKEY_USAGE_CERT))
continue;
/* Check if the key is valid. */