FreeRDP
schannel.c File Reference
#include <winpr/config.h>
#include <winpr/crt.h>
#include <winpr/sspi.h>
#include "schannel.h"
#include "../sspi.h"
#include "../../log.h"

Macros

#define TAG   WINPR_TAG("sspi.Schannel")
 

Functions

SCHANNEL_CONTEXTschannel_ContextNew (void)
 
void schannel_ContextFree (SCHANNEL_CONTEXT *context)
 
static SCHANNEL_CREDENTIALSschannel_CredentialsNew (void)
 
static void schannel_CredentialsFree (SCHANNEL_CREDENTIALS *credentials)
 
static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW (PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesA (PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW (SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, void *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA (SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, void *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle (PCredHandle phCredential)
 
static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW (PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA (PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext (PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp)
 
static SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext (PCtxtHandle phContext)
 
static SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY schannel_MakeSignature (PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
 
static SECURITY_STATUS SEC_ENTRY schannel_VerifySignature (PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, ULONG *pfQOP)
 
static SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage (PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
 
static SECURITY_STATUS SEC_ENTRY schannel_DecryptMessage (PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, ULONG *pfQOP)
 

Variables

static char * SCHANNEL_PACKAGE_NAME = "Schannel"
 
static ALG_ID schannel_SupportedAlgs []
 
const SecurityFunctionTableA SCHANNEL_SecurityFunctionTableA
 
const SecurityFunctionTableW SCHANNEL_SecurityFunctionTableW
 
const SecPkgInfoA SCHANNEL_SecPkgInfoA
 
static WCHAR SCHANNEL_SecPkgInfoW_Name [] = { 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', '\0' }
 
static WCHAR SCHANNEL_SecPkgInfoW_Comment []
 
const SecPkgInfoW SCHANNEL_SecPkgInfoW
 

Macro Definition Documentation

◆ TAG

#define TAG   WINPR_TAG("sspi.Schannel")

Function Documentation

◆ schannel_AcceptSecurityContext()

static SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext ( PCredHandle  phCredential,
PCtxtHandle  phContext,
PSecBufferDesc  pInput,
ULONG  fContextReq,
ULONG  TargetDataRep,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
PULONG  pfContextAttr,
PTimeStamp  ptsTimeStamp 
)
static
Here is the call graph for this function:

◆ schannel_AcquireCredentialsHandleA()

static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA ( SEC_CHAR pszPrincipal,
SEC_CHAR pszPackage,
ULONG  fCredentialUse,
void *  pvLogonID,
void *  pAuthData,
SEC_GET_KEY_FN  pGetKeyFn,
void *  pvGetKeyArgument,
PCredHandle  phCredential,
PTimeStamp  ptsExpiry 
)
static
Here is the call graph for this function:

◆ schannel_AcquireCredentialsHandleW()

static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW ( SEC_WCHAR pszPrincipal,
SEC_WCHAR pszPackage,
ULONG  fCredentialUse,
void *  pvLogonID,
void *  pAuthData,
SEC_GET_KEY_FN  pGetKeyFn,
void *  pvGetKeyArgument,
PCredHandle  phCredential,
PTimeStamp  ptsExpiry 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ schannel_ContextFree()

void schannel_ContextFree ( SCHANNEL_CONTEXT context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ schannel_ContextNew()

SCHANNEL_CONTEXT* schannel_ContextNew ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ schannel_CredentialsFree()

static void schannel_CredentialsFree ( SCHANNEL_CREDENTIALS credentials)
static
Here is the caller graph for this function:

◆ schannel_CredentialsNew()

static SCHANNEL_CREDENTIALS* schannel_CredentialsNew ( void  )
static
Here is the caller graph for this function:

◆ schannel_DecryptMessage()

static SECURITY_STATUS SEC_ENTRY schannel_DecryptMessage ( PCtxtHandle  phContext,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo,
ULONG *  pfQOP 
)
static
Here is the call graph for this function:

◆ schannel_DeleteSecurityContext()

static SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext ( PCtxtHandle  phContext)
static
Here is the call graph for this function:

◆ schannel_EncryptMessage()

static SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage ( PCtxtHandle  phContext,
ULONG  fQOP,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo 
)
static
Here is the call graph for this function:

◆ schannel_FreeCredentialsHandle()

static SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle ( PCredHandle  phCredential)
static
Here is the call graph for this function:

◆ schannel_InitializeSecurityContextA()

static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA ( PCredHandle  phCredential,
PCtxtHandle  phContext,
SEC_CHAR pszTargetName,
ULONG  fContextReq,
ULONG  Reserved1,
ULONG  TargetDataRep,
PSecBufferDesc  pInput,
ULONG  Reserved2,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
PULONG  pfContextAttr,
PTimeStamp  ptsExpiry 
)
static
Here is the call graph for this function:

◆ schannel_InitializeSecurityContextW()

static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW ( PCredHandle  phCredential,
PCtxtHandle  phContext,
SEC_WCHAR pszTargetName,
ULONG  fContextReq,
ULONG  Reserved1,
ULONG  TargetDataRep,
PSecBufferDesc  pInput,
ULONG  Reserved2,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
PULONG  pfContextAttr,
PTimeStamp  ptsExpiry 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ schannel_MakeSignature()

static SECURITY_STATUS SEC_ENTRY schannel_MakeSignature ( PCtxtHandle  phContext,
ULONG  fQOP,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo 
)
static

◆ schannel_QueryContextAttributes()

static SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void *  pBuffer 
)
static

◆ schannel_QueryCredentialsAttributesA()

static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesA ( PCredHandle  phCredential,
ULONG  ulAttribute,
void *  pBuffer 
)
static
Here is the call graph for this function:

◆ schannel_QueryCredentialsAttributesW()

static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW ( PCredHandle  phCredential,
ULONG  ulAttribute,
void *  pBuffer 
)
static
Here is the caller graph for this function:

◆ schannel_VerifySignature()

static SECURITY_STATUS SEC_ENTRY schannel_VerifySignature ( PCtxtHandle  phContext,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo,
ULONG *  pfQOP 
)
static

Variable Documentation

◆ SCHANNEL_PACKAGE_NAME

char* SCHANNEL_PACKAGE_NAME = "Schannel"
static

WinPR: Windows Portable Runtime Schannel Security Package

Copyright 2012-2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ SCHANNEL_SecPkgInfoA

const SecPkgInfoA SCHANNEL_SecPkgInfoA
Initial value:
= {
0x000107B3,
1,
0x000E,
"Schannel",
"Schannel Security Package"
}

◆ SCHANNEL_SecPkgInfoW

const SecPkgInfoW SCHANNEL_SecPkgInfoW

◆ SCHANNEL_SecPkgInfoW_Comment

WCHAR SCHANNEL_SecPkgInfoW_Comment[]
static
Initial value:
= { 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', ' ',
'S', 'e', 'c', 'u', 'r', 'i', 't', 'y', ' ',
'P', 'a', 'c', 'k', 'a', 'g', 'e', '\0' }

◆ SCHANNEL_SecPkgInfoW_Name

WCHAR SCHANNEL_SecPkgInfoW_Name[] = { 'S', 'c', 'h', 'a', 'n', 'n', 'e', 'l', '\0' }
static

◆ SCHANNEL_SecurityFunctionTableA

◆ SCHANNEL_SecurityFunctionTableW

◆ schannel_SupportedAlgs

CALG_AES_128
#define CALG_AES_128
Definition: winpr/include/winpr/crypto.h:199
schannel_AcceptSecurityContext
static SECURITY_STATUS SEC_ENTRY schannel_AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp)
Definition: schannel.c:246
schannel_QueryCredentialsAttributesW
static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesW(PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
Definition: schannel.c:91
SCHANNEL_SecPkgInfoW_Comment
static WCHAR SCHANNEL_SecPkgInfoW_Comment[]
Definition: schannel.c:433
schannel_QueryCredentialsAttributesA
static SECURITY_STATUS SEC_ENTRY schannel_QueryCredentialsAttributesA(PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
Definition: schannel.c:121
schannel_DeleteSecurityContext
static SECURITY_STATUS SEC_ENTRY schannel_DeleteSecurityContext(PCtxtHandle phContext)
Definition: schannel.c:272
CALG_SHA_512
#define CALG_SHA_512
Definition: winpr/include/winpr/crypto.h:206
CALG_MD5
#define CALG_MD5
Definition: winpr/include/winpr/crypto.h:158
schannel_AcquireCredentialsHandleA
static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleA(SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, void *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: schannel.c:163
CALG_SHA_384
#define CALG_SHA_384
Definition: winpr/include/winpr/crypto.h:205
schannel_InitializeSecurityContextA
static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextA(PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
Definition: schannel.c:226
schannel_DecryptMessage
static SECURITY_STATUS SEC_ENTRY schannel_DecryptMessage(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, ULONG *pfQOP)
Definition: schannel.c:345
CALG_AES_256
#define CALG_AES_256
Definition: winpr/include/winpr/crypto.h:201
SCHANNEL_SecPkgInfoW_Name
static WCHAR SCHANNEL_SecPkgInfoW_Name[]
Definition: schannel.c:431
SCHANNEL_CB_MAX_TOKEN
#define SCHANNEL_CB_MAX_TOKEN
Definition: libwinpr/sspi/sspi.h:25
ALG_TYPE_RESERVED7
#define ALG_TYPE_RESERVED7
Definition: winpr/include/winpr/crypto.h:35
CALG_SHA_256
#define CALG_SHA_256
Definition: winpr/include/winpr/crypto.h:204
CALG_ECDSA
#define CALG_ECDSA
Definition: winpr/include/winpr/crypto.h:634
schannel_QueryContextAttributes
static SECURITY_STATUS SEC_ENTRY schannel_QueryContextAttributes(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
Definition: schannel.c:284
schannel_AcquireCredentialsHandleW
static SECURITY_STATUS SEC_ENTRY schannel_AcquireCredentialsHandleW(SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, void *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
Definition: schannel.c:128
ALG_CLASS_KEY_EXCHANGE
#define ALG_CLASS_KEY_EXCHANGE
Definition: winpr/include/winpr/crypto.h:68
schannel_InitializeSecurityContextW
static SECURITY_STATUS SEC_ENTRY schannel_InitializeSecurityContextW(PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
Definition: schannel.c:197
CALG_DES
#define CALG_DES
Definition: winpr/include/winpr/crypto.h:168
CALG_RSA_SIGN
#define CALG_RSA_SIGN
Definition: winpr/include/winpr/crypto.h:162
schannel_VerifySignature
static SECURITY_STATUS SEC_ENTRY schannel_VerifySignature(PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, ULONG *pfQOP)
Definition: schannel.c:323
CALG_DSS_SIGN
#define CALG_DSS_SIGN
Definition: winpr/include/winpr/crypto.h:163
schannel_FreeCredentialsHandle
static SECURITY_STATUS SEC_ENTRY schannel_FreeCredentialsHandle(PCredHandle phCredential)
Definition: schannel.c:181
CALG_SHA1
#define CALG_SHA1
Definition: winpr/include/winpr/crypto.h:160
CALG_DH_EPHEM
#define CALG_DH_EPHEM
Definition: winpr/include/winpr/crypto.h:176
CALG_3DES
#define CALG_3DES
Definition: winpr/include/winpr/crypto.h:170
CALG_RC4
#define CALG_RC4
Definition: winpr/include/winpr/crypto.h:173
schannel_MakeSignature
static SECURITY_STATUS SEC_ENTRY schannel_MakeSignature(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: schannel.c:317
NULL
if availableBytes return NULL
Definition: TPCircularBuffer.h:109
schannel_EncryptMessage
static SECURITY_STATUS SEC_ENTRY schannel_EncryptMessage(PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
Definition: schannel.c:330