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
b4bd5e84
Commit
b4bd5e84
authored
Feb 09, 2017
by
Edward Thomson
Committed by
GitHub
Feb 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4104 from cbargren/fix/windows-digest-proxy
Fix digest credentials for proxy in windows
parents
be249bca
1e929eb5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
src/transports/winhttp.c
+14
-3
No files found.
src/transports/winhttp.c
View file @
b4bd5e84
...
@@ -70,6 +70,7 @@ typedef enum {
...
@@ -70,6 +70,7 @@ typedef enum {
GIT_WINHTTP_AUTH_BASIC
=
1
,
GIT_WINHTTP_AUTH_BASIC
=
1
,
GIT_WINHTTP_AUTH_NTLM
=
2
,
GIT_WINHTTP_AUTH_NTLM
=
2
,
GIT_WINHTTP_AUTH_NEGOTIATE
=
4
,
GIT_WINHTTP_AUTH_NEGOTIATE
=
4
,
GIT_WINHTTP_AUTH_DIGEST
=
8
,
}
winhttp_authmechanism_t
;
}
winhttp_authmechanism_t
;
typedef
struct
{
typedef
struct
{
...
@@ -131,8 +132,13 @@ done:
...
@@ -131,8 +132,13 @@ done:
return
error
;
return
error
;
}
}
static
int
apply_userpass_credential_proxy
(
HINTERNET
request
,
git_cred
*
cred
)
static
int
apply_userpass_credential_proxy
(
HINTERNET
request
,
git_cred
*
cred
,
int
mechanisms
)
{
{
if
(
GIT_WINHTTP_AUTH_DIGEST
&
mechanisms
)
{
return
_apply_userpass_credential
(
request
,
WINHTTP_AUTH_TARGET_PROXY
,
WINHTTP_AUTH_SCHEME_DIGEST
,
cred
);
}
return
_apply_userpass_credential
(
request
,
WINHTTP_AUTH_TARGET_PROXY
,
return
_apply_userpass_credential
(
request
,
WINHTTP_AUTH_TARGET_PROXY
,
WINHTTP_AUTH_SCHEME_BASIC
,
cred
);
WINHTTP_AUTH_SCHEME_BASIC
,
cred
);
}
}
...
@@ -451,7 +457,7 @@ static int winhttp_stream_connect(winhttp_stream *s)
...
@@ -451,7 +457,7 @@ static int winhttp_stream_connect(winhttp_stream *s)
if
(
t
->
proxy_cred
)
{
if
(
t
->
proxy_cred
)
{
if
(
t
->
proxy_cred
->
credtype
==
GIT_CREDTYPE_USERPASS_PLAINTEXT
)
{
if
(
t
->
proxy_cred
->
credtype
==
GIT_CREDTYPE_USERPASS_PLAINTEXT
)
{
if
((
error
=
apply_userpass_credential_proxy
(
s
->
request
,
t
->
proxy_cred
))
<
0
)
if
((
error
=
apply_userpass_credential_proxy
(
s
->
request
,
t
->
proxy_cred
,
t
->
auth_mechanisms
))
<
0
)
goto
on_error
;
goto
on_error
;
}
}
}
}
...
@@ -612,6 +618,11 @@ static int parse_unauthorized_response(
...
@@ -612,6 +618,11 @@ static int parse_unauthorized_response(
*
allowed_mechanisms
|=
GIT_WINHTTP_AUTH_BASIC
;
*
allowed_mechanisms
|=
GIT_WINHTTP_AUTH_BASIC
;
}
}
if
(
WINHTTP_AUTH_SCHEME_DIGEST
&
supported
)
{
*
allowed_types
|=
GIT_CREDTYPE_USERPASS_PLAINTEXT
;
*
allowed_mechanisms
|=
GIT_WINHTTP_AUTH_DIGEST
;
}
return
0
;
return
0
;
}
}
...
@@ -1072,7 +1083,7 @@ replay:
...
@@ -1072,7 +1083,7 @@ replay:
/* TODO: extract the username from the url, no payload? */
/* TODO: extract the username from the url, no payload? */
if
(
t
->
owner
->
proxy
.
credentials
)
{
if
(
t
->
owner
->
proxy
.
credentials
)
{
int
cred_error
=
1
;
int
cred_error
=
1
;
cred_error
=
t
->
owner
->
proxy
.
credentials
(
&
t
->
proxy_cred
,
t
->
owner
->
proxy
.
url
,
NULL
,
allowed_types
,
NULL
);
cred_error
=
t
->
owner
->
proxy
.
credentials
(
&
t
->
proxy_cred
,
t
->
owner
->
proxy
.
url
,
NULL
,
allowed_types
,
t
->
owner
->
proxy
.
payload
);
if
(
cred_error
<
0
)
if
(
cred_error
<
0
)
return
cred_error
;
return
cred_error
;
...
...
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