diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-18 23:48:43 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-02-19 07:57:25 +0100 |
commit | b94b11183b27a873699a5e3316ad1ffea10805d8 (patch) | |
tree | 4adb14095ffce9ac187e7923cfe55d2214983a12 | |
parent | 7a1f0d119f305abbb94fd45c3ae31a8a82b712c2 (diff) | |
download | gnutls-b94b11183b27a873699a5e3316ad1ffea10805d8.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
@@ -6,6 +6,9 @@ See the end for copying conditions. ** libgnutls: Corrected issue in gnutls_pubkey_verify_data(). +** libgnutls: gnutls_pkcs11_reinit() will reinitialize all PKCS #11 +modules, and not only the ones loaded via p11-kit. + ** API and ABI modifications: No changes since last version. diff --git a/lib/pkcs11.c b/lib/pkcs11.c index 4612a3e994..c74f23b8cc 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -589,15 +589,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 GNUTLS_E_INTERNAL_ERROR; + if (providers[i].module != NULL) + p11_kit_initialize_module(providers[i].module); } return 0; |