mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
g10: Simplify semantics of get_pubkey_byname.
* g10/getkey.c (get_pubkey_byname): If R_KEYBLOCK is not NULL, return the keyblock in R_KEYBLOCK independent of whether PK is set or not. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>. Currently, no caller invokes get_pubkey_byname with PK==NULL and R_KEYBLOCK != NULL. Thus, this change does not change any behavior.
This commit is contained in:
parent
b4672e4d48
commit
911fcca36d
@ -962,14 +962,12 @@ get_pubkey_byfprint (PKT_public_key *pk, kbnode_t *r_keyblock,
|
|||||||
memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
|
memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
|
||||||
rc = lookup (&ctx, &kb, &found_key, 0);
|
rc = lookup (&ctx, &kb, &found_key, 0);
|
||||||
if (!rc && pk)
|
if (!rc && pk)
|
||||||
{
|
|
||||||
pk_from_block (&ctx, pk, kb, found_key);
|
pk_from_block (&ctx, pk, kb, found_key);
|
||||||
if (r_keyblock)
|
if (!rc && r_keyblock)
|
||||||
{
|
{
|
||||||
*r_keyblock = kb;
|
*r_keyblock = kb;
|
||||||
kb = NULL;
|
kb = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
release_kbnode (kb);
|
release_kbnode (kb);
|
||||||
getkey_end (&ctx);
|
getkey_end (&ctx);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user