mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* command.c (cmd_passwd): Take acount of a key description.
* genkey.c (reenter_compare_cb): Do not set the error text. (agent_protect_and_store, agent_genkey): Force a re-enter after a non-matching passphrase. * query.c (agent_askpin): Add new arg INITIAL_ERRTEXT; changed all callers.
This commit is contained in:
parent
ffd5cd0368
commit
a425334f48
7 changed files with 59 additions and 12 deletions
|
@ -250,7 +250,8 @@ all_digitsp( const char *s)
|
|||
numbers. */
|
||||
int
|
||||
agent_askpin (CTRL ctrl,
|
||||
const char *desc_text, struct pin_entry_info_s *pininfo)
|
||||
const char *desc_text, const char *initial_errtext,
|
||||
struct pin_entry_info_s *pininfo)
|
||||
{
|
||||
int rc;
|
||||
char line[ASSUAN_LINELENGTH];
|
||||
|
@ -289,6 +290,17 @@ agent_askpin (CTRL ctrl,
|
|||
if (rc)
|
||||
return unlock_pinentry (map_assuan_err (rc));
|
||||
|
||||
|
||||
if (initial_errtext)
|
||||
{
|
||||
snprintf (line, DIM(line)-1, "SETERROR %s", initial_errtext);
|
||||
line[DIM(line)-1] = 0;
|
||||
rc = assuan_transact (entry_ctx, line,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
if (rc)
|
||||
return unlock_pinentry (map_assuan_err (rc));
|
||||
}
|
||||
|
||||
for (;pininfo->failed_tries < pininfo->max_tries; pininfo->failed_tries++)
|
||||
{
|
||||
memset (&parm, 0, sizeof parm);
|
||||
|
@ -301,7 +313,8 @@ agent_askpin (CTRL ctrl,
|
|||
snprintf (line, DIM(line)-1, "SETERROR %s (try %d of %d)",
|
||||
errtext, pininfo->failed_tries+1, pininfo->max_tries);
|
||||
line[DIM(line)-1] = 0;
|
||||
rc = assuan_transact (entry_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
rc = assuan_transact (entry_ctx, line,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
if (rc)
|
||||
return unlock_pinentry (map_assuan_err (rc));
|
||||
errtext = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue