Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
44031f32
Commit
44031f32
authored
21 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
added one assert and a few comments describing how the auth stuff works
parent
72372211
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/http.c
+25
-7
25 additions, 7 deletions
lib/http.c
with
25 additions
and
7 deletions
lib/http.c
+
25
−
7
View file @
44031f32
...
...
@@ -158,11 +158,19 @@ static CURLcode Curl_output_basic_proxy(struct connectdata *conn)
return
CURLE_OK
;
}
/*
* Curl_http_auth_act() checks what authentication methods that are available
* and decides which one (if any) to use. It will set 'newurl' if an auth
* metod was picked.
*/
void
Curl_http_auth_act
(
struct
connectdata
*
conn
)
{
struct
SessionHandle
*
data
=
conn
->
data
;
if
(
data
->
state
.
authavail
)
{
/* The order of these checks is highly relevant, as this will be the order
of preference in case of the existance of multiple accepted types. */
if
(
data
->
state
.
authavail
&
CURLAUTH_GSSNEGOTIATE
)
data
->
state
.
authwant
=
CURLAUTH_GSSNEGOTIATE
;
else
if
(
data
->
state
.
authavail
&
CURLAUTH_DIGEST
)
...
...
@@ -341,6 +349,15 @@ CURLcode Curl_http_auth(struct connectdata *conn,
while
(
*
start
&&
isspace
((
int
)
*
start
))
start
++
;
/*
* Here we check if we want the specific single authentiction (using ==) and
* if we do, we initiate usage of it.
*
* If the provided authentication is wanted as one out of several accepted
* types (using &), we OR this authenticaion type to the authavail
* variable.
*/
#ifdef HAVE_GSSAPI
if
(
checkprefix
(
"GSS-Negotiate"
,
start
)
||
checkprefix
(
"Negotiate"
,
start
))
{
...
...
@@ -1013,14 +1030,15 @@ CURLcode Curl_http_done(struct connectdata *conn)
void
Curl_http_auth_stage
(
struct
SessionHandle
*
data
,
int
stage
)
{
if
(
stage
==
401
)
data
->
state
.
authwant
=
data
->
set
.
httpauth
;
else
if
(
stage
==
407
)
data
->
state
.
authwant
=
data
->
set
.
proxyauth
;
else
return
;
/* bad input stage */
curlassert
((
stage
==
401
)
||
(
stage
==
407
));
/* We set none, one or more bits for which authentication types we accept
for this stage. */
data
->
state
.
authwant
=
(
stage
==
401
)
?
data
->
set
.
httpauth
:
data
->
set
.
proxyauth
;
data
->
state
.
authstage
=
stage
;
data
->
state
.
authavail
=
CURLAUTH_NONE
;
data
->
state
.
authavail
=
CURLAUTH_NONE
;
/* no type available yet */
}
CURLcode
Curl_http
(
struct
connectdata
*
conn
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment