diff options
author | Werner Koch <[email protected]> | 2017-03-24 08:02:02 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-03-24 08:02:30 +0000 |
commit | 6fab7bba879d7794e32112cf3eddd8d87130a5d7 (patch) | |
tree | faeff933d8269d0ef5567190a2ef8bc88d9ee785 /agent/command.c | |
parent | common: Implicitly do a gpgconf --create-socketdir. (diff) | |
download | gnupg-6fab7bba879d7794e32112cf3eddd8d87130a5d7.tar.gz gnupg-6fab7bba879d7794e32112cf3eddd8d87130a5d7.zip |
agent: New option --stub-only for DELETE_KEY
* agent/findkey.c (agent_delete_key): Add arg 'only_stubs'.
* agent/command.c (cmd_delete_key): Add option --stub-only.
--
This option can be used to savely remove stub keys.
Diffstat (limited to 'agent/command.c')
-rw-r--r-- | agent/command.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/agent/command.c b/agent/command.c index 79fb0cef2..1f8f7c2d8 100644 --- a/agent/command.c +++ b/agent/command.c @@ -2433,23 +2433,25 @@ cmd_export_key (assuan_context_t ctx, char *line) static const char hlp_delete_key[] = - "DELETE_KEY [--force] <hexstring_with_keygrip>\n" + "DELETE_KEY [--force|--stub-only] <hexstring_with_keygrip>\n" "\n" "Delete a secret key from the key store. If --force is used\n" "and a loopback pinentry is allowed, the agent will not ask\n" - "the user for confirmation."; + "the user for confirmation. If --stub-only is used the key will\n" + "only be deleted if it is a reference to a token."; static gpg_error_t cmd_delete_key (assuan_context_t ctx, char *line) { ctrl_t ctrl = assuan_get_pointer (ctx); gpg_error_t err; - int force; + int force, stub_only; unsigned char grip[20]; if (ctrl->restricted) return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN)); force = has_option (line, "--force"); + stub_only = has_option (line, "--stub-only"); line = skip_options (line); /* If the use of a loopback pinentry has been disabled, we assume @@ -2461,7 +2463,8 @@ cmd_delete_key (assuan_context_t ctx, char *line) if (err) goto leave; - err = agent_delete_key (ctrl, ctrl->server_local->keydesc, grip, force ); + err = agent_delete_key (ctrl, ctrl->server_local->keydesc, grip, + force, stub_only); if (err) goto leave; |