mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
g10: Eliminate the redundant function get_pubkey_end.
* g10/keydb.h (get_pubkey_end): Remove declaration. Replace use of function with getkey_end. * g10/getkey.c (get_pubkey_byname): Remove function. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>.
This commit is contained in:
parent
be6743b2e1
commit
65e58ae674
31
g10/getkey.c
31
g10/getkey.c
@ -400,7 +400,7 @@ get_pubkey (PKT_public_key * pk, u32 * keyid)
|
||||
{
|
||||
pk_from_block (&ctx, pk, kb, found_key);
|
||||
}
|
||||
get_pubkey_end (&ctx);
|
||||
getkey_end (&ctx);
|
||||
release_kbnode (kb);
|
||||
}
|
||||
if (!rc)
|
||||
@ -497,7 +497,7 @@ get_pubkeyblock (u32 * keyid)
|
||||
ctx.items[0].u.kid[0] = keyid[0];
|
||||
ctx.items[0].u.kid[1] = keyid[1];
|
||||
rc = lookup (&ctx, &keyblock, NULL, 0);
|
||||
get_pubkey_end (&ctx);
|
||||
getkey_end (&ctx);
|
||||
|
||||
return rc ? NULL : keyblock;
|
||||
}
|
||||
@ -532,7 +532,7 @@ get_seckey (PKT_public_key *pk, u32 *keyid)
|
||||
{
|
||||
pk_from_block (&ctx, pk, keyblock, found_key);
|
||||
}
|
||||
get_pubkey_end (&ctx);
|
||||
getkey_end (&ctx);
|
||||
release_kbnode (keyblock);
|
||||
|
||||
if (!err)
|
||||
@ -694,7 +694,7 @@ key_byname (GETKEY_CTX *retctx, strlist_t namelist,
|
||||
*ret_kdbhd = ctx->kr_handle;
|
||||
ctx->kr_handle = NULL;
|
||||
}
|
||||
get_pubkey_end (ctx);
|
||||
getkey_end (ctx);
|
||||
}
|
||||
|
||||
return rc;
|
||||
@ -792,7 +792,7 @@ get_pubkey_byname (ctrl_t ctrl, GETKEY_CTX * retctx, PKT_public_key * pk,
|
||||
did_key_byname = 1;
|
||||
if (retctx)
|
||||
{
|
||||
get_pubkey_end (*retctx);
|
||||
getkey_end (*retctx);
|
||||
*retctx = NULL;
|
||||
}
|
||||
add_to_strlist (&namelist, name);
|
||||
@ -892,7 +892,7 @@ get_pubkey_byname (ctrl_t ctrl, GETKEY_CTX * retctx, PKT_public_key * pk,
|
||||
{
|
||||
if (retctx)
|
||||
{
|
||||
get_pubkey_end (*retctx);
|
||||
getkey_end (*retctx);
|
||||
*retctx = NULL;
|
||||
}
|
||||
rc = key_byname (anylocalfirst ? retctx : NULL,
|
||||
@ -917,7 +917,7 @@ get_pubkey_byname (ctrl_t ctrl, GETKEY_CTX * retctx, PKT_public_key * pk,
|
||||
|
||||
if (rc && retctx)
|
||||
{
|
||||
get_pubkey_end (*retctx);
|
||||
getkey_end (*retctx);
|
||||
*retctx = NULL;
|
||||
}
|
||||
|
||||
@ -926,13 +926,6 @@ get_pubkey_byname (ctrl_t ctrl, GETKEY_CTX * retctx, PKT_public_key * pk,
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
get_pubkey_end (GETKEY_CTX ctx)
|
||||
{
|
||||
getkey_end (ctx);
|
||||
}
|
||||
|
||||
|
||||
/* 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
|
||||
@ -956,7 +949,7 @@ get_pubkey_byfpr (PKT_public_key *pk, const byte *fpr)
|
||||
if (!err && pk)
|
||||
pk_from_block (&ctx, pk, kb, found_key);
|
||||
release_kbnode (kb);
|
||||
get_pubkey_end (&ctx);
|
||||
getkey_end (&ctx);
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -1007,7 +1000,7 @@ get_pubkey_byfprint (PKT_public_key *pk, kbnode_t *r_keyblock,
|
||||
}
|
||||
}
|
||||
release_kbnode (kb);
|
||||
get_pubkey_end (&ctx);
|
||||
getkey_end (&ctx);
|
||||
}
|
||||
else
|
||||
rc = GPG_ERR_GENERAL; /* Oops */
|
||||
@ -1084,7 +1077,7 @@ get_keyblock_byfprint (KBNODE * ret_keyblock, const byte * fprint,
|
||||
: KEYDB_SEARCH_MODE_FPR20);
|
||||
memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
|
||||
rc = lookup (&ctx, ret_keyblock, NULL, 0);
|
||||
get_pubkey_end (&ctx);
|
||||
getkey_end (&ctx);
|
||||
}
|
||||
else
|
||||
rc = GPG_ERR_GENERAL; /* Oops */
|
||||
@ -1149,7 +1142,7 @@ get_seckey_byfprint (PKT_public_key *pk, const byte * fprint, size_t fprint_len)
|
||||
if (!err && pk)
|
||||
pk_from_block (&ctx, pk, kb, found_key);
|
||||
release_kbnode (kb);
|
||||
get_pubkey_end (&ctx);
|
||||
getkey_end (&ctx);
|
||||
}
|
||||
else
|
||||
err = gpg_error (GPG_ERR_BUG);
|
||||
@ -1178,7 +1171,7 @@ get_seckeyblock_byfprint (kbnode_t *ret_keyblock,
|
||||
? KEYDB_SEARCH_MODE_FPR16 : KEYDB_SEARCH_MODE_FPR20);
|
||||
memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
|
||||
err = lookup (&ctx, ret_keyblock, NULL, 1);
|
||||
get_pubkey_end (&ctx);
|
||||
getkey_end (&ctx);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -407,7 +407,6 @@ int get_pubkey_byname (ctrl_t ctrl,
|
||||
GETKEY_CTX *rx, PKT_public_key *pk, const char *name,
|
||||
KBNODE *ret_keyblock, KEYDB_HANDLE *ret_kdbhd,
|
||||
int include_unusable, int no_akl );
|
||||
void get_pubkey_end( GETKEY_CTX ctx );
|
||||
gpg_error_t get_seckey (PKT_public_key *pk, u32 *keyid);
|
||||
int get_pubkey_byfprint (PKT_public_key *pk, kbnode_t *r_keyblock,
|
||||
const byte *fprint, size_t fprint_len);
|
||||
|
@ -579,7 +579,7 @@ list_one (strlist_t names, int secret, int mark_secret)
|
||||
if (rc)
|
||||
{
|
||||
log_error ("error reading key: %s\n", gpg_strerror (rc));
|
||||
get_pubkey_end (ctx);
|
||||
getkey_end (ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -638,7 +638,7 @@ locate_one (ctrl_t ctrl, strlist_t names)
|
||||
release_kbnode (keyblock);
|
||||
}
|
||||
while (ctx && !getkey_next (ctx, NULL, &keyblock));
|
||||
get_pubkey_end (ctx);
|
||||
getkey_end (ctx);
|
||||
ctx = NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user