gnupg/kbx
Werner Koch 915297705a
kbx: Redefine the UBID which is now the primary fingerprint.
* common/util.h (UBID_LEN): New.  Use it at all places.
* kbx/keybox-blob.c (create_blob_finish): Do not write the UBID item.
* kbx/keybox-dump.c (print_ubib): Remove.
(_keybox_dump_blob): Do not print the now removed ubid flag.
* kbx/keybox-search-desc.h (struct keydb_search_desc): Use constants
for the size of the ubid and grip.
* kbx/keybox-search.c (blob_cmp_ubid): New.
(has_ubid): Make it a simple wrapper around blob_cmp_ubid.
(keybox_get_data): Add arg 'r_ubid'.

* kbx/frontend.h (enum kbxd_store_modes): New.
* kbx/kbxserver.c (cmd_store): Add new option --insert.

* kbx/backend-cache.c (be_cache_initialize): New.
(be_cache_add_resource): Call it here.
* kbx/backend-kbx.c (be_kbx_seek): Remove args 'fpr' and 'fprlen'.
(be_kbx_search): Get the UBID from keybox_get_data.
* kbx/backend-support.c (be_fingerprint_from_blob): Replace by ...
(be_ubid_from_blob): new.  Change all callers.

* kbx/frontend.c (kbxd_add_resource): Temporary disable the cache but
use the new cache init function.
(kbxd_store): Replace arg 'only_update' by 'mode'.  Seek using the
ubid.  Take care of the mode.
--

It turned out that using the hash of the entire blob was not helpful.
Thus we redefine the Unique-Blob-ID (UBID) as the primary fingerprint
of the blob.  In case this is a v5 OpenPGP key a left truncated
version of the SHA-256 hash is used; in all other cases the full SHA-1
hash.  Using a SHA-256 hash does not make sense because v4 keys are
and will for some time be the majority of keys and thus padding them
with zeroes won't make any difference.  Even if fingerprint collisions
can eventually be created we will assume that the keys are bogus and
that it does not make sense to store its twin also in our key storage.
We can also easily extend the update code to detect a collision and
reject the update.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-28 11:16:13 +01:00
..
ChangeLog-2011 Generate the ChangeLog from commit logs. 2011-12-01 11:09:02 +01:00
Makefile.am kbx: Add first version of STORE command to keyboxd. 2019-10-01 20:09:42 +02:00
Manifest The keybox gets now compressed after 3 hours and ephemeral 2004-04-26 08:09:25 +00:00
backend-cache.c kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
backend-kbx.c kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
backend-support.c kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
backend.h kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
frontend.c kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
frontend.h kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
kbxserver.c kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
kbxutil.c gpg: Implement searching keys via keygrip. 2019-01-29 20:10:11 +01:00
keybox-blob.c kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
keybox-defs.h kbx: Add support for 32 byte fingerprints. 2019-03-14 11:26:54 +01:00
keybox-dump.c kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
keybox-errors.c all: fix spelling and typos 2018-10-24 15:56:18 -04:00
keybox-file.c kbx: Allow writing using a estream. 2019-08-06 15:01:21 +02:00
keybox-init.c kbx: Fix deadlock in gpgsm on Windows due to a sharing violation. 2019-05-14 19:05:58 +02:00
keybox-openpgp.c kbx: Add first version of STORE command to keyboxd. 2019-10-01 20:09:42 +02:00
keybox-search-desc.h kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
keybox-search.c kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
keybox-update.c Merge branch 'switch-to-gpgk' into master 2019-09-27 15:44:23 +02:00
keybox-util.c kbx: Simplify by removing custom memory functions. 2017-12-22 12:55:46 +01:00
keybox.h kbx: Redefine the UBID which is now the primary fingerprint. 2019-11-28 11:16:13 +01:00
keyboxd-w32info.rc kbx: Add framework for a public key daemon. 2018-09-05 17:00:17 +02:00
keyboxd.c kbx: Allow fd-passing for the keyboxd. 2019-09-10 15:52:12 +02:00
keyboxd.h kbx: Add framework for the SEARCH command 2019-08-06 16:07:33 +02:00
mkerrors all: fix more spelling errors 2018-10-25 16:53:05 -04:00