Commit 6b6ffb39 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp: Ignore unknown schemes in WinHttpQueryAuthSchemes.

parent 72d27158
......@@ -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 )
{
DWORD index = 0;
DWORD index = 0, supported_schemes = 0, first_scheme = 0;
BOOL ret = FALSE;
for (;;)
......@@ -1332,15 +1332,19 @@ static BOOL query_auth_schemes( request_t *request, DWORD level, LPDWORD support
}
scheme = auth_scheme_from_header( buffer );
heap_free( buffer );
if (!scheme) break;
if (!scheme) continue;
if (first && index == 1)
*first = *supported = scheme;
else
*supported |= scheme;
if (!first_scheme) first_scheme = scheme;
supported_schemes |= scheme;
ret = TRUE;
}
if (ret)
{
*supported = supported_schemes;
*first = first_scheme;
}
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 getW[] = {'G','E','T',0};
HINTERNET ses, con, req;
DWORD supported = 10, first = 9, target = 8;
DWORD supported, first, target;
BOOL ret;
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);
ok(ret, "expected success\n");
supported = first = target = 0xdeadbeef;
ret = WinHttpQueryAuthSchemes(req, &supported, &first, &target);
todo_wine ok(ret, "expected success\n");
todo_wine 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);
todo_wine ok(first == 1, "got %x\n", first);
ok(ret, "expected success\n");
ok(supported == (WINHTTP_AUTH_SCHEME_BASIC | WINHTTP_AUTH_SCHEME_NTLM), "got %x\n", supported);
ok(target == WINHTTP_AUTH_TARGET_SERVER, "got %x\n", target);
ok(first == WINHTTP_AUTH_SCHEME_BASIC, "got %x\n", first);
WinHttpCloseHandle(req);
WinHttpCloseHandle(con);
......
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