agent: Serialize access to passphrase cache.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 6 Apr 2017 23:39:26 +0000 (08:39 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 6 Apr 2017 23:39:26 +0000 (08:39 +0900)
commitebe12be034f052cdec871f0d8ad1bfab85d7b943
tree32c96215b279237ef43db8e4d481abe1465a8b98
parentf1dc34f502a68673e7a29f3fcf57b8dc6a4fac89
agent: Serialize access to passphrase cache.

* agent/cache.c (encryption_lock): Remove.
(cache_lock): New.  Now, we have coarse grain lock to serialize
entire cache access.
(initialize_module_cache): Use CACHE_LOCK.
(init_encryption, new_data): Remove ENCRYPTION_LOCK.
(agent_flush_cache, agent_put_cache, agent_get_cache): Lock the cache.

--

GnuPG-bug-id: 3027
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
agent/cache.c