Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
7610638e
Unverified
Commit
7610638e
authored
Jan 01, 2018
by
Edward Thomson
Committed by
GitHub
Jan 01, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4453 from libgit2/ethomson/spnego
winhttp: properly support ntlm and negotiate
parents
d6210245
526dea1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
src/transports/winhttp.c
+13
-4
No files found.
src/transports/winhttp.c
View file @
7610638e
...
...
@@ -172,9 +172,15 @@ static int apply_default_credentials(HINTERNET request, int mechanisms)
* is "medium" which applies to the intranet and sounds like it would correspond
* to Internet Explorer security zones, but in fact does not. */
DWORD
data
=
WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW
;
DWORD
native_scheme
=
0
;
if
((
mechanisms
&
GIT_WINHTTP_AUTH_NTLM
)
==
0
&&
(
mechanisms
&
GIT_WINHTTP_AUTH_NEGOTIATE
)
==
0
)
{
if
((
mechanisms
&
GIT_WINHTTP_AUTH_NTLM
)
!=
0
)
native_scheme
|=
WINHTTP_AUTH_SCHEME_NTLM
;
if
((
mechanisms
&
GIT_WINHTTP_AUTH_NEGOTIATE
)
!=
0
)
native_scheme
|=
WINHTTP_AUTH_SCHEME_NEGOTIATE
;
if
(
!
native_scheme
)
{
giterr_set
(
GITERR_NET
,
"invalid authentication scheme"
);
return
-
1
;
}
...
...
@@ -182,6 +188,9 @@ static int apply_default_credentials(HINTERNET request, int mechanisms)
if
(
!
WinHttpSetOption
(
request
,
WINHTTP_OPTION_AUTOLOGON_POLICY
,
&
data
,
sizeof
(
DWORD
)))
return
-
1
;
if
(
!
WinHttpSetCredentials
(
request
,
WINHTTP_AUTH_TARGET_SERVER
,
native_scheme
,
NULL
,
NULL
,
NULL
))
return
-
1
;
return
0
;
}
...
...
@@ -606,12 +615,12 @@ static int parse_unauthorized_response(
if
(
WINHTTP_AUTH_SCHEME_NTLM
&
supported
)
{
*
allowed_types
|=
GIT_CREDTYPE_USERPASS_PLAINTEXT
;
*
allowed_types
|=
GIT_CREDTYPE_DEFAULT
;
*
allowed_mechanisms
=
GIT_WINHTTP_AUTH_NEGOTIATE
;
*
allowed_mechanisms
|=
GIT_WINHTTP_AUTH_NTLM
;
}
if
(
WINHTTP_AUTH_SCHEME_NEGOTIATE
&
supported
)
{
*
allowed_types
|=
GIT_CREDTYPE_DEFAULT
;
*
allowed_mechanisms
=
GIT_WINHTTP_AUTH_NEGOTIATE
;
*
allowed_mechanisms
|
=
GIT_WINHTTP_AUTH_NEGOTIATE
;
}
if
(
WINHTTP_AUTH_SCHEME_BASIC
&
supported
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment