projects
/
platform
/
upstream
/
freerdp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c329aa
)
Removed duplicate function tables, respecting WITH_NATIVE_SSPI
author
Armin Novak
<armin.novak@thincast.com>
Wed, 17 Jun 2015 11:24:11 +0000
(13:24 +0200)
committer
Armin Novak
<armin.novak@thincast.com>
Wed, 17 Jun 2015 11:24:11 +0000
(13:24 +0200)
winpr/libwinpr/sspi/sspi.c
patch
|
blob
|
history
diff --git
a/winpr/libwinpr/sspi/sspi.c
b/winpr/libwinpr/sspi/sspi.c
index
e2d495a
..
d47e7d3
100644
(file)
--- a/
winpr/libwinpr/sspi/sspi.c
+++ b/
winpr/libwinpr/sspi/sspi.c
@@
-40,10
+40,13
@@
static HMODULE g_SspiModule = NULL;
static SecurityFunctionTableW* g_SspiW = NULL;
static SecurityFunctionTableA* g_SspiA = NULL;
static SecurityFunctionTableW* g_SspiW = NULL;
static SecurityFunctionTableA* g_SspiA = NULL;
-SecurityFunctionTableA sspi_SecurityFunctionTableA;
-SecurityFunctionTableW sspi_SecurityFunctionTableW;
+static BOOL ShouldUseNativeSspi(void);
+#if defined(WITH_NATIVE_SSPI)
+static BOOL InitializeSspiModule_Native(void);
+#endif
+static void InitializeSspiModule(DWORD flags);
-BOOL ShouldUseNativeSspi()
+BOOL ShouldUseNativeSspi(
void
)
{
BOOL status = FALSE;
#ifdef _WIN32
{
BOOL status = FALSE;
#ifdef _WIN32
@@
-70,6
+73,7
@@
BOOL ShouldUseNativeSspi()
return status;
}
return status;
}
+#if defined(WITH_NATIVE_SSPI)
BOOL InitializeSspiModule_Native(void)
{
INIT_SECURITY_INTERFACE_W pInitSecurityInterfaceW;
BOOL InitializeSspiModule_Native(void)
{
INIT_SECURITY_INTERFACE_W pInitSecurityInterfaceW;
@@
-94,6
+98,7
@@
BOOL InitializeSspiModule_Native(void)
return TRUE;
}
return TRUE;
}
+#endif
void InitializeSspiModule(DWORD flags)
{
void InitializeSspiModule(DWORD flags)
{
@@
-108,6
+113,7
@@
void InitializeSspiModule(DWORD flags)
g_Log = WLog_Get("com.winpr.sspi");
g_Log = WLog_Get("com.winpr.sspi");
+#if defined(WITH_NATIVE_SSPI)
if (flags && (flags & SSPI_INTERFACE_NATIVE))
{
status = InitializeSspiModule_Native();
if (flags && (flags & SSPI_INTERFACE_NATIVE))
{
status = InitializeSspiModule_Native();
@@
-123,6
+129,7
@@
void InitializeSspiModule(DWORD flags)
{
status = InitializeSspiModule_Native();
}
{
status = InitializeSspiModule_Native();
}
+#endif
if (!status)
{
if (!status)
{
@@
-315,7
+322,7
@@
SecurityFunctionTableW* SEC_ENTRY InitSecurityInterfaceExW(DWORD flags)
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceExW");
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceExW");
- return
&sspi_SecurityFunctionTable
W;
+ return
g_Sspi
W;
}
SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA(DWORD flags)
}
SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA(DWORD flags)
@@
-325,7
+332,7
@@
SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA(DWORD flags)
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceExA");
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceExA");
- return
&sspi_SecurityFunctionTable
A;
+ return
g_Sspi
A;
}
/**
}
/**
@@
-375,7
+382,7
@@
SecurityFunctionTableW* SEC_ENTRY sspi_InitSecurityInterfaceW(void)
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceW");
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceW");
- return
&sspi_SecurityFunctionTable
W;
+ return
g_Sspi
W;
}
SecurityFunctionTableA* SEC_ENTRY sspi_InitSecurityInterfaceA(void)
}
SecurityFunctionTableA* SEC_ENTRY sspi_InitSecurityInterfaceA(void)
@@
-385,7
+392,7
@@
SecurityFunctionTableA* SEC_ENTRY sspi_InitSecurityInterfaceA(void)
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceA");
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceA");
- return
&sspi_SecurityFunctionTable
A;
+ return
g_Sspi
A;
}
SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName, PSecPkgInfoW* ppPackageInfo)
}
SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName, PSecPkgInfoW* ppPackageInfo)
@@
-425,8
+432,8
@@
SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoA(SEC_CHAR* pszPackageNam
/* Credential Management */
SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal, SEC_WCHAR* pszPackage,
/* Credential Management */
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)
+
ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn,
+
void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
{
SECURITY_STATUS status;
{
SECURITY_STATUS status;
@@
-437,7
+444,7
@@
SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiW->AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse,
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiW->AcquireCredentialsHandleW(pszPrincipal, pszPackage, fCredentialUse,
- pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry);
+
pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry);
WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleW: %s (0x%04X)", GetSecurityStatusString(status), status);
WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleW: %s (0x%04X)", GetSecurityStatusString(status), status);
@@
-445,8
+452,8
@@
SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleW(SEC_WCHAR* pszPrincipal
}
SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage,
}
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)
+
ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn,
+
void* pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
{
SECURITY_STATUS status;
{
SECURITY_STATUS status;
@@
-457,7
+464,7
@@
SECURITY_STATUS SEC_ENTRY sspi_AcquireCredentialsHandleA(SEC_CHAR* pszPrincipal,
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiA->AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse,
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiA->AcquireCredentialsHandleA(pszPrincipal, pszPackage, fCredentialUse,
- pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry);
+
pvLogonID, pAuthData, pGetKeyFn, pvGetKeyArgument, phCredential, ptsExpiry);
WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleA: %s (0x%04X)", GetSecurityStatusString(status), status);
WLog_Print(g_Log, WLOG_DEBUG, "AcquireCredentialsHandleA: %s (0x%04X)", GetSecurityStatusString(status), status);
@@
-569,8
+576,8
@@
SECURITY_STATUS SEC_ENTRY sspi_QueryCredentialsAttributesA(PCredHandle phCredent
/* Context Management */
SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext,
/* Context Management */
SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(PCredHandle phCredential, PCtxtHandle phContext,
- PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext,
- PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp)
+
PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext,
+
PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp)
{
SECURITY_STATUS status;
{
SECURITY_STATUS status;
@@
-581,7
+588,7
@@
SECURITY_STATUS SEC_ENTRY sspi_AcceptSecurityContext(PCredHandle phCredential, P
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiW->AcceptSecurityContext(phCredential, phContext, pInput, fContextReq,
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiW->AcceptSecurityContext(phCredential, phContext, pInput, fContextReq,
- TargetDataRep, phNewContext, pOutput, pfContextAttr, ptsTimeStamp);
+
TargetDataRep, phNewContext, pOutput, pfContextAttr, ptsTimeStamp);
WLog_Print(g_Log, WLOG_DEBUG, "AcceptSecurityContext: %s (0x%04X)", GetSecurityStatusString(status), status);
WLog_Print(g_Log, WLOG_DEBUG, "AcceptSecurityContext: %s (0x%04X)", GetSecurityStatusString(status), status);
@@
-674,9
+681,9
@@
SECURITY_STATUS SEC_ENTRY sspi_ImpersonateSecurityContext(PCtxtHandle phContext)
}
SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(PCredHandle phCredential, 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)
+
SEC_WCHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep,
+
PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext,
+
PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
{
SECURITY_STATUS status;
{
SECURITY_STATUS status;
@@
-687,8
+694,8
@@
SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(PCredHandle phCredenti
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiW->InitializeSecurityContextW(phCredential, phContext,
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiW->InitializeSecurityContextW(phCredential, phContext,
- pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput,
- Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry);
+
pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput,
+
Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry);
WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextW: %s (0x%04X)", GetSecurityStatusString(status), status);
WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextW: %s (0x%04X)", GetSecurityStatusString(status), status);
@@
-696,9
+703,9
@@
SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextW(PCredHandle phCredenti
}
SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA(PCredHandle phCredential, PCtxtHandle phContext,
}
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)
+
SEC_CHAR* pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep,
+
PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext,
+
PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
{
SECURITY_STATUS status;
{
SECURITY_STATUS status;
@@
-709,8
+716,8
@@
SECURITY_STATUS SEC_ENTRY sspi_InitializeSecurityContextA(PCredHandle phCredenti
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiA->InitializeSecurityContextA(phCredential, phContext,
return SEC_E_UNSUPPORTED_FUNCTION;
status = g_SspiA->InitializeSecurityContextA(phCredential, phContext,
- pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput,
- Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry);
+
pszTargetName, fContextReq, Reserved1, TargetDataRep, pInput,
+
Reserved2, phNewContext, pOutput, pfContextAttr, ptsExpiry);
WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextA: %s (0x%04X)", GetSecurityStatusString(status), status);
WLog_Print(g_Log, WLOG_DEBUG, "InitializeSecurityContextA: %s (0x%04X)", GetSecurityStatusString(status), status);