summaryrefslogtreecommitdiffstats
path: root/kbx/kbxserver.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-09-27 09:24:58 +0200
committerWerner Koch <wk@gnupg.org>2019-09-27 09:24:58 +0200
commit280e9c9cfac31ae5ac874c928eee063cc922e27e (patch)
treecd7c774f8fd8b2fa64d162083d755bcc37aaba7a /kbx/kbxserver.c
parentdoc: Minor doc updates and a typo fix. (diff)
downloadgnupg2-280e9c9cfac31ae5ac874c928eee063cc922e27e.tar.xz
gnupg2-280e9c9cfac31ae5ac874c928eee063cc922e27e.zip
kbx: First take on a cache for the keyboxd.
* kbx/backend.h (enum database_types): Add DB_TYPE_CACHE. (struct db_request_part_s): Add seqno fields. (struct db_request_s): Add infos for the cache backend. * kbx/backend-support.c (struct backend_handle_s): Add 'backend_id'. (strdbtype): Support DB_TYPE_CACHE. (be_generic_release_backend): Ditto. (be_find_request_part): New. (be_return_pubkey): New arg UBID and chnage status name. * kbx/backend-cache.c: New. * kbx/backend-kbx.c (be_kbx_init_request_part): New. (be_kbx_search): Factor some code out to a support function. (be_kbx_seek): New. * kbx/frontend.c (kbxd_add_resource): Support DB_TYPE_CACHE. (kbxd_search): Support the NEXR operation with the cache. * kbx/keybox-search-desc.h (KEYDB_SEARCH_MODE_UBID): New. (struct keydb_search_desc): Add field u.ubid. * kbx/keybox-search.c (has_ubid): New. (keybox_search): Support the UBID search. -- This adds a caching backend to the keyboxd. This tries to accommodate for duplicate use of fingerprints and thus be correct in case a fingerprint is used in several keys. It also turned out that we need to have a unique identifier (UBID) to identify a keyblock or X.509 certificate. In particular with an OpenPGP keyblob we can't easily use the primary fingerprint as an identifier because that fingerprint may also be used as subkey in another key. Thus using a hash of the entire keyblock is a better identifier to be used to address a keyblock for restarting a search or for identifying the keyblock to be updated. Note that this new UBID is not a permanent identifier because it changes with all keyblock update; it should be viewed as a handle to the keyblock or X509 cert.
Diffstat (limited to 'kbx/kbxserver.c')
-rw-r--r--kbx/kbxserver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kbx/kbxserver.c b/kbx/kbxserver.c
index c693c7ce2..929ee6116 100644
--- a/kbx/kbxserver.c
+++ b/kbx/kbxserver.c
@@ -236,7 +236,7 @@ kbxd_write_data_line (ctrl_t ctrl, const void *buffer_arg, size_t size)
static gpg_error_t
leave_cmd (assuan_context_t ctx, gpg_error_t err)
{
- if (err)
+ if (err && opt.verbose)
{
const char *name = assuan_get_command_name (ctx);
if (!name)