aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keylist.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-05-07 18:19:41 +0000
committerWerner Koch <[email protected]>2008-05-07 18:19:41 +0000
commit99361140a2aa2abb8ccafcfc09b2bc1af5fad878 (patch)
treedd2857bc3ef10f91024ff6a575855512b59396e2 /g10/keylist.c
parentAdd command --locate-key. (diff)
downloadgnupg-99361140a2aa2abb8ccafcfc09b2bc1af5fad878.tar.gz
gnupg-99361140a2aa2abb8ccafcfc09b2bc1af5fad878.zip
--locate-key now returns several keys if they all match.
Diffstat (limited to 'g10/keylist.c')
-rw-r--r--g10/keylist.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/g10/keylist.c b/g10/keylist.c
index a98a4f9f6..0c6e26729 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -537,14 +537,15 @@ locate_one (strlist_t names)
{
int rc = 0;
strlist_t sl;
+ GETKEY_CTX ctx = NULL;
KBNODE keyblock = NULL;
struct sig_stats stats;
- memset(&stats,0,sizeof(stats));
+ memset (&stats,0,sizeof(stats));
for (sl=names; sl; sl = sl->next)
{
- rc = get_pubkey_byname (NULL, sl->d, &keyblock, NULL, 1, 0);
+ rc = get_pubkey_byname (&ctx, NULL, sl->d, &keyblock, NULL, 1, 0);
if (rc)
{
if (gpg_err_code (rc) != GPG_ERR_NO_PUBKEY)
@@ -552,9 +553,15 @@ locate_one (strlist_t names)
}
else
{
- list_keyblock (keyblock, 0, opt.fingerprint,
- opt.check_sigs? &stats : NULL );
- release_kbnode (keyblock);
+ do
+ {
+ list_keyblock (keyblock, 0, opt.fingerprint,
+ opt.check_sigs? &stats : NULL );
+ release_kbnode (keyblock);
+ }
+ while ( ctx && !get_pubkey_next (ctx, NULL, &keyblock));
+ get_pubkey_end (ctx);
+ ctx = NULL;
}
}