Blame winpr/libwinpr/sspi/Schannel/schannel.c

Packit 1fb8d4
/**
Packit 1fb8d4
 * WinPR: Windows Portable Runtime
Packit 1fb8d4
 * Schannel Security Package
Packit 1fb8d4
 *
Packit 1fb8d4
 * Copyright 2012-2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 1fb8d4
 * you may not use this file except in compliance with the License.
Packit 1fb8d4
 * You may obtain a copy of the License at
Packit 1fb8d4
 *
Packit 1fb8d4
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 1fb8d4
 *
Packit 1fb8d4
 * Unless required by applicable law or agreed to in writing, software
Packit 1fb8d4
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 1fb8d4
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 1fb8d4
 * See the License for the specific language governing permissions and
Packit 1fb8d4
 * limitations under the License.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifdef HAVE_CONFIG_H
Packit 1fb8d4
#include "config.h"
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#include <winpr/crt.h>
Packit 1fb8d4
#include <winpr/sspi.h>
Packit 1fb8d4
Packit 1fb8d4
#include "schannel.h"
Packit 1fb8d4
Packit 1fb8d4
#include "../sspi.h"
Packit 1fb8d4
Packit Service 5a9772
static char* SCHANNEL_PACKAGE_NAME = "Schannel";
Packit 1fb8d4
Packit Service 5a9772
SCHANNEL_CONTEXT* schannel_ContextNew(void)
Packit 1fb8d4
{
Packit 1fb8d4
	SCHANNEL_CONTEXT* context;
Packit Service 5a9772
	context = (SCHANNEL_CONTEXT*)calloc(1, sizeof(SCHANNEL_CONTEXT));
Packit 1fb8d4
Packit 1fb8d4
	if (!context)
Packit 1fb8d4
		return NULL;
Packit 1fb8d4
Packit 1fb8d4
	context->openssl = schannel_openssl_new();
Packit 1fb8d4
Packit 1fb8d4
	if (!context->openssl)
Packit 1fb8d4
	{
Packit 1fb8d4
		free(context);
Packit 1fb8d4
		return NULL;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	return context;
Packit 1fb8d4
}
Packit 1fb8d4
Packit 1fb8d4
void schannel_ContextFree(SCHANNEL_CONTEXT* context)
Packit 1fb8d4
{
Packit 1fb8d4
	if (!context)
Packit 1fb8d4
		return;
Packit 1fb8d4
Packit 1fb8d4
	schannel_openssl_free(context->openssl);
Packit 1fb8d4
	free(context);
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SCHANNEL_CREDENTIALS* schannel_CredentialsNew(void)
Packit 1fb8d4
{
Packit 1fb8d4
	SCHANNEL_CREDENTIALS* credentials;
Packit Service 5a9772
	credentials = (SCHANNEL_CREDENTIALS*)calloc(1, sizeof(SCHANNEL_CREDENTIALS));
Packit 1fb8d4
	return credentials;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static void schannel_CredentialsFree(SCHANNEL_CREDENTIALS* credentials)
Packit 1fb8d4
{
Packit 1fb8d4
	free(credentials);
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static ALG_ID schannel_SupportedAlgs[] = { CALG_AES_128,
Packit Service 5a9772
	                                       CALG_AES_256,
Packit Service 5a9772
	                                       CALG_RC4,
Packit Service 5a9772
	                                       CALG_DES,
Packit Service 5a9772
	                                       CALG_3DES,
Packit Service 5a9772
	                                       CALG_MD5,
Packit Service 5a9772
	                                       CALG_SHA1,
Packit Service 5a9772
	                                       CALG_SHA_256,
Packit Service 5a9772
	                                       CALG_SHA_384,
Packit Service 5a9772
	                                       CALG_SHA_512,
Packit Service 5a9772
	                                       CALG_RSA_SIGN,
Packit Service 5a9772
	                                       CALG_DH_EPHEM,
Packit Service 5a9772
	                                       (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RESERVED7 |
Packit Service 5a9772
	                                        6), /* what is this? */
Packit Service 5a9772
	                                       CALG_DSS_SIGN,
Packit Service 5a9772
	                                       CALG_ECDSA };
Packit Service 5a9772
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW(PCredHandle phCredential,
Packit Service 5a9772
                                                                      ULONG ulAttribute,
Packit Service 5a9772
                                                                      void* pBuffer)
Packit 1fb8d4
{
Packit 1fb8d4
	if (ulAttribute == SECPKG_ATTR_SUPPORTED_ALGS)
Packit 1fb8d4
	{
Packit Service 5a9772
		PSecPkgCred_SupportedAlgs SupportedAlgs = (PSecPkgCred_SupportedAlgs)pBuffer;
Packit 1fb8d4
		SupportedAlgs->cSupportedAlgs = sizeof(schannel_SupportedAlgs) / sizeof(ALG_ID);
Packit Service 5a9772
		SupportedAlgs->palgSupportedAlgs = (ALG_ID*)schannel_SupportedAlgs;
Packit 1fb8d4
		return SEC_E_OK;
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (ulAttribute == SECPKG_ATTR_CIPHER_STRENGTHS)
Packit 1fb8d4
	{
Packit Service 5a9772
		PSecPkgCred_CipherStrengths CipherStrengths = (PSecPkgCred_CipherStrengths)pBuffer;
Packit 1fb8d4
		CipherStrengths->dwMinimumCipherStrength = 40;
Packit 1fb8d4
		CipherStrengths->dwMaximumCipherStrength = 256;
Packit 1fb8d4
		return SEC_E_OK;
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (ulAttribute == SECPKG_ATTR_SUPPORTED_PROTOCOLS)
Packit 1fb8d4
	{
Packit Service 5a9772
		PSecPkgCred_SupportedProtocols SupportedProtocols = (PSecPkgCred_SupportedProtocols)pBuffer;
Packit 1fb8d4
		/* Observed SupportedProtocols: 0x208A0 */
Packit 1fb8d4
		SupportedProtocols->grbitProtocol = (SP_PROT_CLIENTS | SP_PROT_SERVERS);
Packit 1fb8d4
		return SEC_E_OK;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	return SEC_E_UNSUPPORTED_FUNCTION;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesA(PCredHandle phCredential,
Packit Service 5a9772
                                                                      ULONG ulAttribute,
Packit Service 5a9772
                                                                      void* pBuffer)
Packit 1fb8d4
{
Packit 1fb8d4
	return schannel_QueryCredentialsAttributesW(phCredential, ulAttribute, pBuffer);
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW(
Packit Service 5a9772
    SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID,
Packit Service 5a9772
    void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential,
Packit Service 5a9772
    PTimeStamp ptsExpiry)
Packit 1fb8d4
{
Packit 1fb8d4
	SCHANNEL_CREDENTIALS* credentials;
Packit 1fb8d4
Packit 1fb8d4
	if (fCredentialUse == SECPKG_CRED_OUTBOUND)
Packit 1fb8d4
	{
Packit 1fb8d4
		SCHANNEL_CRED* cred;
Packit 1fb8d4
		credentials = schannel_CredentialsNew();
Packit 1fb8d4
		credentials->fCredentialUse = fCredentialUse;
Packit Service 5a9772
		cred = (SCHANNEL_CRED*)pAuthData;
Packit 1fb8d4
Packit 1fb8d4
		if (cred)
Packit 1fb8d4
		{
Packit 1fb8d4
			CopyMemory(&credentials->cred, cred, sizeof(SCHANNEL_CRED));
Packit 1fb8d4
		}
Packit 1fb8d4
Packit Service 5a9772
		sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials);
Packit Service 5a9772
		sspi_SecureHandleSetUpperPointer(phCredential, (void*)SCHANNEL_PACKAGE_NAME);
Packit 1fb8d4
		return SEC_E_OK;
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (fCredentialUse == SECPKG_CRED_INBOUND)
Packit 1fb8d4
	{
Packit 1fb8d4
		credentials = schannel_CredentialsNew();
Packit 1fb8d4
		credentials->fCredentialUse = fCredentialUse;
Packit Service 5a9772
		sspi_SecureHandleSetLowerPointer(phCredential, (void*)credentials);
Packit Service 5a9772
		sspi_SecureHandleSetUpperPointer(phCredential, (void*)SCHANNEL_PACKAGE_NAME);
Packit 1fb8d4
		return SEC_E_OK;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	return SEC_E_OK;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA(
Packit Service 5a9772
    SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID,
Packit Service 5a9772
    void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential,
Packit Service 5a9772
    PTimeStamp ptsExpiry)
Packit 1fb8d4
{
Packit 1fb8d4
	SECURITY_STATUS status;
Packit 1fb8d4
	SEC_WCHAR* pszPrincipalW = NULL;
Packit 1fb8d4
	SEC_WCHAR* pszPackageW = NULL;
Packit 1fb8d4
	ConvertToUnicode(CP_UTF8, 0, pszPrincipal, -1, &pszPrincipalW, 0);
Packit 1fb8d4
	ConvertToUnicode(CP_UTF8, 0, pszPackage, -1, &pszPackageW, 0);
Packit Service 5a9772
	status = schannel_AcquireCredentialsHandleW(pszPrincipalW, pszPackageW, fCredentialUse,
Packit Service 5a9772
	                                            pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument,
Packit Service 5a9772
	                                            phCredential, ptsExpiry);
Packit 1fb8d4
	free(pszPrincipalW);
Packit 1fb8d4
	free(pszPackageW);
Packit 1fb8d4
	return status;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle(PCredHandle phCredential)
Packit 1fb8d4
{
Packit 1fb8d4
	SCHANNEL_CREDENTIALS* credentials;
Packit 1fb8d4
Packit 1fb8d4
	if (!phCredential)
Packit 1fb8d4
		return SEC_E_INVALID_HANDLE;
Packit 1fb8d4
Packit Service 5a9772
	credentials = (SCHANNEL_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential);
Packit 1fb8d4
Packit 1fb8d4
	if (!credentials)
Packit 1fb8d4
		return SEC_E_INVALID_HANDLE;
Packit 1fb8d4
Packit 1fb8d4
	schannel_CredentialsFree(credentials);
Packit 1fb8d4
	return SEC_E_OK;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW(
Packit Service 5a9772
    PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR* pszTargetName, ULONG fContextReq,
Packit Service 5a9772
    ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2,
Packit Service 5a9772
    PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
Packit 1fb8d4
{
Packit 1fb8d4
	SECURITY_STATUS status;
Packit 1fb8d4
	SCHANNEL_CONTEXT* context;
Packit 1fb8d4
	SCHANNEL_CREDENTIALS* credentials;
Packit 1fb8d4
	context = sspi_SecureHandleGetLowerPointer(phContext);
Packit 1fb8d4
Packit 1fb8d4
	if (!context)
Packit 1fb8d4
	{
Packit 1fb8d4
		context = schannel_ContextNew();
Packit 1fb8d4
Packit 1fb8d4
		if (!context)
Packit 1fb8d4
			return SEC_E_INSUFFICIENT_MEMORY;
Packit 1fb8d4
Packit Service 5a9772
		credentials = (SCHANNEL_CREDENTIALS*)sspi_SecureHandleGetLowerPointer(phCredential);
Packit 1fb8d4
		context->server = FALSE;
Packit 1fb8d4
		CopyMemory(&context->cred, &credentials->cred, sizeof(SCHANNEL_CRED));
Packit 1fb8d4
		sspi_SecureHandleSetLowerPointer(phNewContext, context);
Packit Service 5a9772
		sspi_SecureHandleSetUpperPointer(phNewContext, (void*)SCHANNEL_PACKAGE_NAME);
Packit 1fb8d4
		schannel_openssl_client_init(context->openssl);
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	status = schannel_openssl_client_process_tokens(context->openssl, pInput, pOutput);
Packit 1fb8d4
	return status;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA(
Packit Service 5a9772
    PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR* pszTargetName, ULONG fContextReq,
Packit Service 5a9772
    ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2,
Packit Service 5a9772
    PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
Packit 1fb8d4
{
Packit 1fb8d4
	SECURITY_STATUS status;
Packit 1fb8d4
	SEC_WCHAR* pszTargetNameW = NULL;
Packit 1fb8d4
Packit 1fb8d4
	if (pszTargetName != NULL)
Packit 1fb8d4
	{
Packit 1fb8d4
		ConvertToUnicode(CP_UTF8, 0, pszTargetName, -1, &pszTargetNameW, 0);
Packit 1fb8d4
	}
Packit 1fb8d4
Packit Service 5a9772
	status = schannel_InitializeSecurityContextW(
Packit Service 5a9772
	    phCredential, phContext, pszTargetNameW, fContextReq, Reserved1, TargetDataRep, pInput,
Packit Service 5a9772
	    Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry);
Packit 1fb8d4
	free(pszTargetNameW);
Packit 1fb8d4
	return status;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext(
Packit Service 5a9772
    PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq,
Packit Service 5a9772
    ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr,
Packit Service 5a9772
    PTimeStamp ptsTimeStamp)
Packit 1fb8d4
{
Packit 1fb8d4
	SECURITY_STATUS status;
Packit 1fb8d4
	SCHANNEL_CONTEXT* context;
Packit Service 5a9772
	context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext);
Packit 1fb8d4
Packit 1fb8d4
	if (!context)
Packit 1fb8d4
	{
Packit 1fb8d4
		context = schannel_ContextNew();
Packit 1fb8d4
Packit 1fb8d4
		if (!context)
Packit 1fb8d4
			return SEC_E_INSUFFICIENT_MEMORY;
Packit 1fb8d4
Packit 1fb8d4
		context->server = TRUE;
Packit 1fb8d4
		sspi_SecureHandleSetLowerPointer(phNewContext, context);
Packit Service 5a9772
		sspi_SecureHandleSetUpperPointer(phNewContext, (void*)SCHANNEL_PACKAGE_NAME);
Packit 1fb8d4
		schannel_openssl_server_init(context->openssl);
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	status = schannel_openssl_server_process_tokens(context->openssl, pInput, pOutput);
Packit 1fb8d4
	return status;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext(PCtxtHandle phContext)
Packit 1fb8d4
{
Packit 1fb8d4
	SCHANNEL_CONTEXT* context;
Packit Service 5a9772
	context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext);
Packit 1fb8d4
Packit 1fb8d4
	if (!context)
Packit 1fb8d4
		return SEC_E_INVALID_HANDLE;
Packit 1fb8d4
Packit 1fb8d4
	schannel_ContextFree(context);
Packit 1fb8d4
	return SEC_E_OK;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext,
Packit Service 5a9772
                                                                 ULONG ulAttribute, void* pBuffer)
Packit 1fb8d4
{
Packit 1fb8d4
	if (!phContext)
Packit 1fb8d4
		return SEC_E_INVALID_HANDLE;
Packit 1fb8d4
Packit 1fb8d4
	if (!pBuffer)
Packit 1fb8d4
		return SEC_E_INSUFFICIENT_MEMORY;
Packit 1fb8d4
Packit 1fb8d4
	if (ulAttribute == SECPKG_ATTR_SIZES)
Packit 1fb8d4
	{
Packit Service 5a9772
		SecPkgContext_Sizes* Sizes = (SecPkgContext_Sizes*)pBuffer;
Packit 1fb8d4
		Sizes->cbMaxToken = 0x6000;
Packit 1fb8d4
		Sizes->cbMaxSignature = 16;
Packit 1fb8d4
		Sizes->cbBlockSize = 0;
Packit 1fb8d4
		Sizes->cbSecurityTrailer = 16;
Packit 1fb8d4
		return SEC_E_OK;
Packit 1fb8d4
	}
Packit 1fb8d4
	else if (ulAttribute == SECPKG_ATTR_STREAM_SIZES)
Packit 1fb8d4
	{
Packit Service 5a9772
		SecPkgContext_StreamSizes* StreamSizes = (SecPkgContext_StreamSizes*)pBuffer;
Packit 1fb8d4
		StreamSizes->cbHeader = 5;
Packit 1fb8d4
		StreamSizes->cbTrailer = 36;
Packit 1fb8d4
		StreamSizes->cbMaximumMessage = 0x4000;
Packit 1fb8d4
		StreamSizes->cBuffers = 4;
Packit 1fb8d4
		StreamSizes->cbBlockSize = 16;
Packit 1fb8d4
		return SEC_E_OK;
Packit 1fb8d4
	}
Packit 1fb8d4
Packit 1fb8d4
	return SEC_E_UNSUPPORTED_FUNCTION;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_MakeSignature(PCtxtHandle phContext, ULONG fQOP,
Packit Service 5a9772
                                                        PSecBufferDesc pMessage, ULONG MessageSeqNo)
Packit 1fb8d4
{
Packit 1fb8d4
	return SEC_E_OK;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_VerifySignature(PCtxtHandle phContext,
Packit Service 5a9772
                                                          PSecBufferDesc pMessage,
Packit Service 5a9772
                                                          ULONG MessageSeqNo, ULONG* pfQOP)
Packit 1fb8d4
{
Packit 1fb8d4
	return SEC_E_OK;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage(PCtxtHandle phContext, ULONG fQOP,
Packit Service 5a9772
                                                         PSecBufferDesc pMessage,
Packit Service 5a9772
                                                         ULONG MessageSeqNo)
Packit 1fb8d4
{
Packit 1fb8d4
	SECURITY_STATUS status;
Packit 1fb8d4
	SCHANNEL_CONTEXT* context;
Packit Service 5a9772
	context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext);
Packit 1fb8d4
Packit 1fb8d4
	if (!context)
Packit 1fb8d4
		return SEC_E_INVALID_HANDLE;
Packit 1fb8d4
Packit 1fb8d4
	status = schannel_openssl_encrypt_message(context->openssl, pMessage);
Packit 1fb8d4
	return status;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
static SECURITY_STATUS SEC_ENTRY schannel_DecryptMessage(PCtxtHandle phContext,
Packit Service 5a9772
                                                         PSecBufferDesc pMessage,
Packit Service 5a9772
                                                         ULONG MessageSeqNo, ULONG* pfQOP)
Packit 1fb8d4
{
Packit 1fb8d4
	SECURITY_STATUS status;
Packit 1fb8d4
	SCHANNEL_CONTEXT* context;
Packit Service 5a9772
	context = (SCHANNEL_CONTEXT*)sspi_SecureHandleGetLowerPointer(phContext);
Packit 1fb8d4
Packit 1fb8d4
	if (!context)
Packit 1fb8d4
		return SEC_E_INVALID_HANDLE;
Packit 1fb8d4
Packit 1fb8d4
	status = schannel_openssl_decrypt_message(context->openssl, pMessage);
Packit 1fb8d4
	return status;
Packit 1fb8d4
}
Packit 1fb8d4
Packit Service 5a9772
const SecurityFunctionTableA SCHANNEL_SecurityFunctionTableA = {
Packit Service 5a9772
	1,                                    /* dwVersion */
Packit Service 5a9772
	NULL,                                 /* EnumerateSecurityPackages */
Packit 1fb8d4
	schannel_QueryCredentialsAttributesA, /* QueryCredentialsAttributes */
Packit Service 5a9772
	schannel_AcquireCredentialsHandleA,   /* AcquireCredentialsHandle */
Packit Service 5a9772
	schannel_FreeCredentialsHandle,       /* FreeCredentialsHandle */
Packit Service 5a9772
	NULL,                                 /* Reserved2 */
Packit Service 5a9772
	schannel_InitializeSecurityContextA,  /* InitializeSecurityContext */
Packit Service 5a9772
	schannel_AcceptSecurityContext,       /* AcceptSecurityContext */
Packit Service 5a9772
	NULL,                                 /* CompleteAuthToken */
Packit Service 5a9772
	schannel_DeleteSecurityContext,       /* DeleteSecurityContext */
Packit Service 5a9772
	NULL,                                 /* ApplyControlToken */
Packit Service 5a9772
	schannel_QueryContextAttributes,      /* QueryContextAttributes */
Packit Service 5a9772
	NULL,                                 /* ImpersonateSecurityContext */
Packit Service 5a9772
	NULL,                                 /* RevertSecurityContext */
Packit Service 5a9772
	schannel_MakeSignature,               /* MakeSignature */
Packit Service 5a9772
	schannel_VerifySignature,             /* VerifySignature */
Packit Service 5a9772
	NULL,                                 /* FreeContextBuffer */
Packit Service 5a9772
	NULL,                                 /* QuerySecurityPackageInfo */
Packit Service 5a9772
	NULL,                                 /* Reserved3 */
Packit Service 5a9772
	NULL,                                 /* Reserved4 */
Packit Service 5a9772
	NULL,                                 /* ExportSecurityContext */
Packit Service 5a9772
	NULL,                                 /* ImportSecurityContext */
Packit Service 5a9772
	NULL,                                 /* AddCredentials */
Packit Service 5a9772
	NULL,                                 /* Reserved8 */
Packit Service 5a9772
	NULL,                                 /* QuerySecurityContextToken */
Packit Service 5a9772
	schannel_EncryptMessage,              /* EncryptMessage */
Packit Service 5a9772
	schannel_DecryptMessage,              /* DecryptMessage */
Packit Service 5a9772
	NULL,                                 /* SetContextAttributes */
Packit 1fb8d4
};
Packit 1fb8d4
Packit Service 5a9772
const SecurityFunctionTableW SCHANNEL_SecurityFunctionTableW = {
Packit Service 5a9772
	1,                                    /* dwVersion */
Packit Service 5a9772
	NULL,                                 /* EnumerateSecurityPackages */
Packit 1fb8d4
	schannel_QueryCredentialsAttributesW, /* QueryCredentialsAttributes */
Packit Service 5a9772
	schannel_AcquireCredentialsHandleW,   /* AcquireCredentialsHandle */
Packit Service 5a9772
	schannel_FreeCredentialsHandle,       /* FreeCredentialsHandle */
Packit Service 5a9772
	NULL,                                 /* Reserved2 */
Packit Service 5a9772
	schannel_InitializeSecurityContextW,  /* InitializeSecurityContext */
Packit Service 5a9772
	schannel_AcceptSecurityContext,       /* AcceptSecurityContext */
Packit Service 5a9772
	NULL,                                 /* CompleteAuthToken */
Packit Service 5a9772
	schannel_DeleteSecurityContext,       /* DeleteSecurityContext */
Packit Service 5a9772
	NULL,                                 /* ApplyControlToken */
Packit Service 5a9772
	schannel_QueryContextAttributes,      /* QueryContextAttributes */
Packit Service 5a9772
	NULL,                                 /* ImpersonateSecurityContext */
Packit Service 5a9772
	NULL,                                 /* RevertSecurityContext */
Packit Service 5a9772
	schannel_MakeSignature,               /* MakeSignature */
Packit Service 5a9772
	schannel_VerifySignature,             /* VerifySignature */
Packit Service 5a9772
	NULL,                                 /* FreeContextBuffer */
Packit Service 5a9772
	NULL,                                 /* QuerySecurityPackageInfo */
Packit Service 5a9772
	NULL,                                 /* Reserved3 */
Packit Service 5a9772
	NULL,                                 /* Reserved4 */
Packit Service 5a9772
	NULL,                                 /* ExportSecurityContext */
Packit Service 5a9772
	NULL,                                 /* ImportSecurityContext */
Packit Service 5a9772
	NULL,                                 /* AddCredentials */
Packit Service 5a9772
	NULL,                                 /* Reserved8 */
Packit Service 5a9772
	NULL,                                 /* QuerySecurityContextToken */
Packit Service 5a9772
	schannel_EncryptMessage,              /* EncryptMessage */
Packit Service 5a9772
	schannel_DecryptMessage,              /* DecryptMessage */
Packit Service 5a9772
	NULL,                                 /* SetContextAttributes */
Packit 1fb8d4
};
Packit 1fb8d4
Packit Service 5a9772
const SecPkgInfoA SCHANNEL_SecPkgInfoA = {
Packit Service 5a9772
	0x000107B3,                 /* fCapabilities */
Packit Service 5a9772
	1,                          /* wVersion */
Packit Service 5a9772
	0x000E,                     /* wRPCID */
Packit Service 5a9772
	SCHANNEL_CB_MAX_TOKEN,      /* cbMaxToken */
Packit Service 5a9772
	"Schannel",                 /* Name */
Packit 1fb8d4
	"Schannel Security Package" /* Comment */
Packit 1fb8d4
};
Packit 1fb8d4
Packit 1fb8d4
WCHAR SCHANNEL_SecPkgInfoW_Name[] = { 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', '\0' };
Packit 1fb8d4
Packit Service 5a9772
WCHAR SCHANNEL_SecPkgInfoW_Comment[] = { 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', ' ',
Packit Service 5a9772
	                                     'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ',
Packit Service 5a9772
	                                     'P', 'a', 'c', 'k', 'a', 'g', 'e', '\0' };
Packit 1fb8d4
Packit Service 5a9772
const SecPkgInfoW SCHANNEL_SecPkgInfoW = {
Packit Service 5a9772
	0x000107B3,                  /* fCapabilities */
Packit Service 5a9772
	1,                           /* wVersion */
Packit Service 5a9772
	0x000E,                      /* wRPCID */
Packit Service 5a9772
	SCHANNEL_CB_MAX_TOKEN,       /* cbMaxToken */
Packit Service 5a9772
	SCHANNEL_SecPkgInfoW_Name,   /* Name */
Packit 1fb8d4
	SCHANNEL_SecPkgInfoW_Comment /* Comment */
Packit 1fb8d4
};