diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-08-14 15:02:33 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-08-14 15:02:33 +0200 |
commit | fbcbc22581084858845792ed0da0ece935d7ff0d (patch) | |
tree | 5022b4c5e2f93796bacda801b1ec4ffdcba4b376 /src | |
parent | b94a72ef8eda2f2a873d6b75743d6d1a9e9adf60 (diff) | |
download | gnutls-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.c | 7 |
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; |