Module: wine
Branch: master
Commit: 01826e0c98dab3e546d7e974bc8bfc2a2b29df12
URL: http://source.winehq.org/git/wine.git/?a=commit;h=01826e0c98dab3e546d7e974b…
Author: Rob Shearman <rob(a)codeweavers.com>
Date: Tue Nov 27 14:19:50 2007 +0000
wininet: Don't clear the auth data for Basic authentication in HTTP_InsertAuthorizationForHeader.
It isn't tracked per connection, unlike NTLM authentication, and so the
server will return a 401 error and try to get us to authenticate again.
However, this doesn't work as the authentication information is assumed
by the code to be valid for the whole connection.
---
dlls/wininet/http.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 5f27bd2..6845883 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1193,6 +1193,7 @@ static BOOL HTTP_InsertAuthorizationForHeader( LPWININETHTTPREQW lpwhr, struct H
if (pAuthInfo && pAuthInfo->auth_data_len)
{
static const WCHAR wszSpace[] = {' ',0};
+ static const WCHAR wszBasic[] = {'B','a','s','i','c',0};
unsigned int len;
/* scheme + space + base64 encoded data (3/2/1 bytes data -> 4 bytes of characters) */
@@ -1208,10 +1209,14 @@ static BOOL HTTP_InsertAuthorizationForHeader( LPWININETHTTPREQW lpwhr, struct H
authorization+strlenW(authorization));
/* clear the data as it isn't valid now that it has been sent to the
- * server */
- HeapFree(GetProcessHeap(), 0, pAuthInfo->auth_data);
- pAuthInfo->auth_data = NULL;
- pAuthInfo->auth_data_len = 0;
+ * server, unless it's Basic authentication which doesn't do
+ * connection tracking */
+ if (strcmpiW(pAuthInfo->scheme, wszBasic))
+ {
+ HeapFree(GetProcessHeap(), 0, pAuthInfo->auth_data);
+ pAuthInfo->auth_data = NULL;
+ pAuthInfo->auth_data_len = 0;
+ }
}
TRACE("Inserting authorization: %s\n", debugstr_w(authorization));
Module: wine
Branch: master
Commit: 0f9e568933925b283aa1a7bd20fdd8b27db94046
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0f9e568933925b283aa1a7bd2…
Author: Rob Shearman <rob(a)codeweavers.com>
Date: Tue Nov 27 12:32:39 2007 +0000
credui: Fix a test failure on Windows XP.
---
dlls/credui/tests/credui.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/dlls/credui/tests/credui.c b/dlls/credui/tests/credui.c
index 692e586..969b096 100644
--- a/dlls/credui/tests/credui.c
+++ b/dlls/credui/tests/credui.c
@@ -41,7 +41,8 @@ static void test_CredUIPromptForCredentials(void)
credui_info.hbmBanner = NULL;
ret = CredUIConfirmCredentialsW(NULL, TRUE);
- ok(ret == ERROR_INVALID_PARAMETER, "CredUIConfirmCredentials should have returned ERROR_INVALID_PARAMETER instead of %d\n", ret);
+ ok(ret == ERROR_INVALID_PARAMETER /* 2003 + */ || ret == ERROR_NOT_FOUND /* XP */,
+ "CredUIConfirmCredentials should have returned ERROR_INVALID_PARAMETER or ERROR_NOT_FOUND instead of %d\n", ret);
ret = CredUIConfirmCredentialsW(wszServerName, TRUE);
ok(ret == ERROR_NOT_FOUND, "CredUIConfirmCredentials should have returned ERROR_NOT_FOUND instead of %d\n", ret);