Skip to content

Commit a17d2d1

Browse files
author
NIIBE Yutaka
committed
g10: Fix filtering by PK->REQ_USAGE.
* g10/getkey.c (get_pubkey_byfprint): Filter by PK->REQ_USAGE. -- GnuPG-bug-id: 3844 Signed-off-by: NIIBE Yutaka <[email protected]>
1 parent 6705ee4 commit a17d2d1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

g10/getkey.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,6 +1810,8 @@ get_pubkey_byfprint (ctrl_t ctrl, PKT_public_key *pk, kbnode_t *r_keyblock,
18101810
ctx.items[0].mode = fprint_len == 16 ? KEYDB_SEARCH_MODE_FPR16
18111811
: KEYDB_SEARCH_MODE_FPR20;
18121812
memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
1813+
if (pk)
1814+
ctx.req_usage = pk->req_usage;
18131815
rc = lookup (ctrl, &ctx, 0, &kb, &found_key);
18141816
if (!rc && pk)
18151817
pk_from_block (pk, kb, found_key);

0 commit comments

Comments
 (0)