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
70100d55
Commit
70100d55
authored
10 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
http_digest: Post SSPI support tidy up
Post tidy up to ensure commonality of code style and variable names.
parent
e2828af6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/curl_sasl.c
+6
-6
6 additions, 6 deletions
lib/curl_sasl.c
lib/http_digest.c
+16
-14
16 additions, 14 deletions
lib/http_digest.c
with
22 additions
and
20 deletions
lib/curl_sasl.c
+
6
−
6
View file @
70100d55
...
...
@@ -96,7 +96,7 @@ static int sasl_digest_get_pair(const char *str, char *value, char *content,
for
(
c
=
DIGEST_MAX_VALUE_LENGTH
-
1
;
(
*
str
&&
(
*
str
!=
'='
)
&&
c
--
);
)
*
value
++
=
*
str
++
;
*
value
=
0
;
*
value
=
0
;
if
(
'='
!=
*
str
++
)
/* eek, no match */
...
...
@@ -123,19 +123,19 @@ static int sasl_digest_get_pair(const char *str, char *value, char *content,
if
(
!
starts_with_quote
)
{
/* this signals the end of the content if we didn't get a starting
quote and then we do "sloppy" parsing */
c
=
0
;
/* the end */
c
=
0
;
/* the end */
continue
;
}
break
;
case
'\r'
:
case
'\n'
:
/* end of string */
c
=
0
;
c
=
0
;
continue
;
case
'\"'
:
if
(
!
escape
&&
starts_with_quote
)
{
/* end of string */
c
=
0
;
c
=
0
;
continue
;
}
break
;
...
...
@@ -143,7 +143,7 @@ static int sasl_digest_get_pair(const char *str, char *value, char *content,
escape
=
FALSE
;
*
content
++
=
*
str
;
}
*
content
=
0
;
*
content
=
0
;
*
endptr
=
str
;
...
...
@@ -787,7 +787,7 @@ CURLcode Curl_sasl_decode_digest_http_message(const char *chlg,
free
(
tmp
);
/* Select only auth o auth-int. Otherwise, ignore */
/* Select only auth o
r
auth-int. Otherwise, ignore */
if
(
foundAuth
)
{
digest
->
qop
=
strdup
(
DIGEST_QOP_VALUE_STRING_AUTH
);
if
(
!
digest
->
qop
)
...
...
This diff is collapsed.
Click to expand it.
lib/http_digest.c
+
16
−
14
View file @
70100d55
...
...
@@ -48,14 +48,16 @@ CURLcode Curl_input_digest(struct connectdata *conn,
const
char
*
header
)
/* rest of the *-authenticate:
header */
{
struct
SessionHandle
*
data
=
conn
->
data
;
struct
digestdata
*
d
;
struct
SessionHandle
*
data
=
conn
->
data
;
/* Point to the correct struct with this */
struct
digestdata
*
digest
;
if
(
proxy
)
{
d
=
&
data
->
state
.
proxydigest
;
d
igest
=
&
data
->
state
.
proxydigest
;
}
else
{
d
=
&
data
->
state
.
digest
;
d
igest
=
&
data
->
state
.
digest
;
}
if
(
!
checkprefix
(
"Digest"
,
header
))
...
...
@@ -65,7 +67,7 @@ CURLcode Curl_input_digest(struct connectdata *conn,
while
(
*
header
&&
ISSPACE
(
*
header
))
header
++
;
return
Curl_sasl_decode_digest_http_message
(
header
,
d
);
return
Curl_sasl_decode_digest_http_message
(
header
,
d
igest
);
}
CURLcode
Curl_output_digest
(
struct
connectdata
*
conn
,
...
...
@@ -90,18 +92,18 @@ CURLcode Curl_output_digest(struct connectdata *conn,
const
char
*
passwdp
;
/* Point to the correct struct with this */
struct
digestdata
*
d
;
struct
digestdata
*
d
igest
;
struct
auth
*
authp
;
if
(
proxy
)
{
d
=
&
data
->
state
.
proxydigest
;
d
igest
=
&
data
->
state
.
proxydigest
;
allocuserpwd
=
&
conn
->
allocptr
.
proxyuserpwd
;
userp
=
conn
->
proxyuser
;
passwdp
=
conn
->
proxypasswd
;
authp
=
&
data
->
state
.
authproxy
;
}
else
{
d
=
&
data
->
state
.
digest
;
d
igest
=
&
data
->
state
.
digest
;
allocuserpwd
=
&
conn
->
allocptr
.
userpwd
;
userp
=
conn
->
user
;
passwdp
=
conn
->
passwd
;
...
...
@@ -112,15 +114,15 @@ CURLcode Curl_output_digest(struct connectdata *conn,
/* not set means empty */
if
(
!
userp
)
userp
=
""
;
userp
=
""
;
if
(
!
passwdp
)
passwdp
=
""
;
passwdp
=
""
;
#if defined(USE_WINDOWS_SSPI)
have_chlg
=
d
->
input_token
?
TRUE
:
FALSE
;
have_chlg
=
d
igest
->
input_token
?
TRUE
:
FALSE
;
#else
have_chlg
=
d
->
nonce
?
TRUE
:
FALSE
;
have_chlg
=
d
igest
->
nonce
?
TRUE
:
FALSE
;
#endif
if
(
!
have_chlg
)
{
...
...
@@ -147,13 +149,13 @@ CURLcode Curl_output_digest(struct connectdata *conn,
path
=
(
unsigned
char
*
)
aprintf
(
"%.*s"
,
urilen
,
uripath
);
}
else
path
=
(
unsigned
char
*
)
strdup
((
char
*
)
uripath
);
path
=
(
unsigned
char
*
)
strdup
((
char
*
)
uripath
);
if
(
!
path
)
return
CURLE_OUT_OF_MEMORY
;
result
=
Curl_sasl_create_digest_http_message
(
data
,
userp
,
passwdp
,
request
,
path
,
d
,
&
response
,
&
len
);
path
,
d
igest
,
&
response
,
&
len
);
free
(
path
);
if
(
result
)
return
result
;
...
...
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