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
bd3df5ec
Commit
bd3df5ec
authored
10 years ago
by
Marcel Raad
Committed by
Steve Holme
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
sasl_sspi: Fixed Unicode build
Bug:
http://curl.haxx.se/bug/view.cgi?id=1422
Verified-by: Steve Holme
parent
06b27ea2
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/curl_sasl_sspi.c
+15
-6
15 additions, 6 deletions
lib/curl_sasl_sspi.c
with
15 additions
and
6 deletions
lib/curl_sasl_sspi.c
+
15
−
6
View file @
bd3df5ec
...
...
@@ -85,8 +85,7 @@ TCHAR *Curl_sasl_build_spn(const char *service, const char *host)
}
/* Release the UTF8 variant when operating with Unicode */
if
(
utf8_spn
!=
tchar_spn
)
Curl_safefree
(
utf8_spn
);
Curl_unicodefree
(
utf8_spn
);
/* Return our newly allocated SPN */
return
tchar_spn
;
...
...
@@ -485,8 +484,7 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
SecPkgContext_Sizes
sizes
;
SecPkgCredentials_Names
names
;
SECURITY_STATUS
status
;
/* TODO: Verify the unicodeness of this function */
char
*
user_name
;
/* Decode the base-64 encoded input message */
if
(
strlen
(
chlg64
)
&&
*
chlg64
!=
'='
)
{
...
...
@@ -577,12 +575,22 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
return
CURLE_OUT_OF_MEMORY
;
}
/* Convert the user name to UTF8 when operating with Unicode */
user_name
=
Curl_convert_tchar_to_UTF8
(
names
.
sUserName
);
if
(
!
user_name
)
{
Curl_safefree
(
trailer
);
Curl_safefree
(
chlg
);
return
CURLE_OUT_OF_MEMORY
;
}
/* Allocate our message */
messagelen
=
4
+
strlen
(
names
.
sU
ser
N
ame
)
+
1
;
messagelen
=
4
+
strlen
(
u
ser
_n
ame
)
+
1
;
message
=
malloc
(
messagelen
);
if
(
!
message
)
{
Curl_safefree
(
trailer
);
Curl_safefree
(
chlg
);
Curl_unicodefree
(
user_name
);
return
CURLE_OUT_OF_MEMORY
;
}
...
...
@@ -593,7 +601,8 @@ CURLcode Curl_sasl_create_gssapi_security_message(struct SessionHandle *data,
identity is not terminated with the zero-valued (%x00) octet." it seems
necessary to include it. */
memcpy
(
message
,
&
outdata
,
4
);
strcpy
((
char
*
)
message
+
4
,
names
.
sUserName
);
strcpy
((
char
*
)
message
+
4
,
user_name
);
Curl_unicodefree
(
user_name
);
/* Allocate the padding */
padding
=
malloc
(
sizes
.
cbBlockSize
);
...
...
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