summaryrefslogtreecommitdiffstats
path: root/g10/keydb.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2017-10-18 17:52:41 +0200
committerWerner Koch <wk@gnupg.org>2017-10-18 17:52:41 +0200
commit3bb06531d38b85be295308e826a50a1a7ba935ec (patch)
tree360d1fdf5d0dbe47bed2ddbfcdcb72cb5d34140c /g10/keydb.h
parentgpg: Simplify keydb handling of the main import function. (diff)
downloadgnupg2-3bb06531d38b85be295308e826a50a1a7ba935ec.tar.xz
gnupg2-3bb06531d38b85be295308e826a50a1a7ba935ec.zip
gpg: Improve keydb handling in the main import function.
* g10/getkey.c (get_pubkey_byfprint_fast): Factor most code out to ... (get_keyblock_byfprint_fast): .. new function. * g10/import.c (revocation_present): s/int rc/gpg_error_t err/. (import_one): Use get_keyblock_byfprint_fast to get the keyblock and a handle. Remove the now surplus keyblock fetch in the merge branch. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/keydb.h')
-rw-r--r--g10/keydb.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/g10/keydb.h b/g10/keydb.h
index f503c9990..b173751ca 100644
--- a/g10/keydb.h
+++ b/g10/keydb.h
@@ -339,8 +339,17 @@ int get_pubkey_byfprint (ctrl_t ctrl, PKT_public_key *pk, kbnode_t *r_keyblock,
/* This function is similar to get_pubkey_byfprint, but it doesn't
merge the self-signed data into the public key and subkeys or into
the user ids. */
-int get_pubkey_byfprint_fast (PKT_public_key *pk,
- const byte *fprint, size_t fprint_len);
+gpg_error_t get_pubkey_byfprint_fast (PKT_public_key *pk,
+ const byte *fprint, size_t fprint_len);
+
+/* This function is similar to get_pubkey_byfprint, but it doesn't
+ merge the self-signed data into the public key and subkeys or into
+ the user ids. */
+gpg_error_t get_keyblock_byfprint_fast (kbnode_t *r_keyblock,
+ KEYDB_HANDLE *r_hd,
+ const byte *fprint, size_t fprint_len,
+ int lock);
+
/* Returns true if a secret key is available for the public key with
key id KEYID. */