Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
847cc51d
Commit
847cc51d
authored
May 21, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
May 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Implement basic non-proxy authentication.
parent
4b507685
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
5 deletions
+27
-5
http.c
dlls/wininet/http.c
+27
-5
No files found.
dlls/wininet/http.c
View file @
847cc51d
...
...
@@ -424,9 +424,13 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue
{
SECURITY_STATUS
sec_status
;
struct
HttpAuthInfo
*
pAuthInfo
=
lpwhr
->
pAuthInfo
;
LPWSTR
password
=
lpwhr
->
lpHttpSession
->
lpszPassword
;
LPWSTR
domain_and_username
=
lpwhr
->
lpHttpSession
->
lpszUserName
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
pszAuthValue
));
if
(
!
domain_and_username
)
return
FALSE
;
if
(
!
pAuthInfo
)
{
TimeStamp
exp
;
...
...
@@ -452,13 +456,13 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue
if
(
!
is_basic_auth_value
(
pszAuthValue
))
{
SEC_WINNT_AUTH_IDENTITY_W
nt_auth_identity
;
WCHAR
*
user
=
strchrW
(
lpwhr
->
lpHttpSession
->
lpszUserN
ame
,
'\\'
);
WCHAR
*
domain
=
lpwhr
->
lpHttpSession
->
lpszUserN
ame
;
WCHAR
*
user
=
strchrW
(
domain_and_usern
ame
,
'\\'
);
WCHAR
*
domain
=
domain_and_usern
ame
;
if
(
user
)
user
++
;
else
{
user
=
lpwhr
->
lpHttpSession
->
lpszUserN
ame
;
user
=
domain_and_usern
ame
;
domain
=
NULL
;
}
nt_auth_identity
.
Flags
=
SEC_WINNT_AUTH_IDENTITY_UNICODE
;
...
...
@@ -466,7 +470,7 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue
nt_auth_identity
.
UserLength
=
strlenW
(
nt_auth_identity
.
User
);
nt_auth_identity
.
Domain
=
domain
;
nt_auth_identity
.
DomainLength
=
domain
?
user
-
domain
-
1
:
0
;
nt_auth_identity
.
Password
=
lpwhr
->
lpHttpSession
->
lpszP
assword
;
nt_auth_identity
.
Password
=
p
assword
;
nt_auth_identity
.
PasswordLength
=
strlenW
(
nt_auth_identity
.
Password
);
/* FIXME: make sure scheme accepts SEC_WINNT_AUTH_IDENTITY before calling AcquireCredentialsHandle */
...
...
@@ -500,8 +504,26 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue
if
(
is_basic_auth_value
(
pszAuthValue
))
{
FIXME
(
"do basic authentication
\n
"
);
int
userlen
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
domain_and_username
,
lstrlenW
(
domain_and_username
),
NULL
,
0
,
NULL
,
NULL
);
int
passlen
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
password
,
lstrlenW
(
password
),
NULL
,
0
,
NULL
,
NULL
);
char
*
auth_data
;
TRACE
(
"basic authentication
\n
"
);
/* length includes a nul terminator, which will be re-used for the ':' */
auth_data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
userlen
+
1
+
passlen
);
if
(
!
auth_data
)
return
FALSE
;
WideCharToMultiByte
(
CP_UTF8
,
0
,
domain_and_username
,
-
1
,
auth_data
,
userlen
,
NULL
,
NULL
);
auth_data
[
userlen
]
=
':'
;
WideCharToMultiByte
(
CP_UTF8
,
0
,
password
,
-
1
,
&
auth_data
[
userlen
+
1
],
passlen
,
NULL
,
NULL
);
pAuthInfo
->
auth_data
=
auth_data
;
pAuthInfo
->
auth_data_len
=
userlen
+
1
+
passlen
;
pAuthInfo
->
finished
=
TRUE
;
return
TRUE
;
}
else
{
...
...
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