aboutsummaryrefslogtreecommitdiffstats
path: root/agent/divert-scd.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-09-25 10:06:02 +0000
committerWerner Koch <[email protected]>2008-09-25 10:06:02 +0000
commit96f16f736e97992c985f01c5e93bf825fdcd5707 (patch)
tree2db9d0ade98d7ca89ffb8aa17e65a0cb6bf2c8e4 /agent/divert-scd.c
parent* pkclist.c (select_algo_from_prefs): Redo function to rank prefs and (diff)
downloadgnupg-96f16f736e97992c985f01c5e93bf825fdcd5707.tar.gz
gnupg-96f16f736e97992c985f01c5e93bf825fdcd5707.zip
Finished support for v2 cards with the exception of secure messaging.
Diffstat (limited to 'agent/divert-scd.c')
-rw-r--r--agent/divert-scd.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index eac3b59c3..b19302496 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -185,6 +185,7 @@ encode_md_for_card (const unsigned char *digest, size_t digestlen, int algo,
PIN. If the PIN is not correctly repeated it starts from
all over.
'A' = The PIN is an Admin PIN, SO-PIN, PUK or alike.
+ 'R' = The PIN is a Reset Code.
Example:
@@ -202,6 +203,7 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
const char *ends, *s;
int any_flags = 0;
int newpin = 0;
+ int resetcode = 0;
const char *again_text = NULL;
const char *prompt = "PIN";
@@ -217,6 +219,11 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
prompt = _("Admin PIN");
else if (*s == 'N')
newpin = 1;
+ else if (*s == 'R')
+ {
+ prompt = _("Reset Code");
+ resetcode = 1;
+ }
}
info = ends+1;
any_flags = 1;
@@ -272,10 +279,16 @@ getpin_cb (void *opaque, const char *info, char *buf, size_t maxbuf)
pi2->min_digits = 0;
pi2->max_digits = 8;
pi2->max_tries = 1;
- rc = agent_askpin (ctrl, _("Repeat this PIN"), prompt, NULL, pi2);
+ rc = agent_askpin (ctrl,
+ (resetcode?
+ _("Repeat this Reset Code"):
+ _("Repeat this PIN")),
+ prompt, NULL, pi2);
if (!rc && strcmp (pi->pin, pi2->pin))
{
- again_text = N_("PIN not correctly repeated; try again");
+ again_text = (resetcode?
+ N_("Reset Code not correctly repeated; try again"):
+ N_("PIN not correctly repeated; try again"));
xfree (pi2);
xfree (pi);
goto again;