]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
by default register a file callback in p11-kit to read a file from the pin-source...
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 16 Apr 2012 16:18:51 +0000 (18:18 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 16 Apr 2012 16:22:38 +0000 (18:22 +0200)
NEWS
lib/pkcs11.c

diff --git a/NEWS b/NEWS
index 44de26e5b1dae4925678a941d28855adcf6e7652..c105b32cd005171c517f566ed52900dfab9dc12b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,8 @@ See the end for copying conditions.
 
 * Version 3.1.0 (unreleased)
 
-** libgnutls: xxx
+** libgnutls: When decoding a PKCS #11 URL the pin-source field
+is assumed to be a file that stores the pin.
 
 ** API and ABI modifications:
 No changes since last version.
index fee702384dedae685a086718481358960dfbb646..ca7b76b8e4ac12ba34264614f6c47498e5064a57 100644 (file)
@@ -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);