agent: Support pinentries with integrated repeat passphrase feature.
authorWerner Koch <wk@gnupg.org>
Fri, 24 Oct 2014 14:20:20 +0000 (16:20 +0200)
committerWerner Koch <wk@gnupg.org>
Fri, 24 Oct 2014 18:40:12 +0000 (20:40 +0200)
commitc9aadcb3a248632c07391ff3d829bece9320a901
tree5f59a55e1b7811f6bd3c65e7bfb1193f6266e7cc
parent7c2668b70e0eaf3660216855c17290af8ddc04a9
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 <wk@gnupg.org>
agent/agent.h
agent/call-pinentry.c
agent/command-ssh.c
agent/genkey.c