diff options
author | Werner Koch <wk@gnupg.org> | 2012-12-28 17:17:56 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2012-12-28 17:17:56 +0100 |
commit | 79f08fb0699f4a065e3a29bc7676a90534d7ba60 (patch) | |
tree | fe8c45dea8b808e0add2118b2d672439534d337a /kbx/keybox.h | |
parent | kbxutil: Improve format of the Sig-Expire lines. (diff) | |
download | gnupg2-79f08fb0699f4a065e3a29bc7676a90534d7ba60.tar.xz gnupg2-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.h')
-rw-r--r-- | kbx/keybox.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kbx/keybox.h b/kbx/keybox.h index 15f05ed81..03a9245a3 100644 --- a/kbx/keybox.h +++ b/kbx/keybox.h @@ -54,7 +54,8 @@ typedef enum KEYBOX_FLAG_UID, /* The user ID flags; requires an uid index. */ KEYBOX_FLAG_UID_VALIDITY,/* The validity of a specific uid, requires an uid index. */ - KEYBOX_FLAG_CREATED_AT /* The date the block was created. */ + KEYBOX_FLAG_CREATED_AT, /* The date the block was created. */ + KEYBOX_FLAG_SIG_INFO, /* The signature info block. */ } keybox_flag_t; /* Flag values used with KEYBOX_FLAG_BLOB. */ @@ -80,7 +81,8 @@ int keybox_lock (KEYBOX_HANDLE hd, int yes); int _keybox_write_header_blob (FILE *fp); /*-- keybox-search.c --*/ -gpg_error_t keybox_get_keyblock (KEYBOX_HANDLE hd, iobuf_t *r_iobuf); +gpg_error_t keybox_get_keyblock (KEYBOX_HANDLE hd, + iobuf_t *r_iobuf, u32 **sigstatus); #ifdef KEYBOX_WITH_X509 int keybox_get_cert (KEYBOX_HANDLE hd, ksba_cert_t *ret_cert); #endif /*KEYBOX_WITH_X509*/ @@ -92,7 +94,8 @@ int keybox_search (KEYBOX_HANDLE hd, KEYBOX_SEARCH_DESC *desc, size_t ndesc); /*-- keybox-update.c --*/ gpg_error_t keybox_insert_keyblock (KEYBOX_HANDLE hd, - const void *image, size_t imagelen); + const void *image, size_t imagelen, + u32 *sigstatus); gpg_error_t keybox_update_keyblock (KEYBOX_HANDLE hd, const void *image, size_t imagelen); |