g10: Fix filtering by PK->REQ_USAGE.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 2 Apr 2018 08:41:50 +0000 (17:41 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 2 Apr 2018 08:44:54 +0000 (17:44 +0900)
* g10/getkey.c (get_pubkey_byfprint): Filter by PK->REQ_USAGE.

--

GnuPG-bug-id: 3844
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
g10/getkey.c

index dabd052..0405d1d 100644 (file)
@@ -1810,6 +1810,8 @@ get_pubkey_byfprint (ctrl_t ctrl, PKT_public_key *pk, kbnode_t *r_keyblock,
       ctx.items[0].mode = fprint_len == 16 ? KEYDB_SEARCH_MODE_FPR16
        : KEYDB_SEARCH_MODE_FPR20;
       memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
+      if (pk)
+        ctx.req_usage = pk->req_usage;
       rc = lookup (ctrl, &ctx, 0, &kb, &found_key);
       if (!rc && pk)
        pk_from_block (pk, kb, found_key);