27#if defined(SONAME_LIBGNUTLS) || defined (HAVE_SECURITY_SECURITY_H) || defined (SONAME_LIBMBEDTLS)
29#define SCHAN_INVALID_HANDLE ~0UL
41 enum schan_handle_type
type;
51static struct schan_handle *schan_handle_table;
52static struct schan_handle *schan_free_handles;
53static SIZE_T schan_handle_table_size;
54static SIZE_T schan_handle_count;
57static DWORD config_enabled_protocols;
60static DWORD config_default_disabled_protocols;
62static ULONG_PTR schan_alloc_handle(
void *
object,
enum schan_handle_type
type)
64 struct schan_handle *
handle;
66 if (schan_free_handles)
68 DWORD index = schan_free_handles - schan_handle_table;
70 handle = schan_free_handles;
71 if (
handle->type != SCHAN_HANDLE_FREE)
74 return SCHAN_INVALID_HANDLE;
76 schan_free_handles =
handle->object;
82 if (!(schan_handle_count < schan_handle_table_size))
85 SIZE_T new_size = schan_handle_table_size + (schan_handle_table_size >> 1);
86 struct schan_handle *new_table =
HeapReAlloc(
GetProcessHeap(), 0, schan_handle_table, new_size *
sizeof(*schan_handle_table));
89 ERR(
"Failed to grow the handle table\n");
90 return SCHAN_INVALID_HANDLE;
92 schan_handle_table = new_table;
93 schan_handle_table_size = new_size;
96 handle = &schan_handle_table[schan_handle_count++];
100 return handle - schan_handle_table;
103static void *schan_free_handle(
ULONG_PTR handle_idx,
enum schan_handle_type
type)
105 struct schan_handle *
handle;
108 if (handle_idx == SCHAN_INVALID_HANDLE)
return NULL;
109 if (handle_idx >= schan_handle_count)
return NULL;
110 handle = &schan_handle_table[handle_idx];
113 ERR(
"Handle %ld(%p) is not of type %#x\n", handle_idx,
handle,
type);
118 handle->object = schan_free_handles;
119 handle->type = SCHAN_HANDLE_FREE;
120 schan_free_handles =
handle;
125static void *schan_get_object(
ULONG_PTR handle_idx,
enum schan_handle_type
type)
127 struct schan_handle *
handle;
129 if (handle_idx == SCHAN_INVALID_HANDLE)
return NULL;
130 if (handle_idx >= schan_handle_count)
return NULL;
131 handle = &schan_handle_table[handle_idx];
134 ERR(
"Handle %ld(%p) is not of type %#x\n", handle_idx,
handle,
type);
141static void read_config(
void)
145 WCHAR subkey_name[64];
151 static const WCHAR protocol_config_key_name[] = {
152 'S',
'Y',
'S',
'T',
'E',
'M',
'\\',
153 'C',
'u',
'r',
'r',
'e',
'n',
't',
'C',
'o',
'n',
't',
'r',
'o',
'l',
'S',
'e',
't',
'\\',
154 'C',
'o',
'n',
't',
'r',
'o',
'l',
'\\',
155 'S',
'e',
'c',
'u',
'r',
'i',
't',
'y',
'P',
'r',
'o',
'v',
'i',
'd',
'e',
'r',
's',
'\\',
156 'S',
'C',
'H',
'A',
'N',
'N',
'E',
'L',
'\\',
157 'P',
'r',
'o',
't',
'o',
'c',
'o',
'l',
's',0 };
159 static const WCHAR clientW[] = {
'\\',
'C',
'l',
'i',
'e',
'n',
't',0};
160 static const WCHAR enabledW[] = {
'e',
'n',
'a',
'b',
'l',
'e',
'd',0};
161 static const WCHAR disabledbydefaultW[] = {
'D',
'i',
's',
'a',
'b',
'l',
'e',
'd',
'B',
'y',
'D',
'e',
'f',
'a',
'u',
'l',
't',0};
163 static const struct {
165 DWORD prot_client_flag;
167 BOOL disabled_by_default;
168 } protocol_config_keys[] = {
169 {{
'S',
'S',
'L',
' ',
'2',
'.',
'0',0},
SP_PROT_SSL2_CLIENT,
FALSE,
TRUE},
170 {{
'S',
'S',
'L',
' ',
'3',
'.',
'0',0},
SP_PROT_SSL3_CLIENT,
TRUE,
FALSE},
171 {{
'T',
'L',
'S',
' ',
'1',
'.',
'0',0},
SP_PROT_TLS1_0_CLIENT,
TRUE,
FALSE},
172 {{
'T',
'L',
'S',
' ',
'1',
'.',
'1',0},
SP_PROT_TLS1_1_CLIENT,
TRUE,
FALSE },
173 {{
'T',
'L',
'S',
' ',
'1',
'.',
'2',0},
SP_PROT_TLS1_2_CLIENT,
TRUE,
FALSE }
184 for(
i=0;
i <
sizeof(protocol_config_keys)/
sizeof(*protocol_config_keys);
i++) {
190 enabled |= protocol_config_keys[
i].prot_client_flag;
191 if(protocol_config_keys[
i].disabled_by_default)
192 default_disabled |= protocol_config_keys[
i].prot_client_flag;
200 enabled |= protocol_config_keys[
i].prot_client_flag;
201 }
else if(protocol_config_keys[
i].
enabled) {
202 enabled |= protocol_config_keys[
i].prot_client_flag;
209 default_disabled |= protocol_config_keys[
i].prot_client_flag;
210 }
else if(protocol_config_keys[
i].disabled_by_default) {
211 default_disabled |= protocol_config_keys[
i].prot_client_flag;
218 for(
i=0;
i <
sizeof(protocol_config_keys)/
sizeof(*protocol_config_keys);
i++) {
220 enabled |= protocol_config_keys[
i].prot_client_flag;
221 if(protocol_config_keys[
i].disabled_by_default)
222 default_disabled |= protocol_config_keys[
i].prot_client_flag;
229 config_default_disabled_protocols = default_disabled;
232 TRACE(
"enabled %x, disabled by default %x\n", config_enabled_protocols, config_default_disabled_protocols);
241 cred = schan_get_object(phCredential->
dwLower, SCHAN_HANDLE_CRED);
251 FIXME(
"SECPKG_ATTR_SUPPORTED_ALGS: stub\n");
263 FIXME(
"SECPKG_ATTR_CIPHER_STRENGTHS: semi-stub\n");
264 r->dwMinimumCipherStrength = 40;
265 r->dwMaximumCipherStrength = 168;
292 TRACE(
"(%p, %d, %p)\n", phCredential, ulAttribute,
pBuffer);
297 FIXME(
"SECPKG_CRED_ATTR_NAMES: stub\n");
301 ret = schan_QueryCredentialsAttributes(phCredential, ulAttribute,
312 TRACE(
"(%p, %d, %p)\n", phCredential, ulAttribute,
pBuffer);
317 FIXME(
"SECPKG_CRED_ATTR_NAMES: stub\n");
321 ret = schan_QueryCredentialsAttributes(phCredential, ulAttribute,
355 if (schanCred->
cCreds == 0)
357 else if (schanCred->
cCreds > 1)
367 &csp, &keySpec, &freeCSP);
388 TRACE(
"schanCred %p, phCredential %p, ptsExpiry %p\n", schanCred, phCredential, ptsExpiry);
392 st = schan_CheckCreds(schanCred);
403 enabled_protocols = config_enabled_protocols & ~config_default_disabled_protocols;
405 ERR(
"Could not find matching protocol\n");
415 handle = schan_alloc_handle(creds, SCHAN_HANDLE_CRED);
416 if (
handle == SCHAN_INVALID_HANDLE)
goto fail;
421 schan_free_handle(
handle, SCHAN_HANDLE_CRED);
448 TRACE(
"schanCred %p, phCredential %p, ptsExpiry %p\n", schanCred, phCredential, ptsExpiry);
452 st = schan_CheckCreds(schanCred);
462 handle = schan_alloc_handle(creds, SCHAN_HANDLE_CRED);
463 if (
handle == SCHAN_INVALID_HANDLE)
483 ret = schan_AcquireClientCredentials(schanCred, phCredential,
486 ret = schan_AcquireServerCredentials(schanCred, phCredential,
496 TRACE(
"(%s, %s, 0x%08x, %p, %p, %p, %p, %p, %p)\n",
498 pLogonID, pAuthData, pGetKeyFn, pGetKeyArgument, phCredential, ptsExpiry);
499 return schan_AcquireCredentialsHandle(fCredentialUse,
500 pAuthData, phCredential, ptsExpiry);
508 TRACE(
"(%s, %s, 0x%08x, %p, %p, %p, %p, %p, %p)\n",
510 pLogonID, pAuthData, pGetKeyFn, pGetKeyArgument, phCredential, ptsExpiry);
511 return schan_AcquireCredentialsHandle(fCredentialUse,
512 pAuthData, phCredential, ptsExpiry);
520 TRACE(
"phCredential %p\n", phCredential);
524 creds = schan_free_handle(phCredential->
dwLower, SCHAN_HANDLE_CRED);
540 s->current_buffer_idx = -1;
541 s->allow_buffer_resize =
FALSE;
542 s->get_next_buffer = get_next_buffer;
550 for (
i = start_idx;
i <
desc->cBuffers; ++
i)
553 if (
buffer->BufferType == buffer_type)
return i;
561 SecBuffer *
b = &
s->desc->pBuffers[
s->current_buffer_idx];
565 if (
b->cbBuffer >= min_size || !
s->allow_buffer_resize || min_size >
UINT_MAX / 2)
return;
567 while (new_size < min_size) new_size *= 2;
576 TRACE(
"Failed to resize %p from %d to %ld\n",
b->pvBuffer,
b->cbBuffer, new_size);
580 b->cbBuffer = new_size;
581 b->pvBuffer = new_data;
595 if (
s->current_buffer_idx == -1)
598 int buffer_idx =
s->get_next_buffer(
t,
s);
599 if (buffer_idx == -1)
601 TRACE(
"No next buffer\n");
604 s->current_buffer_idx = buffer_idx;
607 buffer = &
s->desc->pBuffers[
s->current_buffer_idx];
608 TRACE(
"Using buffer %d: cbBuffer %d, BufferType %#x, pvBuffer %p\n",
s->current_buffer_idx,
buffer->cbBuffer,
buffer->BufferType,
buffer->pvBuffer);
610 schan_resize_current_buffer(
s,
s->offset + *
count);
611 max_count =
buffer->cbBuffer -
s->offset;
612 if (
s->limit != ~0
UL &&
s->limit < max_count)
613 max_count =
s->limit;
618 s->allow_buffer_resize =
FALSE;
619 buffer_idx =
s->get_next_buffer(
t,
s);
620 if (buffer_idx == -1)
622 TRACE(
"No next buffer\n");
625 s->current_buffer_idx = buffer_idx;
630 if (*
count > max_count)
632 if (
s->limit != ~0
UL)
635 return (
char *)
buffer->pvBuffer +
s->offset;
660 SIZE_T local_len = *buff_len;
662 TRACE(
"Pull %lu bytes\n", local_len);
671 t->in.offset += local_len;
673 TRACE(
"Read %lu bytes\n", local_len);
675 *buff_len = local_len;
699 SIZE_T local_len = *buff_len;
701 TRACE(
"Push %lu bytes\n", local_len);
710 t->out.offset += local_len;
712 TRACE(
"Wrote %lu bytes\n", local_len);
714 *buff_len = local_len;
720 return t->ctx->session;
725 if (
s->current_buffer_idx != -1)
732 if (
s->current_buffer_idx == -1)
742 if (
idx != -1 && !
s->desc->pBuffers[
idx].pvBuffer)
744 s->desc->pBuffers[
idx].cbBuffer = 0;
745 s->allow_buffer_resize =
TRUE;
760 for (
i = 0;
i <
desc->cBuffers; ++
i)
763 TRACE(
"\tbuffer %u: cbBuffer %d, BufferType %#x pvBuffer %p\n",
i,
b->cbBuffer,
b->BufferType,
b->pvBuffer);
776 struct schan_context *
ctx;
783 TRACE(
"%p %p %s 0x%08x %d %d %p %d %p %p %p %p\n", phCredential, phContext,
785 Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry);
787 dump_buffer_desc(pInput);
788 dump_buffer_desc(pOutput);
796 cred = schan_get_object(phCredential->
dwLower, SCHAN_HANDLE_CRED);
809 handle = schan_alloc_handle(
ctx, SCHAN_HANDLE_CTX);
810 if (
handle == SCHAN_INVALID_HANDLE)
818 schan_free_handle(
handle, SCHAN_HANDLE_CTX);
856 while (
buffer->cbBuffer > expected_size + 5)
858 record_size = 5 + ((
ptr[3] << 8) |
ptr[4]);
860 if (
buffer->cbBuffer < expected_size + record_size)
863 expected_size += record_size;
869 TRACE(
"Expected at least %lu bytes, but buffer only contains %u bytes.\n",
874 TRACE(
"Using expected_size %lu.\n", expected_size);
876 ctx = schan_get_object(phContext->
dwLower, SCHAN_HANDLE_CTX);
879 ctx->req_ctx_attr = fContextReq;
882 init_schan_buffers(&transport.in, pInput, schan_init_sec_ctx_get_next_input_buffer);
883 transport.in.limit = expected_size;
884 init_schan_buffers(&transport.out, pOutput, schan_init_sec_ctx_get_next_output_buffer);
890 if(transport.in.offset && transport.in.offset != pInput->pBuffers[0].cbBuffer) {
895 pInput->pBuffers[1].cbBuffer = pInput->pBuffers[0].cbBuffer-transport.in.offset;
898 out_buffers = &transport.out;
924 TRACE(
"%p %p %s %d %d %d %p %d %p %p %p %p\n", phCredential, phContext,
926 Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry);
935 ret = schan_InitializeSecurityContextW(phCredential, phContext, target_name,
937 phNewContext, pOutput, pfContextAttr, ptsExpiry);
948 struct schan_context *
ctx;
950 TRACE(
"context_handle %p, attribute %#x, buffer %p\n",
954 ctx = schan_get_object(context_handle->
dwLower, SCHAN_HANDLE_CTX);
969 TRACE(
"Using %lu mac bytes, message size %u, block size %u\n",
974 stream_sizes->
cbTrailer = mac_size + 256;
1019 TRACE(
"context_handle %p, attribute %#x, buffer %p\n",
1025 return schan_QueryContextAttributesW(context_handle,
attribute,
buffer);
1027 return schan_QueryContextAttributesW(context_handle,
attribute,
buffer);
1029 return schan_QueryContextAttributesW(context_handle,
attribute,
buffer);
1041 if (
s->current_buffer_idx == -1)
1044 b = &
s->desc->pBuffers[
s->current_buffer_idx];
1059 if (
s->current_buffer_idx == -1)
1062 b = &
s->desc->pBuffers[
s->current_buffer_idx];
1067 if (
idx !=
s->current_buffer_idx)
return -1;
1086 struct schan_context *
ctx;
1095 TRACE(
"context_handle %p, quality %d, message %p, message_seq_no %d\n",
1099 ctx = schan_get_object(context_handle->
dwLower, SCHAN_HANDLE_CTX);
1106 WARN(
"No data buffer passed\n");
1111 data_size =
buffer->cbBuffer;
1115 transport.ctx =
ctx;
1116 init_schan_buffers(&transport.in,
NULL,
NULL);
1118 init_schan_buffers(&transport.out,
message, schan_encrypt_message_get_next_buffer);
1120 init_schan_buffers(&transport.out,
message, schan_encrypt_message_get_next_buffer_token);
1132 b->desc->pBuffers[
b->current_buffer_idx].cbBuffer =
b->offset;
1142 if (
s->current_buffer_idx == -1)
1151 unsigned int empty_count = 0;
1156 WARN(
"Less than four buffers passed\n");
1167 WARN(
"More than one data buffer passed\n");
1178 WARN(
"No data buffer passed\n");
1182 if (empty_count < 3)
1184 WARN(
"Less than three empty buffers passed\n");
1199 buffer->BufferType = buffer_type;
1208 struct schan_context *
ctx;
1212 unsigned expected_size;
1215 unsigned char *buf_ptr;
1217 TRACE(
"context_handle %p, message %p, message_seq_no %d, quality %p\n",
1221 ctx = schan_get_object(context_handle->
dwLower, SCHAN_HANDLE_CTX);
1225 idx = schan_validate_decrypt_buffer_desc(
message);
1229 buf_ptr =
buffer->pvBuffer;
1231 expected_size = 5 + ((buf_ptr[3] << 8) | buf_ptr[4]);
1232 if(
buffer->cbBuffer < expected_size)
1234 TRACE(
"Expected %u bytes, but buffer only contains %u bytes\n", expected_size,
buffer->cbBuffer);
1244 TRACE(
"Returning SEC_E_INCOMPLETE_MESSAGE\n");
1248 data_size = expected_size - 5;
1251 transport.ctx =
ctx;
1252 init_schan_buffers(&transport.in,
message, schan_decrypt_message_get_next_buffer);
1253 transport.in.limit = expected_size;
1254 init_schan_buffers(&transport.out,
NULL,
NULL);
1289 if(
buffer->cbBuffer > expected_size)
1291 buf_ptr + expected_size,
buffer->cbBuffer - expected_size);
1301 struct schan_context *
ctx;
1303 TRACE(
"context_handle %p\n", context_handle);
1307 ctx = schan_free_handle(context_handle->
dwLower, SCHAN_HANDLE_CTX);
1321 schan_QueryCredentialsAttributesA,
1322 schan_AcquireCredentialsHandleA,
1323 schan_FreeCredentialsHandle,
1325 schan_InitializeSecurityContextA,
1328 schan_DeleteSecurityContext,
1330 schan_QueryContextAttributesA,
1344 schan_EncryptMessage,
1345 schan_DecryptMessage,
1352 schan_QueryCredentialsAttributesW,
1353 schan_AcquireCredentialsHandleW,
1354 schan_FreeCredentialsHandle,
1356 schan_InitializeSecurityContextW,
1359 schan_DeleteSecurityContext,
1361 schan_QueryContextAttributesW,
1375 schan_EncryptMessage,
1376 schan_DecryptMessage,
1380static const WCHAR schannelComment[] = {
'S',
'c',
'h',
'a',
'n',
'n',
'e',
'l',
' ',
1381 'S',
'e',
'c',
'u',
'r',
'i',
't',
'y',
' ',
'P',
'a',
'c',
'k',
'a',
'g',
'e',0 };
1382static const WCHAR schannelDllName[] = {
's',
'c',
'h',
'a',
'n',
'n',
'e',
'l',
'.',
'd',
'l',
'l',0 };
1390 static const LONG caps =
1399 static const short version = 1;
1400 static const LONG maxToken = 16384;
1414 if (!schan_handle_table)
1416 ERR(
"Failed to allocate schannel handle table.\n");
1419 schan_handle_table_size = 64;
1424 ERR(
"Failed to add schannel provider.\n");
1434 schan_handle_table =
NULL;
1441 SIZE_T i = schan_handle_count;
1443 if (!schan_handle_table)
return;
1449 if (schan_handle_table[
i].
type == SCHAN_HANDLE_CTX)
1451 struct schan_context *
ctx = schan_free_handle(
i, SCHAN_HANDLE_CTX);
1456 i = schan_handle_count;
1459 if (schan_handle_table[
i].
type != SCHAN_HANDLE_FREE)
1462 cred = schan_free_handle(
i, SCHAN_HANDLE_CRED);
1475 ERR(
"TLS library not found, SSL connections will fail\n");
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
BOOL WINAPI CertFreeCertificateContext(PCCERT_CONTEXT pCertContext)
BOOL WINAPI CryptAcquireCertificatePrivateKey(PCCERT_CONTEXT pCert, DWORD dwFlags, void *pvReserved, HCRYPTPROV_OR_NCRYPT_KEY_HANDLE *phCryptProv, DWORD *pdwKeySpec, BOOL *pfCallerFreeProv)
PCCERT_CONTEXT WINAPI CertDuplicateCertificateContext(PCCERT_CONTEXT pCertContext)
HCERTSTORE WINAPI CertOpenStore(LPCSTR lpszStoreProvider, DWORD dwMsgAndCertEncodingType, HCRYPTPROV_LEGACY hCryptProv, DWORD dwFlags, const void *pvPara)
BOOL WINAPI CertCloseStore(HCERTSTORE hCertStore, DWORD dwFlags)
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
static const WCHAR version[]
static unsigned char buff[32768]
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
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
static DWORD block_size(DWORD block)
#define memcpy(s1, s2, n)
static const WCHAR desc[]
PVOID *typedef PSecBuffer
#define SECBUFFER_MISSING
#define ISC_REQ_ALLOCATE_MEMORY
#define SECPKG_FLAG_IMPERSONATION
#define SECPKG_CRED_OUTBOUND
#define SECPKG_FLAG_STREAM
#define SECBUFFER_STREAM_TRAILER
#define SECPKG_FLAG_EXTENDED_ERROR
#define SECBUFFER_STREAM_HEADER
#define SECPKG_CRED_ATTR_NAMES
#define ISC_RET_ALLOCATED_MEMORY
#define SECPKG_FLAG_PRIVACY
#define SECPKG_FLAG_MULTI_REQUIRED
#define SECPKG_FLAG_CONNECTION
#define SECPKG_FLAG_INTEGRITY
void(SEC_ENTRY * SEC_GET_KEY_FN)(void *Arg, void *Principal, ULONG KeyVer, void **Key, SECURITY_STATUS *Status)
#define SECPKG_CRED_INBOUND
#define SECPKG_FLAG_ACCEPT_WIN32_NAME
#define SECPKG_ATTR_STREAM_SIZES
#define SP_PROT_TLS1_1_CLIENT
#define SECPKG_ATTR_CONNECTION_INFO
#define SECPKG_ATTR_SUPPORTED_PROTOCOLS
#define SCHANNEL_CRED_VERSION
#define SECPKG_ATTR_CIPHER_STRENGTHS
#define SP_PROT_TLS1_0_CLIENT
#define SECPKG_ATTR_SUPPORTED_ALGS
#define SP_PROT_TLS1_2_CLIENT
#define SP_PROT_SSL2_CLIENT
#define SP_PROT_SSL3_CLIENT
#define SECPKG_ATTR_REMOTE_CERT_CONTEXT
SECURITY_STATUS schan_imp_handshake(schan_imp_session session) DECLSPEC_HIDDEN
int schan_pull(struct schan_transport *t, void *buff, size_t *buff_len) DECLSPEC_HIDDEN
struct schan_imp_session_opaque * schan_imp_session
SECURITY_STATUS schan_imp_recv(schan_imp_session session, void *buffer, SIZE_T *length) DECLSPEC_HIDDEN
void schan_imp_set_session_transport(schan_imp_session session, struct schan_transport *t) 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
schan_imp_session schan_session_for_transport(struct schan_transport *t) DECLSPEC_HIDDEN
DWORD schan_imp_enabled_protocols(void) DECLSPEC_HIDDEN
SECURITY_STATUS WINAPI schan_EnumerateSecurityPackagesA(PULONG pcPackages, PSecPkgInfoA *ppPackageInfo)
BOOL schan_imp_allocate_certificate_credentials(schan_credentials *) DECLSPEC_HIDDEN
unsigned int schan_imp_get_max_message_size(schan_imp_session session) DECLSPEC_HIDDEN
void schan_imp_free_certificate_credentials(schan_credentials *) DECLSPEC_HIDDEN
SECURITY_STATUS WINAPI schan_EnumerateSecurityPackagesW(PULONG pcPackages, PSecPkgInfoW *ppPackageInfo)
SECURITY_STATUS WINAPI schan_FreeContextBuffer(PVOID pvoid)
SecurityFunctionTableA schanTableA
int schan_push(struct schan_transport *t, const void *buff, size_t *buff_len) DECLSPEC_HIDDEN
void schan_imp_set_session_target(schan_imp_session session, const char *target) DECLSPEC_HIDDEN
SecurityFunctionTableW schanTableW
void schan_imp_dispose_session(schan_imp_session session) DECLSPEC_HIDDEN
SECURITY_STATUS schan_imp_get_connection_info(schan_imp_session session, SecPkgContext_ConnectionInfo *info) DECLSPEC_HIDDEN
SecureProvider * SECUR32_addProvider(const SecurityFunctionTableA *fnTableA, const SecurityFunctionTableW *fnTableW, PCWSTR moduleName) DECLSPEC_HIDDEN
unsigned int schan_imp_get_session_cipher_block_size(schan_imp_session session) DECLSPEC_HIDDEN
BOOL schan_imp_create_session(schan_imp_session *session, schan_credentials *cred) DECLSPEC_HIDDEN
void SECUR32_addPackages(SecureProvider *provider, ULONG toAdd, const SecPkgInfoA *infoA, const SecPkgInfoW *infoW) DECLSPEC_HIDDEN
char * schan_get_buffer(const struct schan_transport *t, struct schan_buffers *s, SIZE_T *count) DECLSPEC_HIDDEN
void SECUR32_initSchannelSP(void)
void SECUR32_deinitSchannelSP(void)
DWORD dwMaximumCipherStrength
ALG_ID * palgSupportedAlgs
DWORD dwMinimumCipherStrength
DWORD grbitEnabledProtocols
const SecBufferDesc * desc
struct schan_context * ctx
DWORD WINAPI GetLastError(void)
#define CERT_STORE_CREATE_NEW_FLAG
#define CERT_STORE_PROV_MEMORY
#define SEC_E_INVALID_HANDLE
#define SEC_E_INTERNAL_ERROR
#define SEC_E_UNKNOWN_CREDENTIALS
#define SEC_E_NO_AUTHENTICATING_AUTHORITY
#define SEC_E_UNSUPPORTED_FUNCTION
#define SEC_E_INVALID_TOKEN
#define SEC_E_NO_CREDENTIALS
#define SEC_E_INSUFFICIENT_MEMORY
#define SEC_I_CONTINUE_NEEDED
#define SEC_E_INCOMPLETE_MESSAGE
#define HKEY_LOCAL_MACHINE