summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-08-14 15:02:33 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-08-14 15:02:33 +0200
commitfbcbc22581084858845792ed0da0ece935d7ff0d (patch)
tree5022b4c5e2f93796bacda801b1ec4ffdcba4b376 /src
parentb94a72ef8eda2f2a873d6b75743d6d1a9e9adf60 (diff)
downloadgnutls-fbcbc22581084858845792ed0da0ece935d7ff0d.tar.gz
Introduced GNUTLS_PKCS11_PIN_WRONG flag to indicate the previously given PIN is wrong.
Diffstat (limited to 'src')
-rw-r--r--src/p11common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/p11common.c b/src/p11common.c
index 1ef7c9c538..4c7df1e1b7 100644
--- a/src/p11common.c
+++ b/src/p11common.c
@@ -58,6 +58,12 @@ pin_callback (void *user, int attempt, const char *token_url,
cache = 0;
printf ("*** Only few tries left before locking!\n");
}
+
+ if (flags & GNUTLS_PKCS11_PIN_WRONG)
+ {
+ cache = 0;
+ printf ("*** Wrong PIN has been provided!\n");
+ }
if (cache > 0 && cached_url != NULL)
{
@@ -69,6 +75,7 @@ pin_callback (void *user, int attempt, const char *token_url,
exit (1);
}
+ fprintf(stderr, "Re-using cached PIN for token '%s'\n", token_label);
strcpy (pin, cached_pin);
cache--;
return 0;