You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 8827eb6a83348057293f89be535ccb74607db608.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From 2674bbd626b4a9e46e5ab729cb47c81950efefea Mon Sep 17 00:00:00 2001
|
||||
From 7fcdf1faa257c90d6452f26ad3a68daca1dd96d1 Mon Sep 17 00:00:00 2001
|
||||
From: Derek Lesho <dlesho@codeweavers.com>
|
||||
Date: Tue, 7 Jan 2020 14:22:49 -0600
|
||||
Subject: [PATCH] bcrypt: Implement BCryptSecretAgreement with libgcrypt.
|
||||
@@ -9,15 +9,15 @@ Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
|
||||
dlls/bcrypt/Makefile.in | 1 +
|
||||
dlls/bcrypt/bcrypt_internal.h | 6 +
|
||||
dlls/bcrypt/bcrypt_main.c | 54 ++++++-
|
||||
dlls/bcrypt/gcrypt.c | 264 ++++++++++++++++++++++++++++++++++
|
||||
dlls/bcrypt/gcrypt.c | 263 ++++++++++++++++++++++++++++++++++
|
||||
dlls/bcrypt/gnutls.c | 9 ++
|
||||
dlls/bcrypt/macos.c | 6 +
|
||||
dlls/bcrypt/tests/bcrypt.c | 2 +-
|
||||
8 files changed, 350 insertions(+), 6 deletions(-)
|
||||
8 files changed, 349 insertions(+), 6 deletions(-)
|
||||
create mode 100644 dlls/bcrypt/gcrypt.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 928f8ebd1b1..f9db147e7d5 100644
|
||||
index 006087e05ec..b50737a766e 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -47,6 +47,7 @@ AC_ARG_WITH(faudio, AS_HELP_STRING([--without-faudio],[do not use FAudio (XAu
|
||||
@@ -28,7 +28,7 @@ index 928f8ebd1b1..f9db147e7d5 100644
|
||||
AC_ARG_WITH(gettext, AS_HELP_STRING([--without-gettext],[do not use gettext]))
|
||||
AC_ARG_WITH(gettextpo, AS_HELP_STRING([--with-gettextpo],[use the GetTextPO library to rebuild po files]),
|
||||
[if test "x$withval" = "xno"; then ac_cv_header_gettext_po_h=no; fi])
|
||||
@@ -2033,6 +2034,19 @@ WINE_NOTICE_WITH(vkd3d,[test "x$ac_cv_lib_soname_vkd3d" = "x"],
|
||||
@@ -2044,6 +2045,19 @@ WINE_NOTICE_WITH(vkd3d,[test "x$ac_cv_lib_soname_vkd3d" = "x"],
|
||||
[vkd3d ${notice_platform}development files not found (or too old), Direct3D 12 won't be supported.])
|
||||
test "x$ac_cv_lib_soname_vkd3d" != "x" || enable_d3d12=${enable_d3d12:-no}
|
||||
|
||||
@@ -92,10 +92,10 @@ index 43be170d77f..6c93ed78389 100644
|
||||
BOOL is_zero_vector( const UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
BOOL is_equal_vector( const UCHAR *, ULONG, const UCHAR *, ULONG ) DECLSPEC_HIDDEN;
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index bea2001a677..65c28ca63e2 100644
|
||||
index cd3b746e295..7b2a3393902 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1421,6 +1421,12 @@ NTSTATUS key_import_ecc( struct key *key, UCHAR *input, ULONG len )
|
||||
@@ -1425,6 +1425,12 @@ NTSTATUS key_import_ecc( struct key *key, UCHAR *input, ULONG len )
|
||||
ERR( "support for keys not available at build time\n" );
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ index bea2001a677..65c28ca63e2 100644
|
||||
#endif
|
||||
|
||||
NTSTATUS WINAPI BCryptGenerateSymmetricKey( BCRYPT_ALG_HANDLE algorithm, BCRYPT_KEY_HANDLE *handle,
|
||||
@@ -1838,8 +1844,9 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
@@ -1842,8 +1848,9 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
struct key *privkey = privatekey;
|
||||
struct key *pubkey = publickey;
|
||||
struct secret *secret;
|
||||
@@ -119,7 +119,7 @@ index bea2001a677..65c28ca63e2 100644
|
||||
|
||||
if (!privkey || privkey->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
if (!pubkey || pubkey->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE;
|
||||
@@ -1848,7 +1855,16 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
@@ -1852,7 +1859,16 @@ NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE privatekey, BCRYPT_KEY_H
|
||||
if (!(secret = heap_alloc_zero( sizeof(*secret) ))) return STATUS_NO_MEMORY;
|
||||
secret->hdr.magic = MAGIC_SECRET;
|
||||
|
||||
@@ -137,7 +137,7 @@ index bea2001a677..65c28ca63e2 100644
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -1856,10 +1872,11 @@ NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE handle)
|
||||
@@ -1860,10 +1876,11 @@ NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE handle)
|
||||
{
|
||||
struct secret *secret = handle;
|
||||
|
||||
@@ -150,7 +150,7 @@ index bea2001a677..65c28ca63e2 100644
|
||||
heap_free( secret );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -1869,12 +1886,33 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCrypt
|
||||
@@ -1873,12 +1890,33 @@ NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE handle, LPCWSTR kdf, BCrypt
|
||||
{
|
||||
struct secret *secret = handle;
|
||||
|
||||
@@ -186,7 +186,7 @@ index bea2001a677..65c28ca63e2 100644
|
||||
}
|
||||
|
||||
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
@@ -1886,6 +1924,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
@@ -1890,6 +1928,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
DisableThreadLibraryCalls( hinst );
|
||||
#ifdef HAVE_GNUTLS_CIPHER_INIT
|
||||
gnutls_initialize();
|
||||
@@ -196,7 +196,7 @@ index bea2001a677..65c28ca63e2 100644
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -1893,6 +1934,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
@@ -1897,6 +1938,9 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
if (reserved) break;
|
||||
#ifdef HAVE_GNUTLS_CIPHER_INIT
|
||||
gnutls_uninitialize();
|
||||
@@ -208,10 +208,10 @@ index bea2001a677..65c28ca63e2 100644
|
||||
}
|
||||
diff --git a/dlls/bcrypt/gcrypt.c b/dlls/bcrypt/gcrypt.c
|
||||
new file mode 100644
|
||||
index 00000000000..f882d61def8
|
||||
index 00000000000..4e0386a3dda
|
||||
--- /dev/null
|
||||
+++ b/dlls/bcrypt/gcrypt.c
|
||||
@@ -0,0 +1,264 @@
|
||||
@@ -0,0 +1,263 @@
|
||||
+#include "config.h"
|
||||
+#include "wine/port.h"
|
||||
+
|
||||
@@ -235,7 +235,6 @@ index 00000000000..f882d61def8
|
||||
+
|
||||
+#include "wine/debug.h"
|
||||
+#include "wine/heap.h"
|
||||
+#include "wine/library.h"
|
||||
+#include "wine/unicode.h"
|
||||
+
|
||||
+#if defined(HAVE_GNUTLS_CIPHER_INIT) && defined(SONAME_LIBGCRYPT)
|
||||
@@ -477,10 +476,10 @@ index 00000000000..f882d61def8
|
||||
+}
|
||||
+#endif
|
||||
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
|
||||
index 19a00e2ee25..1e075fe9994 100644
|
||||
index 7acf8198626..8e5481aecc3 100644
|
||||
--- a/dlls/bcrypt/gnutls.c
|
||||
+++ b/dlls/bcrypt/gnutls.c
|
||||
@@ -1585,4 +1585,13 @@ NTSTATUS key_destroy( struct key *key )
|
||||
@@ -1606,4 +1606,13 @@ NTSTATUS key_destroy( struct key *key )
|
||||
heap_free( key );
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
@@ -510,10 +509,10 @@ index 7f902535b8f..6c2a41a0725 100644
|
||||
+}
|
||||
#endif
|
||||
diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c
|
||||
index eb7a72e0ff4..a351aacf1f5 100644
|
||||
index 7fdc0ac7fb2..5701a0a30ce 100644
|
||||
--- a/dlls/bcrypt/tests/bcrypt.c
|
||||
+++ b/dlls/bcrypt/tests/bcrypt.c
|
||||
@@ -2068,7 +2068,7 @@ static void test_ECDH(void)
|
||||
@@ -2115,7 +2115,7 @@ static void test_ECDH(void)
|
||||
goto raw_secret_end;
|
||||
}
|
||||
|
||||
@@ -523,5 +522,5 @@ index eb7a72e0ff4..a351aacf1f5 100644
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
--
|
||||
2.27.0
|
||||
2.28.0
|
||||
|
||||
|
Reference in New Issue
Block a user