mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
* findkey.c (unprotect): Show an error message for a bad passphrase.
This commit is contained in:
parent
5dac4711f9
commit
2585114325
@ -1,5 +1,7 @@
|
||||
2002-02-18 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* findkey.c (unprotect): Show an error message for a bad passphrase.
|
||||
|
||||
* command.c (cmd_marktrusted): Implemented.
|
||||
* trustlist.c (agent_marktrusted): New.
|
||||
(open_list): Add APPEND arg.
|
||||
|
@ -39,6 +39,7 @@ unprotect (unsigned char **keybuf, const unsigned char *grip)
|
||||
size_t resultlen;
|
||||
int tries = 0;
|
||||
char hexgrip[40+1];
|
||||
const char *errtext;
|
||||
|
||||
for (i=0; i < 20; i++)
|
||||
sprintf (hexgrip+2*i, "%02X", grip[i]);
|
||||
@ -67,9 +68,10 @@ unprotect (unsigned char **keybuf, const unsigned char *grip)
|
||||
pi->max_digits = 8;
|
||||
pi->max_tries = 3;
|
||||
|
||||
errtext = NULL;
|
||||
do
|
||||
{
|
||||
rc = agent_askpin (NULL, NULL, pi);
|
||||
rc = agent_askpin (NULL, errtext, pi);
|
||||
if (!rc)
|
||||
{
|
||||
rc = agent_unprotect (*keybuf, pi->pin, &result, &resultlen);
|
||||
@ -82,6 +84,7 @@ unprotect (unsigned char **keybuf, const unsigned char *grip)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
errtext = pi->min_digits? trans ("Bad PIN") : trans ("Bad Passphrase");
|
||||
}
|
||||
while ((rc == GNUPG_Bad_Passphrase || rc == GNUPG_Bad_PIN)
|
||||
&& tries++ < 3);
|
||||
|
Loading…
x
Reference in New Issue
Block a user