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
return status;
}
+#if defined(WITH_NATIVE_SSPI)
BOOL InitializeSspiModule_Native(void)
{
INIT_SECURITY_INTERFACE_W pInitSecurityInterfaceW;
return TRUE;
}
+#endif
void InitializeSspiModule(DWORD flags)
{
g_Log = WLog_Get("com.winpr.sspi");
+#if defined(WITH_NATIVE_SSPI)
if (flags && (flags & SSPI_INTERFACE_NATIVE))
{
status = InitializeSspiModule_Native();
{
status = InitializeSspiModule_Native();
}
+#endif
if (!status)
{
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceExW");
- return &sspi_SecurityFunctionTableW;
+ return g_SspiW;
}
SecurityFunctionTableA* SEC_ENTRY InitSecurityInterfaceExA(DWORD flags)
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceExA");
- return &sspi_SecurityFunctionTableA;
+ return g_SspiA;
}
/**
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceW");
- return &sspi_SecurityFunctionTableW;
+ return g_SspiW;
}
SecurityFunctionTableA* SEC_ENTRY sspi_InitSecurityInterfaceA(void)
WLog_Print(g_Log, WLOG_DEBUG, "InitSecurityInterfaceA");
- return &sspi_SecurityFunctionTableA;
+ return g_SspiA;
}
SECURITY_STATUS SEC_ENTRY sspi_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName, PSecPkgInfoW* ppPackageInfo)
/* 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;
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);
}
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;
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);
/* 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;
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);
}
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;
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);
}
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;
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);