Commit 8aa300ba authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

configure: Check for gnutls_cipher_init instead of gnutls_hash.

parent 024a8a0b
......@@ -11983,16 +11983,16 @@ _ACEOF
fi
ac_wine_check_funcs_save_LIBS="$LIBS"
LIBS="$LIBS $GNUTLS_LIBS"
for ac_func in gnutls_hash
for ac_func in gnutls_cipher_init
do :
ac_fn_c_check_func "$LINENO" "gnutls_hash" "ac_cv_func_gnutls_hash"
if test "x$ac_cv_func_gnutls_hash" = xyes; then :
ac_fn_c_check_func "$LINENO" "gnutls_cipher_init" "ac_cv_func_gnutls_cipher_init"
if test "x$ac_cv_func_gnutls_cipher_init" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GNUTLS_HASH 1
#define HAVE_GNUTLS_CIPHER_INIT 1
_ACEOF
else
as_fn_append wine_notices "|libgnutls ${notice_platform}development files too old, bcrypt hashes won't be supported."
as_fn_append wine_notices "|libgnutls ${notice_platform}development files too old, bcrypt encryption won't be supported."
fi
done
......
......@@ -1304,8 +1304,8 @@ then
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>]], [[static typeof(gnutls_mac_get_key_size) *func; if (func) return 0;]])],
[WINE_CHECK_SONAME(gnutls,gnutls_global_init,,[GNUTLS_CFLAGS=""],[$GNUTLS_LIBS],[[libgnutls\\(-deb0\\)\\{0,1\\}]])
WINE_CHECK_LIB_FUNCS(gnutls_hash,[$GNUTLS_LIBS],,
[WINE_NOTICE([libgnutls ${notice_platform}development files too old, bcrypt hashes won't be supported.])])])],
WINE_CHECK_LIB_FUNCS(gnutls_cipher_init,[$GNUTLS_LIBS],,
[WINE_NOTICE([libgnutls ${notice_platform}development files too old, bcrypt encryption won't be supported.])])])],
[GNUTLS_CFLAGS=""])])
fi
WINE_WARNING_WITH(gnutls,[test "x$ac_cv_lib_soname_gnutls" = "x"],
......
......@@ -46,7 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bcrypt);
static HINSTANCE instance;
#if defined(HAVE_GNUTLS_HASH) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
WINE_DECLARE_DEBUG_CHANNEL(winediag);
static void *libgnutls_handle;
......@@ -73,7 +73,7 @@ static BOOL gnutls_initialize(void)
if (!(libgnutls_handle = wine_dlopen( SONAME_LIBGNUTLS, RTLD_NOW, NULL, 0 )))
{
ERR_(winediag)( "failed to load libgnutls, no support for crypto hashes\n" );
ERR_(winediag)( "failed to load libgnutls, no support for encryption\n" );
return FALSE;
}
......@@ -121,7 +121,7 @@ static void gnutls_uninitialize(void)
wine_dlclose( libgnutls_handle, NULL, 0 );
libgnutls_handle = NULL;
}
#endif /* HAVE_GNUTLS_HASH && !HAVE_COMMONCRYPTO_COMMONDIGEST_H */
#endif /* HAVE_GNUTLS_CIPHER_INIT && !HAVE_COMMONCRYPTO_COMMONDIGEST_H */
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG dwAlgOperations, ULONG *pAlgCount,
BCRYPT_ALGORITHM_IDENTIFIER **ppAlgList, ULONG dwFlags)
......@@ -685,7 +685,7 @@ NTSTATUS WINAPI BCryptHash( BCRYPT_ALG_HANDLE algorithm, UCHAR *secret, ULONG se
return BCryptDestroyHash( handle );
}
#if defined(HAVE_GNUTLS_HASH) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
struct key
{
struct object hdr;
......@@ -1020,14 +1020,14 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
case DLL_PROCESS_ATTACH:
instance = hinst;
DisableThreadLibraryCalls( hinst );
#if defined(HAVE_GNUTLS_HASH) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
gnutls_initialize();
#endif
break;
case DLL_PROCESS_DETACH:
if (reserved) break;
#if defined(HAVE_GNUTLS_HASH) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
#if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
gnutls_uninitialize();
#endif
break;
......
......@@ -267,8 +267,8 @@
/* Define to 1 if you have the `getuid' function. */
#undef HAVE_GETUID
/* Define to 1 if you have the `gnutls_hash' function. */
#undef HAVE_GNUTLS_HASH
/* Define to 1 if you have the `gnutls_cipher_init' function. */
#undef HAVE_GNUTLS_CIPHER_INIT
/* Define if we have the libgphoto2 development environment */
#undef HAVE_GPHOTO2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment