1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

gpg: Minor cleanup for key listing related code.

* g10/getkey.c (get_pubkey_next): Divert to getkey_next.
(get_pubkey_end): Move code to getkey_end.
* g10/keydb.c (keydb_search_reset): Add a debug statement.
(dump_search_desc): Add arg HD and print the handle.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2014-11-02 16:31:30 +01:00
parent a929f36693
commit 440e8f5170
2 changed files with 19 additions and 21 deletions

View file

@ -928,26 +928,13 @@ get_pubkey_bynames (GETKEY_CTX * retctx, PKT_public_key * pk,
int
get_pubkey_next (GETKEY_CTX ctx, PKT_public_key * pk, KBNODE * ret_keyblock)
{
int rc;
rc = lookup (ctx, ret_keyblock, 0);
if (!rc && pk && ret_keyblock)
pk_from_block (ctx, pk, *ret_keyblock);
return rc;
return gpg_err_code (getkey_next (ctx, pk, ret_keyblock));
}
void
get_pubkey_end (GETKEY_CTX ctx)
{
if (ctx)
{
memset (&ctx->kbpos, 0, sizeof ctx->kbpos);
keydb_release (ctx->kr_handle);
free_strlist (ctx->extra_list);
if (!ctx->not_allocated)
xfree (ctx);
}
getkey_end (ctx);
}
@ -1257,7 +1244,14 @@ getkey_next (getkey_ctx_t ctx, PKT_public_key *pk, kbnode_t *ret_keyblock)
void
getkey_end (getkey_ctx_t ctx)
{
get_pubkey_end (ctx);
if (ctx)
{
memset (&ctx->kbpos, 0, sizeof ctx->kbpos);
keydb_release (ctx->kr_handle);
free_strlist (ctx->extra_list);
if (!ctx->not_allocated)
xfree (ctx);
}
}