aboutsummaryrefslogtreecommitdiffstats
path: root/agent/call-pinentry.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2019-05-28 07:06:32 +0000
committerNIIBE Yutaka <[email protected]>2019-05-28 07:06:32 +0000
commit108c22c9c50a4aa6f5d106d1d830c6d32b0bac7f (patch)
treea59699dbe2a49082ce2643e2cc76c70ace9211ab /agent/call-pinentry.c
parentagent: Remove unused agent_show_message. (diff)
downloadgnupg-gniibe/fix-3465.tar.gz
gnupg-gniibe/fix-3465.zip
g10,agent: Support CONFIRM for --delete-key.gniibe/fix-3465
* agent/call-pinentry.c (agent_get_confirmation): Add call of pinentry_loopback_confirm. (agent_popup_message_start): Likewise. (agent_popup_message_stop): Return if it's loopback mode. * agent/command.c (pinentry_loopback_confirm): New. * g10/call-agent.c (default_inq_cb): Support "CONFIRM" inquery when PINENTRY_MODE_LOOPBACK mode. (confirm_status_cb): New. (agent_delete_key): Supply confirm_status_cb to set the description string for confirmation. -- GnuPG-bug-id: 3465 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to '')
-rw-r--r--agent/call-pinentry.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index 487b21e81..c2105cd6e 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -1391,6 +1391,9 @@ agent_get_confirmation (ctrl_t ctrl,
if (ctrl->pinentry_mode == PINENTRY_MODE_CANCEL)
return gpg_error (GPG_ERR_CANCELED);
+ if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK)
+ return pinentry_loopback_confirm (ctrl, desc, 1, ok, notok);
+
return gpg_error (GPG_ERR_NO_PIN_ENTRY);
}
@@ -1486,7 +1489,15 @@ agent_popup_message_start (ctrl_t ctrl, const char *desc, const char *ok_btn)
int err;
if (ctrl->pinentry_mode != PINENTRY_MODE_ASK)
- return gpg_error (GPG_ERR_CANCELED);
+ {
+ if (ctrl->pinentry_mode == PINENTRY_MODE_CANCEL)
+ return gpg_error (GPG_ERR_CANCELED);
+
+ if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK)
+ return pinentry_loopback_confirm (ctrl, desc, 0, ok_btn, NULL);
+
+ return gpg_error (GPG_ERR_NO_PIN_ENTRY);
+ }
rc = start_pinentry (ctrl);
if (rc)
@@ -1537,6 +1548,9 @@ agent_popup_message_stop (ctrl_t ctrl)
(void)ctrl;
+ if (ctrl->pinentry_mode == PINENTRY_MODE_LOOPBACK)
+ return;
+
if (!popup_tid || !entry_ctx)
{
log_debug ("agent_popup_message_stop called with no active popup\n");