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
ba55592f
Unverified
Commit
ba55592f
authored
Aug 02, 2018
by
Edward Thomson
Committed by
GitHub
Aug 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4743 from Agent00Log/dev/winbugfixes
Windows: default credentials / fallback credential handling
parents
209c3fe1
ccbffbae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
src/transports/winhttp.c
+9
-4
No files found.
src/transports/winhttp.c
View file @
ba55592f
...
...
@@ -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"
);
...
...
@@ -219,6 +219,7 @@ static int fallback_cred_acquire_cb(
* as an authentication mechanism */
if
(
GIT_CREDTYPE_DEFAULT
&
allowed_types
)
{
wchar_t
*
wide_url
;
HRESULT
hCoInitResult
;
/* Convert URL to wide characters */
if
(
git__utf8_to_16_alloc
(
&
wide_url
,
url
)
<
0
)
{
...
...
@@ -226,7 +227,9 @@ static int fallback_cred_acquire_cb(
return
-
1
;
}
if
(
SUCCEEDED
(
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
)))
{
hCoInitResult
=
CoInitializeEx
(
NULL
,
COINIT_MULTITHREADED
);
if
(
SUCCEEDED
(
hCoInitResult
)
||
hCoInitResult
==
RPC_E_CHANGED_MODE
)
{
IInternetSecurityManager
*
pISM
;
/* And if the target URI is in the My Computer, Intranet, or Trusted zones */
...
...
@@ -250,7 +253,9 @@ static int fallback_cred_acquire_cb(
pISM
->
lpVtbl
->
Release
(
pISM
);
}
CoUninitialize
();
if
(
SUCCEEDED
(
hCoInitResult
))
/* Only unitialize if the call to CoInitializeEx was successful. */
CoUninitialize
();
}
git__free
(
wide_url
);
...
...
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