diff options
author | Werner Koch <[email protected]> | 2012-12-28 16:17:56 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2012-12-28 16:17:56 +0000 |
commit | 79f08fb0699f4a065e3a29bc7676a90534d7ba60 (patch) | |
tree | fe8c45dea8b808e0add2118b2d672439534d337a /kbx/keybox-update.c | |
parent | kbxutil: Improve format of the Sig-Expire lines. (diff) | |
download | gnupg-79f08fb0699f4a065e3a29bc7676a90534d7ba60.tar.gz gnupg-79f08fb0699f4a065e3a29bc7676a90534d7ba60.zip |
gpg: Add signature cache support to the keybox.
* g10/keydb.c (parse_keyblock_image): Add arg SIGSTATUS.
(keydb_get_keyblock): Handle it.
(build_keyblock_image): Add arg SIGSTATUS.
(keydb_insert_keyblock): Handle it.
* kbx/keybox-blob.c (pgp_create_sig_part): Add arg SIGSTATUS.
(_keybox_create_openpgp_blob): Ditto.
* kbx/kbxutil.c (import_openpgp): Adjust for above change.
* kbx/keybox.h (KEYBOX_FLAG_SIG_INFO): New.
* kbx/keybox-search.c (_keybox_get_flag_location): Handle new flag.
(keybox_get_keyblock): Add arg R_SIGSTATUS.
* kbx/keybox-update.c (keybox_insert_keyblock): Add arg SIGSTATUS.
--
With this change a key listing using the keybox format is now double
as fast as using a keyring. The memory use dropped as well. Measured
with about 1500 keys.
Diffstat (limited to 'kbx/keybox-update.c')
-rw-r--r-- | kbx/keybox-update.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kbx/keybox-update.c b/kbx/keybox-update.c index a4eedeb6a..6428bb20a 100644 --- a/kbx/keybox-update.c +++ b/kbx/keybox-update.c @@ -371,9 +371,12 @@ blob_filecopy (int mode, const char *fname, KEYBOXBLOB blob, } -/* Insert the OpenPGP keyblock {IMAGE,IMAGELEN} into HD. */ +/* Insert the OpenPGP keyblock {IMAGE,IMAGELEN} into HD. SIGSTATUS is + a vector describing the status of the signatures; its first element + gives the number of following elements. */ gpg_error_t -keybox_insert_keyblock (KEYBOX_HANDLE hd, const void *image, size_t imagelen) +keybox_insert_keyblock (KEYBOX_HANDLE hd, const void *image, size_t imagelen, + u32 *sigstatus) { gpg_error_t err; const char *fname; @@ -400,7 +403,7 @@ keybox_insert_keyblock (KEYBOX_HANDLE hd, const void *image, size_t imagelen) return err; assert (nparsed <= imagelen); err = _keybox_create_openpgp_blob (&blob, &info, image, imagelen, - hd->ephemeral); + sigstatus, hd->ephemeral); _keybox_destroy_openpgp_info (&info); if (!err) { |