ReactOS 0.4.15-dev-8408-g466a198
schannel_priv.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _SecureProvider
 
struct  _SecurePackage
 
struct  schan_credentials
 
struct  schan_buffers
 
struct  schan_transport
 

Typedefs

typedef struct _SecureProvider SecureProvider
 
typedef struct _SecurePackage SecurePackage
 
typedef struct schan_imp_session_opaque * schan_imp_session
 
typedef struct schan_credentials schan_credentials
 

Functions

SecureProviderSECUR32_addProvider (const SecurityFunctionTableA *fnTableA, const SecurityFunctionTableW *fnTableW, PCWSTR moduleName) DECLSPEC_HIDDEN
 
void SECUR32_addPackages (SecureProvider *provider, ULONG toAdd, const SecPkgInfoA *infoA, const SecPkgInfoW *infoW) DECLSPEC_HIDDEN
 
void SECUR32_initSchannelSP (void) DECLSPEC_HIDDEN
 
charschan_get_buffer (const struct schan_transport *t, struct schan_buffers *s, SIZE_T *count) DECLSPEC_HIDDEN
 
int schan_pull (struct schan_transport *t, void *buff, size_t *buff_len) DECLSPEC_HIDDEN
 
int schan_push (struct schan_transport *t, const void *buff, size_t *buff_len) DECLSPEC_HIDDEN
 
schan_imp_session schan_session_for_transport (struct schan_transport *t) DECLSPEC_HIDDEN
 
BOOL schan_imp_create_session (schan_imp_session *session, schan_credentials *cred) DECLSPEC_HIDDEN
 
void schan_imp_dispose_session (schan_imp_session session) DECLSPEC_HIDDEN
 
void schan_imp_set_session_transport (schan_imp_session session, struct schan_transport *t) DECLSPEC_HIDDEN
 
void schan_imp_set_session_target (schan_imp_session session, const char *target) DECLSPEC_HIDDEN
 
SECURITY_STATUS schan_imp_handshake (schan_imp_session session) DECLSPEC_HIDDEN
 
unsigned int schan_imp_get_session_cipher_block_size (schan_imp_session session) DECLSPEC_HIDDEN
 
unsigned int schan_imp_get_max_message_size (schan_imp_session session) DECLSPEC_HIDDEN
 
SECURITY_STATUS schan_imp_get_connection_info (schan_imp_session session, SecPkgContext_ConnectionInfo *info) DECLSPEC_HIDDEN
 
SECURITY_STATUS schan_imp_get_session_peer_certificate (schan_imp_session session, HCERTSTORE, PCCERT_CONTEXT *cert) DECLSPEC_HIDDEN
 
SECURITY_STATUS schan_imp_send (schan_imp_session session, const void *buffer, SIZE_T *length) DECLSPEC_HIDDEN
 
SECURITY_STATUS schan_imp_recv (schan_imp_session session, void *buffer, SIZE_T *length) DECLSPEC_HIDDEN
 
BOOL schan_imp_allocate_certificate_credentials (schan_credentials *) DECLSPEC_HIDDEN
 
void schan_imp_free_certificate_credentials (schan_credentials *) DECLSPEC_HIDDEN
 
DWORD schan_imp_enabled_protocols (void) DECLSPEC_HIDDEN
 
BOOL schan_imp_init (void) DECLSPEC_HIDDEN
 
void schan_imp_deinit (void) DECLSPEC_HIDDEN
 
SECURITY_STATUS WINAPI schan_FreeContextBuffer (PVOID pvoid)
 
SECURITY_STATUS WINAPI schan_EnumerateSecurityPackagesA (PULONG pcPackages, PSecPkgInfoA *ppPackageInfo)
 
SECURITY_STATUS WINAPI schan_EnumerateSecurityPackagesW (PULONG pcPackages, PSecPkgInfoW *ppPackageInfo)
 

Variables

SecurityFunctionTableA schanTableA
 
SecurityFunctionTableW schanTableW
 

Typedef Documentation

◆ schan_credentials

◆ schan_imp_session

typedef struct schan_imp_session_opaque* schan_imp_session

Definition at line 59 of file schannel_priv.h.

◆ SecurePackage

◆ SecureProvider

Function Documentation

◆ schan_EnumerateSecurityPackagesA()

SECURITY_STATUS WINAPI schan_EnumerateSecurityPackagesA ( PULONG  pcPackages,
PSecPkgInfoA ppPackageInfo 
)

Definition at line 199 of file secur32_wine.c.

201{
204
206 if (ret == SEC_E_OK && *pcPackages && info)
207 {
208 *ppPackageInfo = thunk_PSecPkgInfoWToA(*pcPackages, info);
209 if (*pcPackages && !*ppPackageInfo)
210 {
211 *pcPackages = 0;
213 }
215 }
216 return ret;
217}
LONG SECURITY_STATUS
Definition: sspi.h:34
SECURITY_STATUS WINAPI schan_EnumerateSecurityPackagesW(PULONG pcPackages, PSecPkgInfoW *ppPackageInfo)
Definition: secur32_wine.c:58
SECURITY_STATUS WINAPI schan_FreeContextBuffer(PVOID pvoid)
Definition: secur32_wine.c:221
static PSecPkgInfoA thunk_PSecPkgInfoWToA(ULONG cPackages, const SecPkgInfoW *info)
Definition: secur32_wine.c:129
int ret
#define SEC_E_OK
Definition: winerror.h:2356
#define SEC_E_INSUFFICIENT_MEMORY
Definition: winerror.h:2909

◆ schan_EnumerateSecurityPackagesW()

SECURITY_STATUS WINAPI schan_EnumerateSecurityPackagesW ( PULONG  pcPackages,
PSecPkgInfoW ppPackageInfo 
)

Definition at line 58 of file secur32_wine.c.

60{
62
63 TRACE("(%p, %p)\n", pcPackages, ppPackageInfo);
64
65 /* windows just crashes if pcPackages or ppPackageInfo is NULL, so will I */
66 *pcPackages = 0;
68 if (packageTable)
69 {
70 SecurePackage *package;
71 size_t bytesNeeded;
72
73 bytesNeeded = packageTable->numPackages * sizeof(SecPkgInfoW);
75 {
76 if (package->infoW.Name)
77 bytesNeeded += (lstrlenW(package->infoW.Name) + 1) * sizeof(WCHAR);
78 if (package->infoW.Comment)
79 bytesNeeded += (lstrlenW(package->infoW.Comment) + 1) * sizeof(WCHAR);
80 }
81 if (bytesNeeded)
82 {
83 *ppPackageInfo = HeapAlloc(GetProcessHeap(), 0, bytesNeeded);
84 if (*ppPackageInfo)
85 {
86 ULONG i = 0;
87 PWSTR nextString;
88
89 *pcPackages = packageTable->numPackages;
90 nextString = (PWSTR)((PBYTE)*ppPackageInfo +
93 {
94 PSecPkgInfoW pkgInfo = *ppPackageInfo + i++;
95
96 *pkgInfo = package->infoW;
97 if (package->infoW.Name)
98 {
99 TRACE("Name[%d] = %S\n", i - 1, package->infoW.Name);
100 pkgInfo->Name = nextString;
101 lstrcpyW(nextString, package->infoW.Name);
102 nextString += lstrlenW(nextString) + 1;
103 }
104 else
105 pkgInfo->Name = NULL;
106 if (package->infoW.Comment)
107 {
108 TRACE("Comment[%d] = %S\n", i - 1, package->infoW.Comment);
109 pkgInfo->Comment = nextString;
110 lstrcpyW(nextString, package->infoW.Comment);
111 nextString += lstrlenW(nextString) + 1;
112 }
113 else
114 pkgInfo->Comment = NULL;
115 }
116 }
117 else
119 }
120 }
122 TRACE("<-- 0x%08x\n", ret);
123 return ret;
124}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
uint32_t entry
Definition: isohybrid.c:63
BYTE * PBYTE
Definition: pedump.c:66
struct _SecPkgInfoW SecPkgInfoW
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static SecurePackageTable * packageTable
Definition: secur32_wine.c:52
static CRITICAL_SECTION cs
Definition: secur32_wine.c:44
#define TRACE(s)
Definition: solgame.cpp:4
SEC_WCHAR * Comment
Definition: sspi.h:119
SEC_WCHAR * Name
Definition: sspi.h:118
struct list table
Definition: secur32_wine.c:30
SecPkgInfoW infoW
Definition: schannel_priv.h:35
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by schan_EnumerateSecurityPackagesA().

◆ schan_FreeContextBuffer()

SECURITY_STATUS WINAPI schan_FreeContextBuffer ( PVOID  pvoid)

Definition at line 221 of file secur32_wine.c.

224{
225 HeapFree(GetProcessHeap(), 0, pvoid);
226 return SEC_E_OK;
227}
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by schan_EnumerateSecurityPackagesA().

◆ schan_get_buffer()

char * schan_get_buffer ( const struct schan_transport t,
struct schan_buffers s,
SIZE_T count 
)

◆ schan_imp_allocate_certificate_credentials()

BOOL schan_imp_allocate_certificate_credentials ( schan_credentials )

◆ schan_imp_create_session()

BOOL schan_imp_create_session ( schan_imp_session session,
schan_credentials cred 
)

◆ schan_imp_deinit()

void schan_imp_deinit ( void  )

◆ schan_imp_dispose_session()

void schan_imp_dispose_session ( schan_imp_session  session)

◆ schan_imp_enabled_protocols()

DWORD schan_imp_enabled_protocols ( void  )

◆ schan_imp_free_certificate_credentials()

void schan_imp_free_certificate_credentials ( schan_credentials )

◆ schan_imp_get_connection_info()

SECURITY_STATUS schan_imp_get_connection_info ( schan_imp_session  session,
SecPkgContext_ConnectionInfo info 
)

◆ schan_imp_get_max_message_size()

unsigned int schan_imp_get_max_message_size ( schan_imp_session  session)

◆ schan_imp_get_session_cipher_block_size()

unsigned int schan_imp_get_session_cipher_block_size ( schan_imp_session  session)

◆ schan_imp_get_session_peer_certificate()

SECURITY_STATUS schan_imp_get_session_peer_certificate ( schan_imp_session  session,
HCERTSTORE  ,
PCCERT_CONTEXT cert 
)

◆ schan_imp_handshake()

SECURITY_STATUS schan_imp_handshake ( schan_imp_session  session)

◆ schan_imp_init()

BOOL schan_imp_init ( void  )

◆ schan_imp_recv()

SECURITY_STATUS schan_imp_recv ( schan_imp_session  session,
void buffer,
SIZE_T length 
)

◆ schan_imp_send()

SECURITY_STATUS schan_imp_send ( schan_imp_session  session,
const void buffer,
SIZE_T length 
)

◆ schan_imp_set_session_target()

void schan_imp_set_session_target ( schan_imp_session  session,
const char target 
)

◆ schan_imp_set_session_transport()

void schan_imp_set_session_transport ( schan_imp_session  session,
struct schan_transport t 
)

◆ schan_pull()

int schan_pull ( struct schan_transport t,
void buff,
size_t buff_len 
)

◆ schan_push()

int schan_push ( struct schan_transport t,
const void buff,
size_t buff_len 
)

◆ schan_session_for_transport()

schan_imp_session schan_session_for_transport ( struct schan_transport t)

◆ SECUR32_addPackages()

void SECUR32_addPackages ( SecureProvider provider,
ULONG  toAdd,
const SecPkgInfoA infoA,
const SecPkgInfoW infoW 
)

Definition at line 362 of file secur32_wine.c.

364{
365 ULONG i;
366
367 assert(provider);
368 assert(infoA || infoW);
369
371
372 if (!packageTable)
373 {
375 if (!packageTable)
376 {
378 return;
379 }
380
383 }
384
385 for (i = 0; i < toAdd; i++)
386 {
387 SecurePackage *package = HeapAlloc(GetProcessHeap(), 0, sizeof(SecurePackage));
388 if (!package)
389 continue;
390
391 list_add_tail(&packageTable->table, &package->entry);
392
393 package->provider = provider;
394 _copyPackageInfo(&package->infoW,
395 infoA ? &infoA[i] : NULL,
396 infoW ? &infoW[i] : NULL);
397 }
398 packageTable->numPackages += toAdd;
399
401}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
#define assert(x)
Definition: debug.h:53
static const SecPkgInfoW infoW
Definition: kerberos.c:293
static const SecPkgInfoA infoA
Definition: kerberos.c:302
static void _copyPackageInfo(PSecPkgInfoW info, const SecPkgInfoA *inInfoA, const SecPkgInfoW *inInfoW)
Definition: secur32_wine.c:292

Referenced by SECUR32_initKerberosSP(), SECUR32_initNegotiateSP(), and SECUR32_initNTLMSP().

◆ SECUR32_addProvider()

SecureProvider * SECUR32_addProvider ( const SecurityFunctionTableA fnTableA,
const SecurityFunctionTableW fnTableW,
PCWSTR  moduleName 
)

Definition at line 314 of file secur32_wine.c.

316{
318
320
321 if (!providerTable)
322 {
324 if (!providerTable)
325 {
327 return NULL;
328 }
329
331 }
332
334 if (!ret)
335 {
337 return NULL;
338 }
339
341 ret->lib = NULL;
342
343#ifndef __REACTOS__
344 if (fnTableA || fnTableW)
345 {
346 ret->moduleName = moduleName ? SECUR32_strdupW(moduleName) : NULL;
347 _makeFnTableA(&ret->fnTableA, fnTableA, fnTableW);
348 _makeFnTableW(&ret->fnTableW, fnTableA, fnTableW);
349 ret->loaded = !moduleName;
350 }
351 else
352#endif
353 {
354 ret->moduleName = SECUR32_strdupW(moduleName);
355 ret->loaded = FALSE;
356 }
357
359 return ret;
360}
#define FALSE
Definition: types.h:117
static PWSTR SECUR32_strdupW(PCWSTR str)
Definition: secur32_wine.c:231
static SecureProviderTable * providerTable
Definition: secur32_wine.c:53
static void _makeFnTableA(PSecurityFunctionTableA fnTableA, const SecurityFunctionTableA *inFnTableA, const SecurityFunctionTableW *inFnTableW)
Definition: sspi.c:199
static void _makeFnTableW(PSecurityFunctionTableW fnTableW, const SecurityFunctionTableA *inFnTableA, const SecurityFunctionTableW *inFnTableW)
Definition: sspi.c:270

Referenced by SECUR32_initKerberosSP(), SECUR32_initNegotiateSP(), and SECUR32_initNTLMSP().

◆ SECUR32_initSchannelSP()

void SECUR32_initSchannelSP ( void  )

Definition at line 1473 of file schannel_wine.c.

1474{
1475 ERR("TLS library not found, SSL connections will fail\n");
1476}
#define ERR(fmt,...)
Definition: precomp.h:57

Referenced by DllMain().

Variable Documentation

◆ schanTableA

SecurityFunctionTableA schanTableA
extern

◆ schanTableW

SecurityFunctionTableW schanTableW
extern