1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

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
This commit is contained in:
Werner Koch 2022-08-11 10:56:40 +02:00
parent 40f0fcfaa4
commit 989eae648c
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
2 changed files with 73 additions and 17 deletions

View file

@ -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;