From e2b300801ed7143fa924df5442ec2b61079c0bbb Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 14 Sep 2015 21:22:31 +0200 Subject: [PATCH] g10: Remove unused function get_seckey_byfprint. * g10/keydb.h (get_seckey_byfprint): Remove prototype. * g10/getkey.c (get_seckey_byfprint): Remove function. -- Signed-off-by: Neal H. Walfield . --- g10/getkey.c | 36 ------------------------------------ g10/keydb.h | 2 -- 2 files changed, 38 deletions(-) diff --git a/g10/getkey.c b/g10/getkey.c index 70960667b..2f97000ca 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -1048,42 +1048,6 @@ get_seckey_default (PKT_public_key *pk) } - -/* Search for a key with the given fingerprint. - * FIXME: - * We should replace this with the _byname function. This can be done - * by creating a userID conforming to the unified fingerprint style. */ -gpg_error_t -get_seckey_byfprint (PKT_public_key *pk, const byte * fprint, size_t fprint_len) -{ - gpg_error_t err; - - if (fprint_len == 20 || fprint_len == 16) - { - 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 = fprint_len == 16 ? KEYDB_SEARCH_MODE_FPR16 - : KEYDB_SEARCH_MODE_FPR20; - memcpy (ctx.items[0].u.fpr, fprint, fprint_len); - err = lookup (&ctx, &kb, &found_key, 1); - if (!err && pk) - pk_from_block (&ctx, pk, kb, found_key); - release_kbnode (kb); - getkey_end (&ctx); - } - else - err = gpg_error (GPG_ERR_BUG); - return err; -} - - /* Search for a secret key with the given fingerprint and return the complete keyblock which may have more than only this key. Return an error if no corresponding secret key is available. */ diff --git a/g10/keydb.h b/g10/keydb.h index e160a87c8..f103607d8 100644 --- a/g10/keydb.h +++ b/g10/keydb.h @@ -421,8 +421,6 @@ int have_secret_key_with_kid (u32 *keyid); gpg_error_t get_seckey_default (PKT_public_key *pk); -gpg_error_t get_seckey_byfprint (PKT_public_key *pk, - const byte *fprint, size_t fprint_len); gpg_error_t get_seckeyblock_byfprint (kbnode_t *ret_keyblock, const byte *fprint, size_t fprint_len);