winhttp: Ignore unknown schemes in WinHttpQueryAuthSchemes.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
72d2715880
commit
6b6ffb399a
|
@ -1311,7 +1311,7 @@ static DWORD auth_scheme_from_header( WCHAR *header )
|
||||||
|
|
||||||
static BOOL query_auth_schemes( request_t *request, DWORD level, LPDWORD supported, LPDWORD first )
|
static BOOL query_auth_schemes( request_t *request, DWORD level, LPDWORD supported, LPDWORD first )
|
||||||
{
|
{
|
||||||
DWORD index = 0;
|
DWORD index = 0, supported_schemes = 0, first_scheme = 0;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
|
@ -1332,15 +1332,19 @@ static BOOL query_auth_schemes( request_t *request, DWORD level, LPDWORD support
|
||||||
}
|
}
|
||||||
scheme = auth_scheme_from_header( buffer );
|
scheme = auth_scheme_from_header( buffer );
|
||||||
heap_free( buffer );
|
heap_free( buffer );
|
||||||
if (!scheme) break;
|
if (!scheme) continue;
|
||||||
|
|
||||||
if (first && index == 1)
|
if (!first_scheme) first_scheme = scheme;
|
||||||
*first = *supported = scheme;
|
supported_schemes |= scheme;
|
||||||
else
|
|
||||||
*supported |= scheme;
|
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
{
|
||||||
|
*supported = supported_schemes;
|
||||||
|
*first = first_scheme;
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2523,7 +2523,7 @@ static void test_multi_authentication(int port)
|
||||||
static const WCHAR multiauthW[] = {'/','m','u','l','t','i','a','u','t','h',0};
|
static const WCHAR multiauthW[] = {'/','m','u','l','t','i','a','u','t','h',0};
|
||||||
static const WCHAR getW[] = {'G','E','T',0};
|
static const WCHAR getW[] = {'G','E','T',0};
|
||||||
HINTERNET ses, con, req;
|
HINTERNET ses, con, req;
|
||||||
DWORD supported = 10, first = 9, target = 8;
|
DWORD supported, first, target;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0);
|
ses = WinHttpOpen(test_useragent, WINHTTP_ACCESS_TYPE_NO_PROXY, NULL, NULL, 0);
|
||||||
|
@ -2542,11 +2542,12 @@ static void test_multi_authentication(int port)
|
||||||
ret = WinHttpReceiveResponse(req, NULL);
|
ret = WinHttpReceiveResponse(req, NULL);
|
||||||
ok(ret, "expected success\n");
|
ok(ret, "expected success\n");
|
||||||
|
|
||||||
|
supported = first = target = 0xdeadbeef;
|
||||||
ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target);
|
ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target);
|
||||||
todo_wine ok(ret, "expected success\n");
|
ok(ret, "expected success\n");
|
||||||
todo_wine ok(supported == (WINHTTP_AUTH_SCHEME_BASIC | WINHTTP_AUTH_SCHEME_NTLM), "got %x\n", supported);
|
ok(supported == (WINHTTP_AUTH_SCHEME_BASIC | WINHTTP_AUTH_SCHEME_NTLM), "got %x\n", supported);
|
||||||
todo_wine ok(target == WINHTTP_AUTH_TARGET_SERVER, "got %x\n", target);
|
ok(target == WINHTTP_AUTH_TARGET_SERVER, "got %x\n", target);
|
||||||
todo_wine ok(first == 1, "got %x\n", first);
|
ok(first == WINHTTP_AUTH_SCHEME_BASIC, "got %x\n", first);
|
||||||
|
|
||||||
WinHttpCloseHandle(req);
|
WinHttpCloseHandle(req);
|
||||||
WinHttpCloseHandle(con);
|
WinHttpCloseHandle(con);
|
||||||
|
|
Loading…
Reference in New Issue