gnutls: remove gcrypt initialization

There are no (other) reasons for the GnuTLS plugin to link against
libgcrypt. Since nettle has been the default back-end for GnuTLS for
ages, this old code has become more harmful than good.

Besides, this code was not sufficient to really address the thread
safety issues in libgcrypt (since it is also used via other paths).
This commit is contained in:
Rémi Denis-Courmont 2012-09-27 21:39:11 +03:00
parent c9c38976c9
commit 969171b91c
3 changed files with 2 additions and 13 deletions

View File

@ -3799,13 +3799,6 @@ dnl TLS/SSL
dnl
AC_ARG_ENABLE(gnutls,
[ --enable-gnutls GNU TLS TLS/SSL support (default enabled)])
AS_IF([test "${have_libgcrypt}" != "yes"], [
AS_IF([test "${enable_gnutls}" = "yes"], [
AC_MSG_ERROR([--enable-gnutls and --disable-libgcrypt are mutually exclusive.])
])
enable_gnutls="no"
])
AS_IF([test "${enable_gnutls}" != "no"], [
PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.6.6], [
VLC_ADD_PLUGIN([gnutls])

View File

@ -13,8 +13,8 @@ libexport_plugin_la_LIBADD = $(AM_LIBADD)
libvlc_LTLIBRARIES += libexport_plugin.la
libgnutls_plugin_la_SOURCES = gnutls.c dhparams.h
libgnutls_plugin_la_CFLAGS = $(AM_CFLAGS) $(GNUTLS_CFLAGS) $(GCRYPT_CFLAGS)
libgnutls_plugin_la_LIBADD = $(AM_LIBADD) $(GNUTLS_LIBS) $(GCRYPT_LIBS)
libgnutls_plugin_la_CFLAGS = $(AM_CFLAGS) $(GNUTLS_CFLAGS)
libgnutls_plugin_la_LIBADD = $(AM_LIBADD) $(GNUTLS_LIBS)
if HAVE_WIN32
libgnutls_plugin_la_LIBADD += -lcrypt32 $(SOCKET_LIBS)
endif

View File

@ -47,11 +47,9 @@
#include <vlc_fs.h>
#include <vlc_block.h>
#include <gcrypt.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include <vlc_gcrypt.h>
#include "dhparams.h"
#include <assert.h>
@ -113,8 +111,6 @@ static int gnutls_Init (vlc_object_t *p_this)
{
int ret = VLC_EGENERIC;
vlc_gcrypt_init (); /* GnuTLS depends on gcrypt */
vlc_mutex_lock (&gnutls_mutex);
if (gnutls_global_init ())
{