diff options
author | Werner Koch <[email protected]> | 2014-10-24 14:20:20 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-10-24 18:40:12 +0000 |
commit | c9aadcb3a248632c07391ff3d829bece9320a901 (patch) | |
tree | 5f59a55e1b7811f6bd3c65e7bfb1193f6266e7cc /agent/command-ssh.c | |
parent | misc: Add logo as used with PayPal. (diff) | |
download | gnupg-c9aadcb3a248632c07391ff3d829bece9320a901.tar.gz gnupg-c9aadcb3a248632c07391ff3d829bece9320a901.zip |
agent: Support pinentries with integrated repeat passphrase feature.
* agent/agent.h (struct pin_entry_info_s): Add fields repeat_okay and
with_repeat.
* agent/call-pinentry.c (close_button_status_cb): Rewrite and check
for PIN_REPEAT. Change users to check only the relevant bit.
(agent_askpin): Support repeat logic of new Pinentries.
* agent/command-ssh.c (ssh_identity_register): Use the new repeat
feature.
* agent/genkey.c (agent_ask_new_passphrase): Ditto.
--
If we need to confirm a passphrase entry (e.g. for new passphrase) we
set a flag into the pinentry info block. The we try to use the new
pinentry command SETREPEATERROR; if that fails, we continue as usual.
If that succeeds we ask the pinentry to show the repeat (confirmation)
prompt and on successful return we set another flag in the pinentry
info block so that the caller can skip its own confirmation check. A
new status line from the pinentry indicates that the feature is
actually supported (it may not be supported on certain systems for
example when using the ncurses backend).
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | agent/command-ssh.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c index 54273239f..f3ef30c15 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -3104,6 +3104,7 @@ ssh_identity_register (ctrl_t ctrl, ssh_key_type_spec_t *spec, pi2 = pi + (sizeof *pi + 100 + 1); pi->max_length = 100; pi->max_tries = 1; + pi->with_repeat = 1; pi2->max_length = 100; pi2->max_tries = 1; pi2->check_cb = reenter_compare_cb; @@ -3115,8 +3116,9 @@ ssh_identity_register (ctrl_t ctrl, ssh_key_type_spec_t *spec, if (err) goto out; - /* Unless the passphrase is empty, ask to confirm it. */ - if (pi->pin && *pi->pin) + /* Unless the passphrase is empty or the pinentry told us that + it already did the repetition check, ask to confirm it. */ + if (pi->pin && *pi->pin && !pi->repeat_okay) { err = agent_askpin (ctrl, description2, NULL, NULL, pi2); if (err == -1) |