Commit 4d1b8b1a authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

wininet: Fix basic authentication by putting Basic directing into the scheme…

wininet: Fix basic authentication by putting Basic directing into the scheme field, as the pszAuthValue can have an optional realm string appended.
parent 77440b09
......@@ -440,12 +440,6 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue
if (!pAuthInfo)
return FALSE;
pAuthInfo->scheme = WININET_strdupW(pszAuthValue);
if (!pAuthInfo->scheme)
{
HeapFree(GetProcessHeap(), 0, pAuthInfo);
return FALSE;
}
SecInvalidateHandle(&pAuthInfo->cred);
SecInvalidateHandle(&pAuthInfo->ctx);
memset(&pAuthInfo->exp, 0, sizeof(pAuthInfo->exp));
......@@ -454,12 +448,29 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue
pAuthInfo->auth_data_len = 0;
pAuthInfo->finished = FALSE;
if (!is_basic_auth_value(pszAuthValue))
if (is_basic_auth_value(pszAuthValue))
{
static const WCHAR szBasic[] = {'B','a','s','i','c',0};
pAuthInfo->scheme = WININET_strdupW(szBasic);
if (!pAuthInfo->scheme)
{
HeapFree(GetProcessHeap(), 0, pAuthInfo);
return FALSE;
}
}
else
{
SEC_WINNT_AUTH_IDENTITY_W nt_auth_identity;
WCHAR *user = strchrW(domain_and_username, '\\');
WCHAR *domain = domain_and_username;
pAuthInfo->scheme = WININET_strdupW(pszAuthValue);
if (!pAuthInfo->scheme)
{
HeapFree(GetProcessHeap(), 0, pAuthInfo);
return FALSE;
}
if (user) user++;
else
{
......
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