summaryrefslogtreecommitdiff
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:18:51 +0200
commitfee115648e64653cfe4eb178cfedf237091d6f2f (patch)
tree91b1130a057758168488bbde7d729210facbde79
parentd6b983dee475d1597687c3dcbca54c5842e3fc7f (diff)
downloadgnutls-fee115648e64653cfe4eb178cfedf237091d6f2f.tar.gz
by default register a file callback in p11-kit to read a file from the pin-source pkcs11url field.
-rw-r--r--lib/pkcs11.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pkcs11.c b/lib/pkcs11.c
index 6fc55a2021..074186c519 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_AUTO)
{
if (deprecated_config_file == NULL)
@@ -1911,7 +1914,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);