Commit c9dc30ff9149f092b0349d251c0d6b319987bb36

Henning Schaffaf 2018-07-26T09:52:21

Fix default credentials: The WinHttpSetCredentials auth scheme must only be one of the supported schemes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index 4eb8b42..764ac2f 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -184,10 +184,10 @@ static int apply_default_credentials(HINTERNET request, int mechanisms)
 	DWORD native_scheme = 0;
 
 	if ((mechanisms & GIT_WINHTTP_AUTH_NTLM) != 0)
-		native_scheme |= WINHTTP_AUTH_SCHEME_NTLM;
+		native_scheme = WINHTTP_AUTH_SCHEME_NTLM;
 
 	if ((mechanisms & GIT_WINHTTP_AUTH_NEGOTIATE) != 0)
-		native_scheme |= WINHTTP_AUTH_SCHEME_NEGOTIATE;
+		native_scheme = WINHTTP_AUTH_SCHEME_NEGOTIATE;
 
 	if (!native_scheme) {
 		giterr_set(GITERR_NET, "invalid authentication scheme");