FreeRDP
sspi.c File Reference
#include <winpr/sspi.h>
#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/wlog.h>
#include <winpr/library.h>
#include <winpr/environment.h>
#include "sspi.h"

Macros

#define _NO_KSECDD_IMPORT_   1
 

Functions

static BOOL CALLBACK InitializeSspiModuleInt (PINIT_ONCE once, PVOID param, PVOID *context)
 
const char * GetSecurityStatusString (SECURITY_STATUS status)
 
BOOL IsSecurityStatusError (SECURITY_STATUS status)
 
SecurityFunctionTableW *SEC_ENTRY InitSecurityInterfaceExW (DWORD flags)
 
SecurityFunctionTableA *SEC_ENTRY InitSecurityInterfaceExA (DWORD flags)
 
SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesW (ULONG *pcPackages, PSecPkgInfoW *ppPackageInfo)
 
SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesA (ULONG *pcPackages, PSecPkgInfoA *ppPackageInfo)
 
SecurityFunctionTableW *SEC_ENTRY sspi_InitSecurityInterfaceW (void)
 
SecurityFunctionTableA *SEC_ENTRY sspi_InitSecurityInterfaceA (void)
 
SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW (SEC_WCHAR *pszPackageName, PSecPkgInfoW *ppPackageInfo)
 
SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoA (SEC_CHAR *pszPackageName, PSecPkgInfoA *ppPackageInfo)
 
SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW (SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, void *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
 
SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA (SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, void *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
 
SECURITY_STATUS SEC_ENTRY sspi_ExportSecurityContext (PCtxtHandle phContext, ULONG fFlags, PSecBuffer pPackedContext, HANDLE *pToken)
 
SECURITY_STATUS SEC_ENTRY sspi_FreeCredentialsHandle (PCredHandle phCredential)
 
SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextW (SEC_WCHAR *pszPackage, PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext)
 
SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextA (SEC_CHAR *pszPackage, PSecBuffer pPackedContext, HANDLE pToken, PCtxtHandle phContext)
 
SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesW (PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
 
SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA (PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
 
SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext (PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp)
 
SECURITY_STATUS SEC_ENTRY sspi_ApplyControlToken (PCtxtHandle phContext, PSecBufferDesc pInput)
 
SECURITY_STATUS SEC_ENTRY sspi_CompleteAuthToken (PCtxtHandle phContext, PSecBufferDesc pToken)
 
SECURITY_STATUS SEC_ENTRY sspi_DeleteSecurityContext (PCtxtHandle phContext)
 
SECURITY_STATUS SEC_ENTRY sspi_FreeContextBuffer (void *pvContextBuffer)
 
SECURITY_STATUS SEC_ENTRY sspi_ImpersonateSecurityContext (PCtxtHandle phContext)
 
SECURITY_STATUS SEC_ENTRY sspi_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)
 
SECURITY_STATUS SEC_ENTRY sspi_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)
 
SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesW (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
 
SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesA (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
 
SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityContextToken (PCtxtHandle phContext, HANDLE *phToken)
 
SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesW (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer, ULONG cbBuffer)
 
SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesA (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer, ULONG cbBuffer)
 
SECURITY_STATUS SEC_ENTRY sspi_RevertSecurityContext (PCtxtHandle phContext)
 
SECURITY_STATUS SEC_ENTRY sspi_DecryptMessage (PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
 
SECURITY_STATUS SEC_ENTRY sspi_EncryptMessage (PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
 
SECURITY_STATUS SEC_ENTRY sspi_MakeSignature (PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
 
SECURITY_STATUS SEC_ENTRY sspi_VerifySignature (PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, PULONG pfQOP)
 

Variables

static wLog * g_Log = NULL
 
static INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT
 
static SecurityFunctionTableW * g_SspiW = NULL
 
static SecurityFunctionTableA * g_SspiA = NULL
 
SecurityFunctionTableA sspi_SecurityFunctionTableA
 
SecurityFunctionTableW sspi_SecurityFunctionTableW
 

Macro Definition Documentation

#define _NO_KSECDD_IMPORT_   1

FreeRDP: A Remote Desktop Protocol Implementation Security Support Provider Interface (SSPI)

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.

Function Documentation

const char* GetSecurityStatusString ( SECURITY_STATUS  status)
static BOOL CALLBACK InitializeSspiModuleInt ( PINIT_ONCE  once,
PVOID  param,
PVOID *  context 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA ( DWORD  flags)

Here is the call graph for this function:

SecurityFunctionTableW* SEC_ENTRY InitSecurityInterfaceExW ( DWORD  flags)

Here is the call graph for this function:

BOOL IsSecurityStatusError ( SECURITY_STATUS  status)

Here is the caller graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext ( PCredHandle  phCredential,
PCtxtHandle  phContext,
PSecBufferDesc  pInput,
ULONG  fContextReq,
ULONG  TargetDataRep,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
PULONG  pfContextAttr,
PTimeStamp  ptsTimeStamp 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA ( SEC_CHAR pszPrincipal,
SEC_CHAR pszPackage,
ULONG  fCredentialUse,
void pvLogonID,
void pAuthData,
SEC_GET_KEY_FN  pGetKeyFn,
void pvGetKeyArgument,
PCredHandle  phCredential,
PTimeStamp  ptsExpiry 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW ( SEC_WCHAR pszPrincipal,
SEC_WCHAR pszPackage,
ULONG  fCredentialUse,
void pvLogonID,
void pAuthData,
SEC_GET_KEY_FN  pGetKeyFn,
void pvGetKeyArgument,
PCredHandle  phCredential,
PTimeStamp  ptsExpiry 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_ApplyControlToken ( PCtxtHandle  phContext,
PSecBufferDesc  pInput 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_CompleteAuthToken ( PCtxtHandle  phContext,
PSecBufferDesc  pToken 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_DecryptMessage ( PCtxtHandle  phContext,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo,
PULONG  pfQOP 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_DeleteSecurityContext ( PCtxtHandle  phContext)

Here is the call graph for this function:

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

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesA ( ULONG *  pcPackages,
PSecPkgInfoA ppPackageInfo 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_EnumerateSecurityPackagesW ( ULONG *  pcPackages,
PSecPkgInfoW ppPackageInfo 
)

Standard SSPI API

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_ExportSecurityContext ( PCtxtHandle  phContext,
ULONG  fFlags,
PSecBuffer  pPackedContext,
HANDLE *  pToken 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_FreeContextBuffer ( void pvContextBuffer)

Here is the call graph for this function:

Here is the caller graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_FreeCredentialsHandle ( PCredHandle  phCredential)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_ImpersonateSecurityContext ( PCtxtHandle  phContext)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextA ( SEC_CHAR pszPackage,
PSecBuffer  pPackedContext,
HANDLE  pToken,
PCtxtHandle  phContext 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_ImportSecurityContextW ( SEC_WCHAR pszPackage,
PSecBuffer  pPackedContext,
HANDLE  pToken,
PCtxtHandle  phContext 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_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 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_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 
)

Here is the call graph for this function:

SecurityFunctionTableA* SEC_ENTRY sspi_InitSecurityInterfaceA ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

SecurityFunctionTableW* SEC_ENTRY sspi_InitSecurityInterfaceW ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesA ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_QueryContextAttributesW ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA ( PCredHandle  phCredential,
ULONG  ulAttribute,
void pBuffer 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesW ( PCredHandle  phCredential,
ULONG  ulAttribute,
void pBuffer 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityContextToken ( PCtxtHandle  phContext,
HANDLE *  phToken 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoA ( SEC_CHAR pszPackageName,
PSecPkgInfoA ppPackageInfo 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW ( SEC_WCHAR pszPackageName,
PSecPkgInfoW ppPackageInfo 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_RevertSecurityContext ( PCtxtHandle  phContext)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesA ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer,
ULONG  cbBuffer 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_SetContextAttributesW ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer,
ULONG  cbBuffer 
)

Here is the call graph for this function:

SECURITY_STATUS SEC_ENTRY sspi_VerifySignature ( PCtxtHandle  phContext,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo,
PULONG  pfQOP 
)

Here is the call graph for this function:

Variable Documentation

INIT_ONCE g_Initialized = INIT_ONCE_STATIC_INIT
static
wLog* g_Log = NULL
static
SecurityFunctionTableA* g_SspiA = NULL
static
SecurityFunctionTableW* g_SspiW = NULL
static
SecurityFunctionTableA sspi_SecurityFunctionTableA
SecurityFunctionTableW sspi_SecurityFunctionTableW