* sm/gpgsm.h (struct server_control_s): Add fields cached_kh and
cached_kh_for_set_cert_flags.
* sm/certchain.c (do_validate_chain): Cache the keydb handle.
* sm/keydb.c (keydb_set_cert_flags): Ditto
(keydb_release): Invalidate the caches.
--
In particular under Windows opening a file may be a expensive
operation if malware^Dantivirus software gets in the way.
Due to changed locking behaviour this patch has a regression risk.