diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-18 23:48:43 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-18 23:48:43 +0100 |
commit | 704190975aa6202ad7c37fc2d692688a3ad07417 (patch) | |
tree | 88153b89404cc1bd9f26cf2cae3d4deb20c6699b | |
parent | abcee3f467cbba6608464c23908ae71252eb8574 (diff) | |
download | gnutls-704190975aa6202ad7c37fc2d692688a3ad07417.tar.gz |
Fixed gnutls_pkcs11_reinit() to reinitialize all modules.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | lib/pkcs11.c | 11 |
2 files changed, 7 insertions, 7 deletions
@@ -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; |