summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-02-18 23:48:43 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-02-18 23:48:43 +0100
commit704190975aa6202ad7c37fc2d692688a3ad07417 (patch)
tree88153b89404cc1bd9f26cf2cae3d4deb20c6699b
parentabcee3f467cbba6608464c23908ae71252eb8574 (diff)
downloadgnutls-704190975aa6202ad7c37fc2d692688a3ad07417.tar.gz
Fixed gnutls_pkcs11_reinit() to reinitialize all modules.
-rw-r--r--NEWS3
-rw-r--r--lib/pkcs11.c11
2 files changed, 7 insertions, 7 deletions
diff --git a/NEWS b/NEWS
index 77d9aea976..945bbcb6c9 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ a PKCS #12 file from an encrypted key file. Reported by Yan Fiz.
** libgnutls: corrected parsing issue in XMPP within a subject
alternative name. Reported by James Cloos.
+** libgnutls: gnutls_pkcs11_reinit() will reinitialize all PKCS #11
+modules, and not only the ones loaded via p11-kit.
+
** API and ABI modifications:
gnutls_handshake_set_random: Added
gnutls_transport_set_int2: Added
diff --git a/lib/pkcs11.c b/lib/pkcs11.c
index 97ce3d461f..b3b2aa934d 100644
--- a/lib/pkcs11.c
+++ b/lib/pkcs11.c
@@ -586,15 +586,12 @@ gnutls_pkcs11_init (unsigned int flags, const char *deprecated_config_file)
**/
int gnutls_pkcs11_reinit (void)
{
- int rv;
+ unsigned i;
- rv = p11_kit_initialize_registered ();
- if (rv != CKR_OK)
+ for (i = 0; i < active_providers; i++)
{
- gnutls_assert ();
- _gnutls_debug_log ("Cannot initialize registered module: %s\n",
- p11_kit_strerror (rv));
- return pkcs11_rv_to_err(rv);
+ if (providers[i].module != NULL)
+ p11_kit_initialize_module(providers[i].module);
}
return 0;