aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Kibbey <[email protected]>2011-02-27 13:35:16 +0000
committerWerner Koch <[email protected]>2011-03-02 08:08:00 +0000
commit0706511b6d10561e97381554e404a960538ee342 (patch)
treef5016fe66c76fb639c01492f696b298de4dc9b23
parentFix doc/Makefile target online (diff)
downloadgnupg-0706511b6d10561e97381554e404a960538ee342.tar.gz
gnupg-0706511b6d10561e97381554e404a960538ee342.zip
Added CLEAR_PASSPHRASE option --agent to search the cache for a cacheid with a mode of CACHE_MODE_NORMAL. These cache modes are created with PKDECRYPT.
Diffstat (limited to '')
-rw-r--r--agent/command.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/agent/command.c b/agent/command.c
index 330c85182..63f59d408 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1267,15 +1267,21 @@ cmd_get_passphrase (assuan_context_t ctx, char *line)
static const char hlp_clear_passphrase[] =
- "CLEAR_PASSPHRASE <cache_id>\n"
+ "CLEAR_PASSPHRASE [--agent] <cache_id>\n"
"\n"
"may be used to invalidate the cache entry for a passphrase. The\n"
- "function returns with OK even when there is no cached passphrase.";
+ "function returns with OK even when there is no cached passphrase.\n"
+ "The --agent option is used to clear an entry for a cacheid added by\n"
+ "the agent.\n";
static gpg_error_t
cmd_clear_passphrase (assuan_context_t ctx, char *line)
{
char *cacheid = NULL;
char *p;
+ int opt_agent;
+
+ opt_agent = has_option (line, "--agent");
+ line = skip_options (line);
/* parse the stuff */
for (p=line; *p == ' '; p++)
@@ -1287,7 +1293,8 @@ cmd_clear_passphrase (assuan_context_t ctx, char *line)
if (!cacheid || !*cacheid || strlen (cacheid) > 50)
return set_error (GPG_ERR_ASS_PARAMETER, "invalid length of cacheID");
- agent_put_cache (cacheid, CACHE_MODE_USER, NULL, 0);
+ agent_put_cache (cacheid, opt_agent ? CACHE_MODE_NORMAL : CACHE_MODE_USER,
+ NULL, 0);
return 0;
}