summaryrefslogtreecommitdiff
path: root/lib/pkcs11.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-04-16 18:18:51 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-04-16 18:22:38 +0200
commitc1eddcfe663b9e3cb9a411f855e00f49811ff205 (patch)
tree386caaaf74c949d7971bbbb2d70dc43e8b9c3e16 /lib/pkcs11.c
parent713e80edc8f96c24c6d1f2719f897352f8fc8961 (diff)
downloadgnutls-c1eddcfe663b9e3cb9a411f855e00f49811ff205.tar.gz
by default register a file callback in p11-kit to read a file from the pin-source pkcs11url field.
Diffstat (limited to 'lib/pkcs11.c')
-rw-r--r--lib/pkcs11.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pkcs11.c b/lib/pkcs11.c
index fee702384d..ca7b76b8e4 100644
--- a/lib/pkcs11.c
+++ b/lib/pkcs11.c
@@ -557,6 +557,9 @@ gnutls_pkcs11_init (unsigned int flags, const char *deprecated_config_file)
}
init++;
+ p11_kit_pin_register_callback (P11_KIT_PIN_FALLBACK, p11_kit_pin_file_callback,
+ NULL, NULL);
+
if (flags == GNUTLS_PKCS11_FLAG_MANUAL)
return 0;
else if (flags == GNUTLS_PKCS11_FLAG_AUTO)
@@ -1960,7 +1963,7 @@ retrieve_pin (struct p11_kit_uri *info, struct ck_token_info *token_info,
/* Check if a pinfile is specified, and use that if possible */
pinfile = p11_kit_uri_get_pinfile (info);
- if (pinfile != NULL)
+ if (pinfile != NULL && attempts == 0)
{
_gnutls_debug_log("pk11: Using pinfile to retrieve PIN\n");
return retrieve_pin_for_pinfile (pinfile, token_info, attempts, user_type, pin);