aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2006-08-10 06:06:21 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2006-08-10 06:06:21 +0000
commit73ddcc157a1f287b90028117b0ea1e9c2a0e6cdc (patch)
tree6fe25b8dedea016d12b4874ca83e030a7293cb5e
parentf2a2bed08f931977467f7a956b9f2ef52dfcaef4 (diff)
GnuTLS/libgcrypt initialization moved to epan.c
svn path=/trunk/; revision=18863
-rw-r--r--epan/dissectors/packet-ssl-utils.c1
-rw-r--r--epan/epan.c21
2 files changed, 21 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index bc319b8a8b..c9525c6feb 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -1294,7 +1294,6 @@ void ssl_free_key(SSL_PRIVATE_KEY* key)
void
ssl_lib_init(void)
{
- gnutls_global_init();
}
#else /* HAVE_LIBGNUTLS */
diff --git a/epan/epan.c b/epan/epan.c
index 5fe361a40a..05e274e85b 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -9,6 +9,19 @@
#include "config.h"
#endif
+#if (defined(HAVE_LIBGCRYPT) || defined(HAVE_LIBGNUTLS)) && defined(_WIN32)
+#include <winposixtype.h>
+#endif
+
+#ifdef HAVE_LIBGCRYPT
+#include <gcrypt.h>
+#endif /* HAVE_LIBGCRYPT */
+
+#ifdef HAVE_LIBGNUTLS
+#include <gnutls/gnutls.h>
+#endif /* HAVE_LIBGNUTLS */
+
+
#include <glib.h>
#include "epan.h"
#include "epan_dissect.h"
@@ -66,6 +79,11 @@ epan_init(const char *plugin_dir, void (*register_all_protocols)(void),
report_open_failure_func = report_open_failure;
report_read_failure_func = report_read_failure;
except_init();
+#ifdef HAVE_LIBGNUTLS
+ gnutls_global_init();
+#elif defined(HAVE_LIBGCRYPT)
+ gcry_check_version(NULL);
+#endif
tvbuff_init();
oid_resolv_init();
tap_init();
@@ -86,6 +104,9 @@ epan_cleanup(void)
packet_cleanup();
oid_resolv_cleanup();
tvbuff_cleanup();
+#ifdef HAVE_LIBGNUTLS
+ gnutls_global_deinit();
+#endif
except_deinit();
host_name_lookup_cleanup();
}