aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-02-18 22:39:26 +0000
committerWerner Koch <[email protected]>2002-02-18 22:39:26 +0000
commit2585114325bde29e1ac330ce9d859d502e6d0cfa (patch)
tree610b31739dc3ffd20d3214debd491fc3bb4b1837
parent* certpath.c (gpgsm_validate_path): Ask the agent to add the (diff)
downloadgnupg-2585114325bde29e1ac330ce9d859d502e6d0cfa.tar.gz
gnupg-2585114325bde29e1ac330ce9d859d502e6d0cfa.zip
* findkey.c (unprotect): Show an error message for a bad passphrase.
-rw-r--r--agent/ChangeLog2
-rw-r--r--agent/findkey.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index 9a398f576..0c7930684 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,5 +1,7 @@
2002-02-18 Werner Koch <[email protected]>
+ * 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.
diff --git a/agent/findkey.c b/agent/findkey.c
index 250852c23..67e283442 100644
--- a/agent/findkey.c
+++ b/agent/findkey.c
@@ -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);