bcrypt: Use standard dlopen() instead of the libwine wrappers.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-04-06 11:44:27 +02:00
parent 149e03c72a
commit 3caa333127
3 changed files with 15 additions and 18 deletions

View file

@ -37,7 +37,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/library.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL(bcrypt);

View file

@ -39,7 +39,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/library.h"
#include "wine/unicode.h"
#ifdef HAVE_GNUTLS_CIPHER_INIT
@ -180,14 +179,14 @@ BOOL gnutls_initialize(void)
{
int ret;
if (!(libgnutls_handle = wine_dlopen( SONAME_LIBGNUTLS, RTLD_NOW, NULL, 0 )))
if (!(libgnutls_handle = dlopen( SONAME_LIBGNUTLS, RTLD_NOW )))
{
ERR_(winediag)( "failed to load libgnutls, no support for encryption\n" );
return FALSE;
}
#define LOAD_FUNCPTR(f) \
if (!(p##f = wine_dlsym( libgnutls_handle, #f, NULL, 0 ))) \
if (!(p##f = dlsym( libgnutls_handle, #f ))) \
{ \
ERR( "failed to load %s\n", #f ); \
goto fail; \
@ -209,12 +208,12 @@ BOOL gnutls_initialize(void)
LOAD_FUNCPTR(gnutls_pubkey_init);
#undef LOAD_FUNCPTR
if (!(pgnutls_cipher_tag = wine_dlsym( libgnutls_handle, "gnutls_cipher_tag", NULL, 0 )))
if (!(pgnutls_cipher_tag = dlsym( libgnutls_handle, "gnutls_cipher_tag" )))
{
WARN("gnutls_cipher_tag not found\n");
pgnutls_cipher_tag = compat_gnutls_cipher_tag;
}
if (!(pgnutls_cipher_add_auth = wine_dlsym( libgnutls_handle, "gnutls_cipher_add_auth", NULL, 0 )))
if (!(pgnutls_cipher_add_auth = dlsym( libgnutls_handle, "gnutls_cipher_add_auth" )))
{
WARN("gnutls_cipher_add_auth not found\n");
pgnutls_cipher_add_auth = compat_gnutls_cipher_add_auth;
@ -225,47 +224,47 @@ BOOL gnutls_initialize(void)
pgnutls_perror( ret );
goto fail;
}
if (!(pgnutls_pubkey_import_ecc_raw = wine_dlsym( libgnutls_handle, "gnutls_pubkey_import_ecc_raw", NULL, 0 )))
if (!(pgnutls_pubkey_import_ecc_raw = dlsym( libgnutls_handle, "gnutls_pubkey_import_ecc_raw" )))
{
WARN("gnutls_pubkey_import_ecc_raw not found\n");
pgnutls_pubkey_import_ecc_raw = compat_gnutls_pubkey_import_ecc_raw;
}
if (!(pgnutls_privkey_export_rsa_raw = wine_dlsym( libgnutls_handle, "gnutls_privkey_export_rsa_raw", NULL, 0 )))
if (!(pgnutls_privkey_export_rsa_raw = dlsym( libgnutls_handle, "gnutls_privkey_export_rsa_raw" )))
{
WARN("gnutls_privkey_export_rsa_raw not found\n");
pgnutls_privkey_export_rsa_raw = compat_gnutls_privkey_export_rsa_raw;
}
if (!(pgnutls_privkey_export_ecc_raw = wine_dlsym( libgnutls_handle, "gnutls_privkey_export_ecc_raw", NULL, 0 )))
if (!(pgnutls_privkey_export_ecc_raw = dlsym( libgnutls_handle, "gnutls_privkey_export_ecc_raw" )))
{
WARN("gnutls_privkey_export_ecc_raw not found\n");
pgnutls_privkey_export_ecc_raw = compat_gnutls_privkey_export_ecc_raw;
}
if (!(pgnutls_privkey_import_ecc_raw = wine_dlsym( libgnutls_handle, "gnutls_privkey_import_ecc_raw", NULL, 0 )))
if (!(pgnutls_privkey_import_ecc_raw = dlsym( libgnutls_handle, "gnutls_privkey_import_ecc_raw" )))
{
WARN("gnutls_privkey_import_ecc_raw not found\n");
pgnutls_privkey_import_ecc_raw = compat_gnutls_privkey_import_ecc_raw;
}
if (!(pgnutls_pk_to_sign = wine_dlsym( libgnutls_handle, "gnutls_pk_to_sign", NULL, 0 )))
if (!(pgnutls_pk_to_sign = dlsym( libgnutls_handle, "gnutls_pk_to_sign" )))
{
WARN("gnutls_pk_to_sign not found\n");
pgnutls_pk_to_sign = compat_gnutls_pk_to_sign;
}
if (!(pgnutls_pubkey_verify_hash2 = wine_dlsym( libgnutls_handle, "gnutls_pubkey_verify_hash2", NULL, 0 )))
if (!(pgnutls_pubkey_verify_hash2 = dlsym( libgnutls_handle, "gnutls_pubkey_verify_hash2" )))
{
WARN("gnutls_pubkey_verify_hash2 not found\n");
pgnutls_pubkey_verify_hash2 = compat_gnutls_pubkey_verify_hash2;
}
if (!(pgnutls_pubkey_import_rsa_raw = wine_dlsym( libgnutls_handle, "gnutls_pubkey_import_rsa_raw", NULL, 0 )))
if (!(pgnutls_pubkey_import_rsa_raw = dlsym( libgnutls_handle, "gnutls_pubkey_import_rsa_raw" )))
{
WARN("gnutls_pubkey_import_rsa_raw not found\n");
pgnutls_pubkey_import_rsa_raw = compat_gnutls_pubkey_import_rsa_raw;
}
if (!(pgnutls_privkey_generate = wine_dlsym( libgnutls_handle, "gnutls_privkey_generate", NULL, 0 )))
if (!(pgnutls_privkey_generate = dlsym( libgnutls_handle, "gnutls_privkey_generate" )))
{
WARN("gnutls_privkey_generate not found\n");
pgnutls_privkey_generate = compat_gnutls_privkey_generate;
}
if (!(pgnutls_decode_rs_value = wine_dlsym( libgnutls_handle, "gnutls_decode_rs_value", NULL, 0 )))
if (!(pgnutls_decode_rs_value = dlsym( libgnutls_handle, "gnutls_decode_rs_value" )))
{
WARN("gnutls_decode_rs_value not found\n");
pgnutls_decode_rs_value = compat_gnutls_decode_rs_value;
@ -280,7 +279,7 @@ BOOL gnutls_initialize(void)
return TRUE;
fail:
wine_dlclose( libgnutls_handle, NULL, 0 );
dlclose( libgnutls_handle );
libgnutls_handle = NULL;
return FALSE;
}
@ -288,7 +287,7 @@ fail:
void gnutls_uninitialize(void)
{
pgnutls_global_deinit();
wine_dlclose( libgnutls_handle, NULL, 0 );
dlclose( libgnutls_handle );
libgnutls_handle = NULL;
}

View file

@ -38,7 +38,6 @@
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/library.h"
#include "wine/unicode.h"
#if defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 && !defined(HAVE_GNUTLS_CIPHER_INIT)