From 90a4599c5ee0b6f8740d8b537013e68839112217 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 2 Sep 2010 10:46:23 +0000 Subject: Obscure the cached passphrases. --- agent/findkey.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'agent/findkey.c') diff --git a/agent/findkey.c b/agent/findkey.c index 5f98d59d6..02aea24e5 100644 --- a/agent/findkey.c +++ b/agent/findkey.c @@ -291,14 +291,13 @@ unprotect (ctrl_t ctrl, const char *cache_nonce, const char *desc_text, /* Initially try to get it using a cache nonce. */ if (cache_nonce) { - void *cache_marker; - const char *pw; + char *pw; - pw = agent_get_cache (cache_nonce, CACHE_MODE_NONCE, &cache_marker); + pw = agent_get_cache (cache_nonce, CACHE_MODE_NONCE); if (pw) { rc = agent_unprotect (*keybuf, pw, NULL, &result, &resultlen); - agent_unlock_cache_entry (&cache_marker); + xfree (pw); if (!rc) { xfree (*keybuf); @@ -312,15 +311,14 @@ unprotect (ctrl_t ctrl, const char *cache_nonce, const char *desc_text, unprotect it, we fall back to ask the user */ if (cache_mode != CACHE_MODE_IGNORE) { - void *cache_marker; - const char *pw; + char *pw; retry: - pw = agent_get_cache (hexgrip, cache_mode, &cache_marker); + pw = agent_get_cache (hexgrip, cache_mode); if (pw) { rc = agent_unprotect (*keybuf, pw, NULL, &result, &resultlen); - agent_unlock_cache_entry (&cache_marker); + xfree (pw); if (!rc) { xfree (*keybuf); -- cgit v1.2.3