Rebase against a0c651cd7cf83c9fac6b8776de2d54a731fc4b29.

[secur32-ANSI_NTLM_Credentials]
Removed patch to fix handling of ANSI NTLM credentials (accepted upstream).
This commit is contained in:
Sebastian Lackner 2016-05-26 23:37:02 +02:00
parent 71bb1a35f5
commit e460e59354
4 changed files with 73 additions and 197 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "b5aeb661b9297a6ee6047335f42543936f593525"
echo "a0c651cd7cf83c9fac6b8776de2d54a731fc4b29"
}
# Show version information
@ -274,7 +274,6 @@ patch_enable_all ()
enable_riched20_IText_Interface="$1"
enable_rpcrt4_Pipe_Transport="$1"
enable_rpcrt4_RpcBindingServerFromClient="$1"
enable_secur32_ANSI_NTLM_Credentials="$1"
enable_secur32_Zero_Buffer_Length="$1"
enable_server_ClipCursor="$1"
enable_server_CreateProcess_ACLs="$1"
@ -1001,9 +1000,6 @@ patch_enable ()
rpcrt4-RpcBindingServerFromClient)
enable_rpcrt4_RpcBindingServerFromClient="$2"
;;
secur32-ANSI_NTLM_Credentials)
enable_secur32_ANSI_NTLM_Credentials="$2"
;;
secur32-Zero_Buffer_Length)
enable_secur32_Zero_Buffer_Length="$2"
;;
@ -5904,21 +5900,6 @@ if test "$enable_rpcrt4_RpcBindingServerFromClient" -eq 1; then
) >> "$patchlist"
fi
# Patchset secur32-ANSI_NTLM_Credentials
# |
# | This patchset fixes the following Wine bugs:
# | * [#37063] Fix handling of ANSI NTLM credentials
# |
# | Modified files:
# | * dlls/secur32/ntlm.c
# |
if test "$enable_secur32_ANSI_NTLM_Credentials" -eq 1; then
patch_apply secur32-ANSI_NTLM_Credentials/0001-secur32-Fix-handling-of-ANSI-NTLM-credentials.patch
(
echo '+ { "David Woodhouse", "secur32: Fix handling of ANSI NTLM credentials.", 1 },';
) >> "$patchlist"
fi
# Patchset secur32-Zero_Buffer_Length
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,104 +0,0 @@
From 84e4f321118a11991a34e24dd1729181ad8a1574 Mon Sep 17 00:00:00 2001
From: David Woodhouse <dwmw2@infradead.org>
Date: Fri, 8 Aug 2014 13:21:56 +0100
Subject: secur32: Fix handling of ANSI NTLM credentials
One of many issues covered in bug 37063... we assume that the
credentials are in Unicode, instead of looking at the Flags field.
---
dlls/secur32/ntlm.c | 69 ++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 58 insertions(+), 11 deletions(-)
diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c
index 0fe64ed..72e9706 100644
--- a/dlls/secur32/ntlm.c
+++ b/dlls/secur32/ntlm.c
@@ -174,27 +174,74 @@ SECURITY_STATUS SEC_ENTRY ntlm_AcquireCredentialsHandleW(
if(pAuthData != NULL)
{
PSEC_WINNT_AUTH_IDENTITY_W auth_data = pAuthData;
+ LPWSTR domain = NULL, user = NULL, password = NULL;
+ int domain_len = 0, user_len = 0, password_len = 0;
- TRACE("Username is %s\n", debugstr_wn(auth_data->User, auth_data->UserLength));
- TRACE("Domain name is %s\n", debugstr_wn(auth_data->Domain, auth_data->DomainLength));
+ if (auth_data->Flags & SEC_WINNT_AUTH_IDENTITY_ANSI)
+ {
+ if (auth_data->DomainLength)
+ {
+ domain_len = MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->Domain,
+ auth_data->DomainLength, NULL, 0);
+ domain = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * domain_len);
+ MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->Domain, auth_data->DomainLength,
+ domain, domain_len);
+ }
+
+ if (auth_data->UserLength)
+ {
+ user_len = MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->User,
+ auth_data->UserLength, NULL, 0);
+ user = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * user_len);
+ MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->User, auth_data->UserLength,
+ user, user_len);
+ }
+
+ if (auth_data->PasswordLength)
+ {
+ password_len = MultiByteToWideChar(CP_ACP, 0,(char *)auth_data->Password,
+ auth_data->PasswordLength, NULL, 0);
+ password = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * password_len);
+ MultiByteToWideChar(CP_ACP, 0, (char *)auth_data->Password, auth_data->PasswordLength,
+ password, password_len);
+ }
+ }
+ else
+ {
+ domain = auth_data->Domain;
+ domain_len = auth_data->DomainLength;
+
+ user = auth_data->User;
+ user_len = auth_data->UserLength;
+
+ password = auth_data->Password;
+ password_len = auth_data->PasswordLength;
+ }
+
+ TRACE("Username is %s\n", debugstr_wn(user, user_len));
+ TRACE("Domain name is %s\n", debugstr_wn(domain, domain_len));
- ntlm_cred->username_arg = ntlm_GetUsernameArg(auth_data->User, auth_data->UserLength);
- ntlm_cred->domain_arg = ntlm_GetDomainArg(auth_data->Domain, auth_data->DomainLength);
+ ntlm_cred->username_arg = ntlm_GetUsernameArg(user, user_len);
+ ntlm_cred->domain_arg = ntlm_GetDomainArg(domain, domain_len);
- if(auth_data->PasswordLength != 0)
+ if(password_len != 0)
{
- ntlm_cred->pwlen = WideCharToMultiByte(CP_UNIXCP,
- WC_NO_BEST_FIT_CHARS, auth_data->Password,
- auth_data->PasswordLength, NULL, 0, NULL,
- NULL);
+ ntlm_cred->pwlen = WideCharToMultiByte(CP_UNIXCP, WC_NO_BEST_FIT_CHARS, password,
+ password_len, NULL, 0, NULL, NULL);
ntlm_cred->password = HeapAlloc(GetProcessHeap(), 0,
ntlm_cred->pwlen);
- WideCharToMultiByte(CP_UNIXCP, WC_NO_BEST_FIT_CHARS,
- auth_data->Password, auth_data->PasswordLength,
+ WideCharToMultiByte(CP_UNIXCP, WC_NO_BEST_FIT_CHARS, password, password_len,
ntlm_cred->password, ntlm_cred->pwlen, NULL, NULL);
}
+
+ if (auth_data->Flags & SEC_WINNT_AUTH_IDENTITY_ANSI)
+ {
+ HeapFree(GetProcessHeap(), 0, domain);
+ HeapFree(GetProcessHeap(), 0, user);
+ HeapFree(GetProcessHeap(), 0, password);
+ }
}
phCredential->dwUpper = fCredentialUse;
--
2.3.3

View File

@ -1 +0,0 @@
Fixes: [37063] Fix handling of ANSI NTLM credentials

File diff suppressed because it is too large Load Diff