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
071f8d41
Commit
071f8d41
authored
12 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
Revert "sspi - Small code tidy up"
This reverts commit
46cd5f1d
.
parent
d8323350
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_sspi.c
+13
-8
13 additions, 8 deletions
lib/curl_sspi.c
with
13 additions
and
8 deletions
lib/curl_sspi.c
+
13
−
8
View file @
071f8d41
...
...
@@ -35,6 +35,7 @@
/* The last #include file should be: */
#include
"memdebug.h"
/* We use our own typedef here since some headers might lack these */
typedef
PSecurityFunctionTableA
(
APIENTRY
*
INITSECURITYINTERFACE_FN_A
)(
VOID
);
...
...
@@ -44,6 +45,7 @@ HMODULE s_hSecDll = NULL;
/* Pointer to SSPI dispatch table */
PSecurityFunctionTableA
s_pSecFn
=
NULL
;
/*
* Curl_sspi_global_init()
*
...
...
@@ -56,17 +58,19 @@ PSecurityFunctionTableA s_pSecFn = NULL;
* called through the Security Service Provider Interface dispatch table.
*/
CURLcode
Curl_sspi_global_init
(
void
)
CURLcode
Curl_sspi_global_init
(
void
)
{
OSVERSIONINFO
osver
;
INITSECURITYINTERFACE_FN_A
pInitSecurityInterface
;
/* If security interface is not yet initialized try to do this */
if
(
!
s_hSecDll
)
{
if
(
s_hSecDll
==
NULL
)
{
/* Find out Windows version */
memset
(
&
osver
,
0
,
sizeof
(
osver
));
osver
.
dwOSVersionInfoSize
=
sizeof
(
osver
);
if
(
!
GetVersionEx
(
&
osver
))
if
(
!
GetVersionEx
(
&
osver
))
return
CURLE_FAILED_INIT
;
/* Security Service Provider Interface (SSPI) functions are located in
...
...
@@ -79,21 +83,21 @@ CURLcode Curl_sspi_global_init(void)
s_hSecDll
=
LoadLibrary
(
"security.dll"
);
else
s_hSecDll
=
LoadLibrary
(
"secur32.dll"
);
if
(
!
s_hSecDll
)
if
(
!
s_hSecDll
)
return
CURLE_FAILED_INIT
;
/* Get address of the InitSecurityInterfaceA function from the SSPI dll */
pInitSecurityInterface
=
(
INITSECURITYINTERFACE_FN_A
)
GetProcAddress
(
s_hSecDll
,
"InitSecurityInterfaceA"
);
if
(
!
pInitSecurityInterface
)
if
(
!
pInitSecurityInterface
)
return
CURLE_FAILED_INIT
;
/* Get pointer to Security Service Provider Interface dispatch table */
s_pSecFn
=
pInitSecurityInterface
();
if
(
!
s_pSecFn
)
if
(
!
s_pSecFn
)
return
CURLE_FAILED_INIT
;
}
}
return
CURLE_OK
;
}
...
...
@@ -166,7 +170,8 @@ CURLcode Curl_sspi_version(int *major, int *minor, int *build, int *special)
* This deinitializes the Security Service Provider Interface from libcurl.
*/
void
Curl_sspi_global_cleanup
(
void
)
void
Curl_sspi_global_cleanup
(
void
)
{
if
(
s_hSecDll
)
{
FreeLibrary
(
s_hSecDll
);
...
...
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