From b6117e6e104c1b1a08f3354fb5d152e24875a444 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 8 Sep 2008 22:39:25 +0200 Subject: secur32: Allocate schannel client credentials --- dlls/secur32/schannel.c | 14 ++++++++++++++ dlls/secur32/secur32.c | 2 ++ dlls/secur32/secur32_priv.h | 3 +++ 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index 82a744c..940410d 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -19,8 +19,11 @@ * implementation. */ #include "config.h" +#include "wine/port.h" #include +#include + #include "windef.h" #include "winbase.h" #include "sspi.h" @@ -47,6 +50,7 @@ struct schan_handle struct schan_credentials { ULONG credential_use; + gnutls_certificate_credentials_t credentials; }; static struct schan_handle *schan_handle_table; @@ -273,6 +277,7 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan } creds->credential_use = SECPKG_CRED_OUTBOUND; + gnutls_certificate_allocate_credentials(&creds->credentials); phCredential->dwLower = handle; phCredential->dwUpper = 0; @@ -371,6 +376,7 @@ static SECURITY_STATUS SEC_ENTRY schan_FreeCredentialsHandle( creds = schan_free_handle(phCredential->dwLower, SCHAN_HANDLE_CRED); if (!creds) return SEC_E_INVALID_HANDLE; + gnutls_certificate_free_credentials(creds->credentials); HeapFree(GetProcessHeap(), 0, creds); return SEC_E_OK; @@ -530,12 +536,20 @@ void SECUR32_initSchannelSP(void) schan_handle_table = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 64 * sizeof(*schan_handle_table)); schan_handle_table_size = 64; + + gnutls_global_init(); } } +void SECUR32_deinitSchannelSP(void) +{ + gnutls_global_deinit(); +} + #else /* HAVE_GNUTLS */ void SECUR32_initSchannelSP(void) {} +void SECUR32_deinitSchannelSP(void) {} #endif /* HAVE_GNUTLS */ diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c index d552e13..0087876 100644 --- a/dlls/secur32/secur32.c +++ b/dlls/secur32/secur32.c @@ -673,6 +673,8 @@ static void SECUR32_freeProviders(void) TRACE("\n"); EnterCriticalSection(&cs); + SECUR32_deinitSchannelSP(); + if (packageTable) { LIST_FOR_EACH_ENTRY(package, &packageTable->table, SecurePackage, entry) diff --git a/dlls/secur32/secur32_priv.h b/dlls/secur32/secur32_priv.h index 6f9c1e7..9eed1a5 100644 --- a/dlls/secur32/secur32_priv.h +++ b/dlls/secur32/secur32_priv.h @@ -124,6 +124,9 @@ void SECUR32_initSchannelSP(void); void SECUR32_initNegotiateSP(void); void SECUR32_initNTLMSP(void); +/* Cleanup functions for built-in providers */ +void SECUR32_deinitSchannelSP(void); + /* Functions from dispatcher.c used elsewhere in the code */ SECURITY_STATUS fork_helper(PNegoHelper *new_helper, const char *prog, char * const argv[]); -- 1.5.6.4