summaryrefslogtreecommitdiff
path: root/lib/gnutls_global.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2013-12-09 13:35:18 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2013-12-09 13:35:18 +0100
commit89e422bb710e45257d0c9074a8ef3107c795f7a3 (patch)
treec9087739583b2403363d7a3187bda4f0049b8099 /lib/gnutls_global.c
parent80596228381b256eab9e4980295f32487e530454 (diff)
downloadgnutls-89e422bb710e45257d0c9074a8ef3107c795f7a3.tar.gz
fully initialize the PKCS #11 subsystem only when it is needed to.
Diffstat (limited to 'lib/gnutls_global.c')
-rw-r--r--lib/gnutls_global.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/gnutls_global.c b/lib/gnutls_global.c
index b99ad28e0b..020140f55c 100644
--- a/lib/gnutls_global.c
+++ b/lib/gnutls_global.c
@@ -173,10 +173,9 @@ static unsigned int loaded_modules = 0;
#define GNUTLS_GLOBAL_INIT_ALL (~((unsigned int)0))
#define GNUTLS_GLOBAL_INIT_MINIMAL (1)
-#define GNUTLS_GLOBAL_INIT_PKCS11 (1<<1)
#define GNUTLS_GLOBAL_INIT_CRYPTO (1<<2)
-#define GLOBAL_INIT_ALL (GNUTLS_GLOBAL_INIT_MINIMAL|GNUTLS_GLOBAL_INIT_PKCS11|GNUTLS_GLOBAL_INIT_CRYPTO)
+#define GLOBAL_INIT_ALL (GNUTLS_GLOBAL_INIT_MINIMAL|GNUTLS_GLOBAL_INIT_CRYPTO)
/*-
* gnutls_global_init2:
@@ -322,12 +321,6 @@ static int gnutls_global_init2(unsigned int flags)
_gnutls_cryptodev_init();
}
-#ifdef ENABLE_PKCS11
- if (flags & GNUTLS_GLOBAL_INIT_PKCS11) {
- gnutls_pkcs11_init(GNUTLS_PKCS11_FLAG_AUTO, NULL);
- }
-#endif
-
#ifdef ENABLE_FIPS140
/* Perform FIPS140 checks last, so that all modules
* have been loaded */
@@ -414,9 +407,7 @@ void gnutls_global_deinit(void)
_gnutls_cryptodev_deinit();
}
#ifdef ENABLE_PKCS11
- if (loaded_modules & GNUTLS_GLOBAL_INIT_PKCS11) {
- gnutls_pkcs11_deinit();
- }
+ gnutls_pkcs11_deinit();
#endif
gnutls_mutex_deinit(&_gnutls_file_mutex);