aboutsummaryrefslogtreecommitdiffstats
path: root/sm/gpgsm.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-10-02 14:44:04 +0000
committerWerner Koch <[email protected]>2024-10-04 07:40:04 +0000
commit9087c1d3637cf1c61744ece0002dc0dc5675d7c9 (patch)
tree997388e80391bdc7886c07badb1f59afb4afd953 /sm/gpgsm.c
parentgpgsm: Use a cache for ISTRUSTED queries. (diff)
downloadgnupg-9087c1d3637cf1c61744ece0002dc0dc5675d7c9.tar.gz
gnupg-9087c1d3637cf1c61744ece0002dc0dc5675d7c9.zip
gpgsm: Implement a cache for the KEYINFO queries.
* sm/gpgsm.h (struct keyinfo_cache_item_s): New. (struct server_control_s): Add keyinfo_cache and keyinfo_cache_valid. * sm/call-agent.c (keyinfo_cache_disabled): New flag. (release_a_keyinfo_cache): New. (gpgsm_flush_keyinfo_cache): New. (struct keyinfo_status_parm_s): New. (keyinfo_status_cb): Implement a fill mode. (gpgsm_agent_keyinfo): Implement a cache. * sm/server.c (reset_notify): Flush the cache. * sm/gpgsm.c (gpgsm_deinit_default_ctrl): Ditto. -- In almost all cases we have just a few private keys in the agent and thus it is better to fetch them early. This does not work in a restricted connection but we take care and disable the cache in this case. This cache gives a a minor speed up. GnuPG-bug-id: 7308 (cherry picked from commit 241971fac0fc52efc87ed5753a01d18b0672d900)
Diffstat (limited to 'sm/gpgsm.c')
-rw-r--r--sm/gpgsm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index 91a63bd13..01b3f011f 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -2169,6 +2169,7 @@ gpgsm_deinit_default_ctrl (ctrl_t ctrl)
{
unsigned int n;
+ gpgsm_flush_keyinfo_cache (ctrl);
n = 0;
while (ctrl->parent_cert_cache)
{