Home GnuPG
Diffusion GnuPG 5bcf5f57b863

gpg: Include ADSK keys in a key listing with fingerprints.

Description

gpg: Include ADSK keys in a key listing with fingerprints.

* g10/keydb.h (GET_PUBKEYBLOCK_FLAG_ADSK): Remove.
(GETKEY_ALLOW_ADSK): New.
* g10/getkey.c (get_pubkeyblock_ext): Use the new flag instead.
Change the caller using the old flag.
(key_byname): Support the GETKEY_ALLOW_ADSK flag.
(getkey_bynames): Change to use aan arg flags instead of want_secret.
This allows to pass more flag values.  Adjust callers.
* g10/keylist.c (list_one): Pass GETKEY_ALLOW_ADSK.

Updates-commit: 882ab7fef9bf4440900c32d7463469307224f11a

When using

gpg -k <adsk-subkey-fingerprint>

only the actual ADSK key (the one having the E capability set for the
subkey) was listed. However, when using

gpg -k <adsk-subkey-fingerprint>!

all keys having this subkey (with E or R capability) were listed.
This is suprising and thus needs to be fixed. With this patch the
exact search ('!' suffix) is not anymore required.

This bug was found while fixing the unrelated

Details

Provenance
wernerAuthored on Nov 18 2025, 11:57 AM
Parents
rG4f19587b16b0: gpg: Cleanup of the local function key_byname.
Branches
Unknown
Tags
Unknown
Tasks
T7892: keyboxd: subkey listing issue with ADSKs