From 2e4e10c1dcd8dfeafec51f44ebf26acfeb770c41 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Tue, 15 Dec 2015 12:21:30 +0100 Subject: gpg: Improve the keyblock cache's transparency. * kbx/keybox-search.c (keybox_offset): New function. * g10/keydb.c (struct keyblock_cache): Add fields resource and offset. (keyblock_cache_clear): Reset HD->KEYBLOCK_CACHE.RESOURCE and HD->KEYBLOCK_CACHE.OFFSET. (keydb_search): Don't use the cached result if it comes before the current file position. When caching an entry, also record the position at which it was found. -- Signed-off-by: Neal H. Walfield GnuPG-bug-id: 2187 --- kbx/keybox.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'kbx/keybox.h') diff --git a/kbx/keybox.h b/kbx/keybox.h index 8c3114142..c91a28299 100644 --- a/kbx/keybox.h +++ b/kbx/keybox.h @@ -77,6 +77,8 @@ int keybox_set_ephemeral (KEYBOX_HANDLE hd, int yes); int keybox_lock (KEYBOX_HANDLE hd, int yes); +off_t keybox_offset (KEYBOX_HANDLE hd); + /*-- keybox-file.c --*/ /* Fixme: This function does not belong here: Provide a better interface to create a new keybox file. */ -- cgit v1.2.3