summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@g10code.com>2015-09-14 20:55:59 +0200
committerNeal H. Walfield <neal@g10code.com>2015-09-16 15:15:23 +0200
commitdc69804ab0576fbc87297215d63b37a680d74d4d (patch)
tree7590f74be73d3d6f6b1ca0bc87478fd954c6f2be
parentg10: Simplify semantics of get_pubkey_byname. (diff)
downloadgnupg2-dc69804ab0576fbc87297215d63b37a680d74d4d.tar.xz
gnupg2-dc69804ab0576fbc87297215d63b37a680d74d4d.zip
g10: Eliminate the redundant function get_keyblock_byfprint.
* g10/keydb.h (get_keyblock_byfprint): Remove prototype. Replace use of this function with get_pubkey_byfprint. * g10/getkey.c (get_pubkey_byname): Remove function. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>.
-rw-r--r--g10/getkey.c30
-rw-r--r--g10/keydb.h2
-rw-r--r--g10/pkclist.c2
3 files changed, 1 insertions, 33 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index efa548d7a..5cb080750 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1025,36 +1025,6 @@ get_pubkey_byfprint_fast (PKT_public_key * pk,
}
-/* Search for a key with the given fingerprint and return the
- * complete keyblock which may have more than only this key. */
-int
-get_keyblock_byfprint (KBNODE * ret_keyblock, const byte * fprint,
- size_t fprint_len)
-{
- int rc;
-
- if (fprint_len == 20 || fprint_len == 16)
- {
- struct getkey_ctx_s ctx;
-
- memset (&ctx, 0, sizeof ctx);
- ctx.not_allocated = 1;
- ctx.kr_handle = keydb_new ();
- ctx.nitems = 1;
- ctx.items[0].mode = (fprint_len == 16
- ? KEYDB_SEARCH_MODE_FPR16
- : KEYDB_SEARCH_MODE_FPR20);
- memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
- rc = lookup (&ctx, ret_keyblock, NULL, 0);
- getkey_end (&ctx);
- }
- else
- rc = GPG_ERR_GENERAL; /* Oops */
-
- return rc;
-}
-
-
/* Get a secret key by NAME and store it into PK. If NAME is NULL use
* the default key. This functions checks that a corresponding secret
* key is available. With no secret key it does not succeeed. */
diff --git a/g10/keydb.h b/g10/keydb.h
index faa0cc975..0bc60bfda 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -412,8 +412,6 @@ int get_pubkey_byfprint (PKT_public_key *pk, kbnode_t *r_keyblock,
const byte *fprint, size_t fprint_len);
int get_pubkey_byfprint_fast (PKT_public_key *pk,
const byte *fprint, size_t fprint_len);
-int get_keyblock_byfprint( KBNODE *ret_keyblock, const byte *fprint,
- size_t fprint_len );
/* Return whether a secret key is available for the public key with
key id KEYID. Note: this is just a fast check and does not tell us
diff --git a/g10/pkclist.c b/g10/pkclist.c
index 41c126e99..68d281284 100644
--- a/g10/pkclist.c
+++ b/g10/pkclist.c
@@ -127,7 +127,7 @@ show_revocation_reason( PKT_public_key *pk, int mode )
/* get the keyblock */
fingerprint_from_pk( pk, fingerprint, &fingerlen );
- rc = get_keyblock_byfprint( &keyblock, fingerprint, fingerlen );
+ rc = get_pubkey_byfprint(NULL, &keyblock, fingerprint, fingerlen);
if( rc ) { /* that should never happen */
log_debug( "failed to get the keyblock\n");
return;