diff options
author | Werner Koch <[email protected]> | 2015-08-07 10:55:29 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2015-08-07 10:55:29 +0000 |
commit | a68c5c5c7fe4ec8665e252e5062292f6c7b94fdd (patch) | |
tree | d771d9d0fbcecb811d141f533094a4ac9e70f171 /agent/command.c | |
parent | common: Change alias for Curve25519 to "cv25519". (diff) | |
download | gnupg-a68c5c5c7fe4ec8665e252e5062292f6c7b94fdd.tar.gz gnupg-a68c5c5c7fe4ec8665e252e5062292f6c7b94fdd.zip |
agent: Add option --force to the DELETE_KEY command.
* agent/findkey.c (agent_delete_key): Add arg "force".
* agent/command.c (cmd_delete_key): Add option --force.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'agent/command.c')
-rw-r--r-- | agent/command.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/agent/command.c b/agent/command.c index a69abc52e..62a4628cd 100644 --- a/agent/command.c +++ b/agent/command.c @@ -2388,27 +2388,29 @@ cmd_export_key (assuan_context_t ctx, char *line) static const char hlp_delete_key[] = - "DELETE_KEY <hexstring_with_keygrip>\n" + "DELETE_KEY [--force] <hexstring_with_keygrip>\n" "\n" "Delete a secret key from the key store.\n" - "As safeguard the agent asks the user for confirmation.\n"; + "Unless --force is used the agent asks the user for confirmation.\n"; 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; unsigned char grip[20]; if (ctrl->restricted) return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN)); + force = has_option (line, "--force"); line = skip_options (line); err = parse_keygrip (ctx, line, grip); if (err) goto leave; - err = agent_delete_key (ctrl, ctrl->server_local->keydesc, grip); + err = agent_delete_key (ctrl, ctrl->server_local->keydesc, grip, force ); if (err) goto leave; |