aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-09-14 13:43:52 +0000
committerNeal H. Walfield <[email protected]>2015-09-16 13:15:22 +0000
commitb4672e4d48fb1e1e4d17551c4c828763d1dfbb57 (patch)
treefab6baf85cd3a01adf2576305c3322ec5f62db73
parentg10: Eliminate the redundant function get_pubkey_end. (diff)
downloadgnupg-b4672e4d48fb1e1e4d17551c4c828763d1dfbb57.tar.gz
gnupg-b4672e4d48fb1e1e4d17551c4c828763d1dfbb57.zip
g10: Eliminate the redundant function get_pubkey_byname.
* g10/getkey.c (get_pubkey_byname): Remove function. (lookup): Replace use of get_pubkey_byname by get_pubkey_byfprint. -- Signed-off-by: Neal H. Walfield <[email protected]>.
-rw-r--r--g10/getkey.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 626c7a7ff..4cad1a48b 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -926,35 +926,6 @@ get_pubkey_byname (ctrl_t ctrl, GETKEY_CTX * retctx, PKT_public_key * pk,
}
-/* Search for a key with the given standard fingerprint. In contrast
- * to get_pubkey_byfprint we assume a right padded fingerprint of the
- * standard length. PK may be NULL to only put the result into the
- * internal caches. */
-gpg_error_t
-get_pubkey_byfpr (PKT_public_key *pk, const byte *fpr)
-{
- gpg_error_t err;
- struct getkey_ctx_s ctx;
- kbnode_t kb = NULL;
- kbnode_t found_key = NULL;
-
- memset (&ctx, 0, sizeof ctx);
- ctx.exact = 1;
- ctx.not_allocated = 1;
- ctx.kr_handle = keydb_new ();
- ctx.nitems = 1;
- ctx.items[0].mode = KEYDB_SEARCH_MODE_FPR;
- memcpy (ctx.items[0].u.fpr, fpr, MAX_FINGERPRINT_LEN);
- err = lookup (&ctx, &kb, &found_key, 0);
- if (!err && pk)
- pk_from_block (&ctx, pk, kb, found_key);
- release_kbnode (kb);
- getkey_end (&ctx);
-
- return err;
-}
-
-
/* Search for a key with the given fingerprint. The caller need to
* prove an allocated public key object at PK. If R_KEYBLOCK is not
* NULL the entire keyblock is stored there and the caller needs to
@@ -2897,7 +2868,8 @@ get_user_id_byfpr (const byte *fpr, size_t *rn)
}
}
}
- while (++pass < 2 && !get_pubkey_byfpr (NULL, fpr));
+ while (++pass < 2
+ && !get_pubkey_byfprint (NULL, NULL, fpr, MAX_FINGERPRINT_LEN));
p = xstrdup (user_id_not_found_utf8 ());
*rn = strlen (p);
return p;