]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
set PIN function when reading a certificate
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 21 Jul 2012 15:45:41 +0000 (17:45 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 21 Jul 2012 15:45:41 +0000 (17:45 +0200)
lib/gnutls_x509.c

index 51ac6724ed5e66e13c99e493d96bea4e8823ddbe..66affffffb318823084938d561faf46072004b38 100644 (file)
@@ -652,7 +652,7 @@ cleanup:
 }
 
 
-/* Reads a private key from a token.
+/* Reads a certificate key from a token.
  */
 static int
 read_cert_url (gnutls_certificate_credentials_t res, const char *url)
@@ -678,6 +678,9 @@ read_cert_url (gnutls_certificate_credentials_t res, const char *url)
       goto cleanup;
     }
 
+  if (res->pin.cb)
+    gnutls_x509_crt_set_pin_function(crt, res->pin.cb, res->pin.data);
+
   ret = gnutls_x509_crt_import_pkcs11_url (crt, url, 0);
   if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE)
     ret =