aboutsummaryrefslogtreecommitdiffstats
path: root/agent/findkey.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-05-23 09:07:45 +0000
committerWerner Koch <[email protected]>2002-05-23 09:07:45 +0000
commitb209c17be9a42ce25cdaddc1e949577f18f07c6a (patch)
tree4a68db02542584867e1399485ba1bdc52f5f7fbc /agent/findkey.c
parent* assuan-util.c (assuan_set_io_func): New. (diff)
downloadgnupg-b209c17be9a42ce25cdaddc1e949577f18f07c6a.tar.gz
gnupg-b209c17be9a42ce25cdaddc1e949577f18f07c6a.zip
* no-pth.c, Makefile.am: Removed.
* call-scd.c: Seirialized all scdaeom access when using Pth. * cache.c: Made the cache Pth-thread-safe. (agent_unlock_cache_entry): New. * findkey.c (unprotect): Unlock the returned cache value. * command.c (cmd_get_passphrase): Ditto. * gpg-agent.c (main): Register pth_read/write with Assuan.
Diffstat (limited to '')
-rw-r--r--agent/findkey.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/agent/findkey.c b/agent/findkey.c
index 662a56f89..1a222ba77 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -106,10 +106,12 @@ unprotect (unsigned char **keybuf, const unsigned char *grip)
/* first try to get it from the cache - if there is none or we can't
unprotect it, we fall back to ask the user */
{
- const char *pw = agent_get_cache (hexgrip);
+ void *cache_marker;
+ const char *pw = agent_get_cache (hexgrip, &cache_marker);
if (pw)
{
rc = agent_unprotect (*keybuf, pw, &result, &resultlen);
+ agent_unlock_cache_entry (&cache_marker);
if (!rc)
{
xfree (*keybuf);