From 87d6da1188db3c7df899821e4c0d895c61504522 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 5 May 2025 15:02:52 +0200 Subject: Mark the subkey used to find a key. * src/gpgme.h.in (struct _gpgme_subkey): New flag subkey_match. * src/keylist.c (spacep): New. (op_data_t): Add field requested_subkey. (release_op_data): Free it. (exact_match_pattern): New. (maybe_setup_for_requested_subkey): New. (gpgme_op_keylist_start): Call it here. (gpgme_op_keylist_ext_start): Call it for each pattern until one found. (gpgme_op_keylist_next): Set the subkey_match field. --- This is needed for GnuPG-bug-id: 3325 --- tests/run-keylist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/run-keylist.c b/tests/run-keylist.c index 7bbb9769..44a16596 100644 --- a/tests/run-keylist.c +++ b/tests/run-keylist.c @@ -349,7 +349,8 @@ main (int argc, char **argv) { char *algostr; - printf ("fpr %2d: %s\n", nsub, nonnull (subkey->fpr)); + printf ("fpr %2d: %s%s\n", nsub, nonnull (subkey->fpr), + subkey->subkey_match? " (match)":""); if (subkey->v5fpr) printf ("v5fpr %2d: %s\n", nsub, nonnull (subkey->v5fpr)); if (subkey->keygrip) -- cgit v1.2.3