aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-09-14 18:38:07 +0000
committerNeal H. Walfield <[email protected]>2015-09-16 13:15:22 +0000
commit911fcca36d61afd061e9e6dc0584bb069353db89 (patch)
tree8c5221c7840ad889120b6ff7ff7336b79f9ddeac
parentg10: Eliminate the redundant function get_pubkey_byname. (diff)
downloadgnupg-911fcca36d61afd061e9e6dc0584bb069353db89.tar.gz
gnupg-911fcca36d61afd061e9e6dc0584bb069353db89.zip
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 <[email protected]>. Currently, no caller invokes get_pubkey_byname with PK==NULL and R_KEYBLOCK != NULL. Thus, this change does not change any behavior.
-rw-r--r--g10/getkey.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 4cad1a48b..efa548d7a 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -962,14 +962,12 @@ get_pubkey_byfprint (PKT_public_key *pk, kbnode_t *r_keyblock,
memcpy (ctx.items[0].u.fpr, fprint, fprint_len);
rc = lookup (&ctx, &kb, &found_key, 0);
if (!rc && pk)
- {
- pk_from_block (&ctx, pk, kb, found_key);
- if (r_keyblock)
- {
- *r_keyblock = kb;
- kb = NULL;
- }
- }
+ pk_from_block (&ctx, pk, kb, found_key);
+ if (!rc && r_keyblock)
+ {
+ *r_keyblock = kb;
+ kb = NULL;
+ }
release_kbnode (kb);
getkey_end (&ctx);
}