summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-07-21 17:45:41 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-07-21 17:45:41 +0200
commit0fa91f03976bd59fb056ece345efb7f496528355 (patch)
treef2e19316f9aca2f9b7d0441baaf2ef946ec97ccc
parente81cb21e0fc40b203a77acf338a727cd5e26df92 (diff)
downloadgnutls-0fa91f03976bd59fb056ece345efb7f496528355.tar.gz
set PIN function when reading a certificate
-rw-r--r--lib/gnutls_x509.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c
index 51ac6724ed..66affffffb 100644
--- a/lib/gnutls_x509.c
+++ b/lib/gnutls_x509.c
@@ -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 =