Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fde1e003
Commit
fde1e003
authored
Sep 22, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
secur32: Allocate schannel client credentials.
parent
7176dc26
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
2 deletions
+58
-2
schannel.c
dlls/secur32/schannel.c
+53
-2
secur32.c
dlls/secur32/secur32.c
+2
-0
secur32_priv.h
dlls/secur32/secur32_priv.h
+3
-0
No files found.
dlls/secur32/schannel.c
View file @
fde1e003
...
@@ -19,19 +19,33 @@
...
@@ -19,19 +19,33 @@
* implementation.
* implementation.
*/
*/
#include "config.h"
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdarg.h>
#ifdef SONAME_LIBGNUTLS
#include <gnutls/gnutls.h>
#endif
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "sspi.h"
#include "sspi.h"
#include "schannel.h"
#include "schannel.h"
#include "secur32_priv.h"
#include "secur32_priv.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/library.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
secur32
);
WINE_DEFAULT_DEBUG_CHANNEL
(
secur32
);
#ifdef SONAME_LIBGNUTLS
#ifdef SONAME_LIBGNUTLS
static
void
*
libgnutls_handle
;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
MAKE_FUNCPTR
(
gnutls_certificate_allocate_credentials
);
MAKE_FUNCPTR
(
gnutls_certificate_free_credentials
);
MAKE_FUNCPTR
(
gnutls_global_deinit
);
MAKE_FUNCPTR
(
gnutls_global_init
);
#undef MAKE_FUNCPTR
enum
schan_handle_type
enum
schan_handle_type
{
{
SCHAN_HANDLE_CRED
,
SCHAN_HANDLE_CRED
,
...
@@ -47,6 +61,7 @@ struct schan_handle
...
@@ -47,6 +61,7 @@ struct schan_handle
struct
schan_credentials
struct
schan_credentials
{
{
ULONG
credential_use
;
ULONG
credential_use
;
gnutls_certificate_credentials_t
credentials
;
};
};
static
struct
schan_handle
*
schan_handle_table
;
static
struct
schan_handle
*
schan_handle_table
;
...
@@ -273,6 +288,7 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan
...
@@ -273,6 +288,7 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan
}
}
creds
->
credential_use
=
SECPKG_CRED_OUTBOUND
;
creds
->
credential_use
=
SECPKG_CRED_OUTBOUND
;
pgnutls_certificate_allocate_credentials
(
&
creds
->
credentials
);
phCredential
->
dwLower
=
handle
;
phCredential
->
dwLower
=
handle
;
phCredential
->
dwUpper
=
0
;
phCredential
->
dwUpper
=
0
;
...
@@ -371,6 +387,8 @@ static SECURITY_STATUS SEC_ENTRY schan_FreeCredentialsHandle(
...
@@ -371,6 +387,8 @@ static SECURITY_STATUS SEC_ENTRY schan_FreeCredentialsHandle(
creds
=
schan_free_handle
(
phCredential
->
dwLower
,
SCHAN_HANDLE_CRED
);
creds
=
schan_free_handle
(
phCredential
->
dwLower
,
SCHAN_HANDLE_CRED
);
if
(
!
creds
)
return
SEC_E_INVALID_HANDLE
;
if
(
!
creds
)
return
SEC_E_INVALID_HANDLE
;
if
(
creds
->
credential_use
==
SECPKG_CRED_OUTBOUND
)
pgnutls_certificate_free_credentials
(
creds
->
credentials
);
HeapFree
(
GetProcessHeap
(),
0
,
creds
);
HeapFree
(
GetProcessHeap
(),
0
,
creds
);
return
SEC_E_OK
;
return
SEC_E_OK
;
...
@@ -496,8 +514,32 @@ static const WCHAR schannelDllName[] = { 's','c','h','a','n','n','e','l','.','d'
...
@@ -496,8 +514,32 @@ static const WCHAR schannelDllName[] = { 's','c','h','a','n','n','e','l','.','d'
void
SECUR32_initSchannelSP
(
void
)
void
SECUR32_initSchannelSP
(
void
)
{
{
SecureProvider
*
provider
=
SECUR32_addProvider
(
&
schanTableA
,
&
schanTableW
,
SecureProvider
*
provider
;
schannelDllName
);
libgnutls_handle
=
wine_dlopen
(
SONAME_LIBGNUTLS
,
RTLD_NOW
,
NULL
,
0
);
if
(
!
libgnutls_handle
)
{
WARN
(
"Failed to load libgnutls.
\n
"
);
return
;
}
#define LOAD_FUNCPTR(f) \
if (!(p##f = wine_dlsym(libgnutls_handle, #f, NULL, 0))) \
{ \
ERR("Failed to load %s\n", #f); \
wine_dlclose(libgnutls_handle, NULL, 0); \
libgnutls_handle = NULL; \
return; \
}
LOAD_FUNCPTR
(
gnutls_certificate_allocate_credentials
)
LOAD_FUNCPTR
(
gnutls_certificate_free_credentials
)
LOAD_FUNCPTR
(
gnutls_global_deinit
)
LOAD_FUNCPTR
(
gnutls_global_init
)
#undef LOAD_FUNCPTR
provider
=
SECUR32_addProvider
(
&
schanTableA
,
&
schanTableW
,
schannelDllName
);
if
(
provider
)
if
(
provider
)
{
{
...
@@ -530,11 +572,20 @@ void SECUR32_initSchannelSP(void)
...
@@ -530,11 +572,20 @@ void SECUR32_initSchannelSP(void)
schan_handle_table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
64
*
sizeof
(
*
schan_handle_table
));
schan_handle_table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
64
*
sizeof
(
*
schan_handle_table
));
schan_handle_table_size
=
64
;
schan_handle_table_size
=
64
;
pgnutls_global_init
();
}
}
}
}
void
SECUR32_deinitSchannelSP
(
void
)
{
pgnutls_global_deinit
();
if
(
libgnutls_handle
)
wine_dlclose
(
libgnutls_handle
,
NULL
,
0
);
}
#else
/* SONAME_LIBGNUTLS */
#else
/* SONAME_LIBGNUTLS */
void
SECUR32_initSchannelSP
(
void
)
{}
void
SECUR32_initSchannelSP
(
void
)
{}
void
SECUR32_deinitSchannelSP
(
void
)
{}
#endif
/* SONAME_LIBGNUTLS */
#endif
/* SONAME_LIBGNUTLS */
dlls/secur32/secur32.c
View file @
fde1e003
...
@@ -673,6 +673,8 @@ static void SECUR32_freeProviders(void)
...
@@ -673,6 +673,8 @@ static void SECUR32_freeProviders(void)
TRACE
(
"
\n
"
);
TRACE
(
"
\n
"
);
EnterCriticalSection
(
&
cs
);
EnterCriticalSection
(
&
cs
);
SECUR32_deinitSchannelSP
();
if
(
packageTable
)
if
(
packageTable
)
{
{
LIST_FOR_EACH_ENTRY
(
package
,
&
packageTable
->
table
,
SecurePackage
,
entry
)
LIST_FOR_EACH_ENTRY
(
package
,
&
packageTable
->
table
,
SecurePackage
,
entry
)
...
...
dlls/secur32/secur32_priv.h
View file @
fde1e003
...
@@ -124,6 +124,9 @@ void SECUR32_initSchannelSP(void);
...
@@ -124,6 +124,9 @@ void SECUR32_initSchannelSP(void);
void
SECUR32_initNegotiateSP
(
void
);
void
SECUR32_initNegotiateSP
(
void
);
void
SECUR32_initNTLMSP
(
void
);
void
SECUR32_initNTLMSP
(
void
);
/* Cleanup functions for built-in providers */
void
SECUR32_deinitSchannelSP
(
void
);
/* Functions from dispatcher.c used elsewhere in the code */
/* Functions from dispatcher.c used elsewhere in the code */
SECURITY_STATUS
fork_helper
(
PNegoHelper
*
new_helper
,
const
char
*
prog
,
SECURITY_STATUS
fork_helper
(
PNegoHelper
*
new_helper
,
const
char
*
prog
,
char
*
const
argv
[]);
char
*
const
argv
[]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment