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
c260c9fa
Commit
c260c9fa
authored
10 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
curl_sasl: Minor code policing following recent commits
parent
731e6a66
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
+11
-8
11 additions, 8 deletions
lib/curl_sasl.c
lib/curl_sasl.h
+1
-1
1 addition, 1 deletion
lib/curl_sasl.h
with
12 additions
and
9 deletions
lib/curl_sasl.c
+
11
−
8
View file @
c260c9fa
...
...
@@ -54,7 +54,7 @@
/* Supported mechanisms */
const
struct
{
const
char
*
name
;
/* Name */
const
char
*
name
;
/* Name */
size_t
len
;
/* Name length */
unsigned
int
bit
;
/* Flag bit */
}
mechtable
[]
=
{
...
...
@@ -92,7 +92,6 @@ const struct {
return result; \
}
/*
* Return 0 on success and then the buffers are filled in fine.
*
...
...
@@ -1212,8 +1211,7 @@ void Curl_sasl_cleanup(struct connectdata *conn, unsigned int authused)
*
* Return the SASL mechanism token or 0 if no match.
*/
unsigned
int
Curl_sasl_decode_mech
(
const
char
*
ptr
,
size_t
maxlen
,
size_t
*
len
)
unsigned
int
Curl_sasl_decode_mech
(
const
char
*
ptr
,
size_t
maxlen
,
size_t
*
len
)
{
unsigned
int
i
;
char
c
;
...
...
@@ -1223,8 +1221,10 @@ Curl_sasl_decode_mech(const char *ptr, size_t maxlen, size_t *len)
!
memcmp
(
ptr
,
mechtable
[
i
].
name
,
mechtable
[
i
].
len
))
{
if
(
len
)
*
len
=
mechtable
[
i
].
len
;
if
(
maxlen
==
mechtable
[
i
].
len
)
return
mechtable
[
i
].
bit
;
c
=
ptr
[
mechtable
[
i
].
len
];
if
(
!
ISUPPER
(
c
)
&&
!
ISDIGIT
(
c
)
&&
c
!=
'-'
&&
c
!=
'_'
)
return
mechtable
[
i
].
bit
;
...
...
@@ -1244,7 +1244,7 @@ CURLcode Curl_sasl_parse_url_auth_option(struct SASL *sasl,
{
CURLcode
result
=
CURLE_OK
;
unsigned
int
mechbit
;
size_t
l
len
;
size_t
mech
len
;
if
(
!
len
)
return
CURLE_URL_MALFORMAT
;
...
...
@@ -1256,8 +1256,8 @@ CURLcode Curl_sasl_parse_url_auth_option(struct SASL *sasl,
if
(
strnequal
(
value
,
"*"
,
len
))
sasl
->
prefmech
=
SASL_AUTH_ANY
;
else
if
((
mechbit
=
Curl_sasl_decode_mech
(
value
,
len
,
&
l
len
))
&&
l
len
==
len
)
else
if
((
mechbit
=
Curl_sasl_decode_mech
(
value
,
len
,
&
mech
len
))
&&
mech
len
==
len
)
sasl
->
prefmech
|=
mechbit
;
else
result
=
CURLE_URL_MALFORMAT
;
...
...
@@ -1434,6 +1434,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
}
Curl_safefree
(
resp
);
return
result
;
}
...
...
@@ -1443,7 +1444,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
* Continue an SASL authentication.
*/
CURLcode
Curl_sasl_continue
(
struct
SASL
*
sasl
,
struct
connectdata
*
conn
,
int
code
,
saslprogress
*
progress
)
int
code
,
saslprogress
*
progress
)
{
CURLcode
result
=
CURLE_OK
;
struct
SessionHandle
*
data
=
conn
->
data
;
...
...
@@ -1602,6 +1603,8 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn,
}
Curl_safefree
(
resp
);
state
(
sasl
,
conn
,
newstate
);
return
result
;
}
This diff is collapsed.
Click to expand it.
lib/curl_sasl.h
+
1
−
1
View file @
c260c9fa
...
...
@@ -234,6 +234,6 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
/* Continue an SASL authentication */
CURLcode
Curl_sasl_continue
(
struct
SASL
*
sasl
,
struct
connectdata
*
conn
,
int
code
,
saslprogress
*
progress
);
int
code
,
saslprogress
*
progress
);
#endif
/* HEADER_CURL_SASL_H */
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