From 0fa91f03976bd59fb056ece345efb7f496528355 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 21 Jul 2012 17:45:41 +0200 Subject: set PIN function when reading a certificate --- lib/gnutls_x509.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 = -- cgit v1.2.1