summaryrefslogtreecommitdiffstats
path: root/agent/findkey.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2022-08-11 10:56:40 +0200
committerWerner Koch <wk@gnupg.org>2022-08-11 11:25:49 +0200
commit989eae648c8f3d2196517e8fc9cce247b21f9629 (patch)
tree329f83cdbf3ab0d835e59851a2a88d23f274cc85 /agent/findkey.c
parentcommon: New function nvc_get_boolean. (diff)
downloadgnupg2-989eae648c8f3d2196517e8fc9cce247b21f9629.tar.xz
gnupg2-989eae648c8f3d2196517e8fc9cce247b21f9629.zip
agent: New option --need-attr for KEYINFO.
* agent/command.c (do_one_keyinfo): New arg need_Attr. (cmd_keyinfo): New option --need-attr. * agent/findkey.c (public_key_from_file): Use nvc_get_boolean. -- This option makes it easier to list keys suitable only for certain purposes. The second patch makes if compliant to the description in keyformat.txt
Diffstat (limited to 'agent/findkey.c')
-rw-r--r--agent/findkey.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/agent/findkey.c b/agent/findkey.c
index e0db5095c..fe9f79abc 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -1459,16 +1459,12 @@ public_key_from_file (ctrl_t ctrl, const unsigned char *grip,
if (for_ssh)
{
/* Use-for-ssh: yes */
- const char *p;
int is_ssh = 0;
if (keymeta == NULL)
return gpg_error (GPG_ERR_WRONG_KEY_USAGE);
- if ((p = nvc_get_string (keymeta, "Use-for-ssh:"))
- && !strcmp (p, "yes"))
- is_ssh = 1;
-
+ is_ssh = nvc_get_boolean (keymeta, "Use-for-ssh:");
nvc_release (keymeta);
keymeta = NULL;