Commit 3ed89c33 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

Added a secur32.dll that loads other SSP DLLs and forwards calls to

them.
parent c03dabb2
......@@ -1584,6 +1584,7 @@ dlls/richedit/Makefile
dlls/rpcrt4/Makefile
dlls/rpcrt4/tests/Makefile
dlls/rsabase/Makefile
dlls/secur32/Makefile
dlls/serialui/Makefile
dlls/setupapi/Makefile
dlls/shdocvw/Makefile
......
......@@ -97,6 +97,7 @@ BASEDIRS = \
richedit \
rpcrt4 \
rsabase \
secur32 \
serialui \
setupapi \
shdocvw \
......@@ -313,6 +314,7 @@ SYMLINKS = \
riched32.dll$(DLLEXT) \
rpcrt4.dll$(DLLEXT) \
rsabase.dll$(DLLEXT) \
secur32.dll$(DLLEXT) \
serialui.dll$(DLLEXT) \
setupapi.dll$(DLLEXT) \
shdocvw.dll$(DLLEXT) \
......@@ -694,6 +696,9 @@ rpcrt4.dll$(DLLEXT): rpcrt4/rpcrt4.dll$(DLLEXT)
rsabase.dll$(DLLEXT): rsabase/rsabase.dll$(DLLEXT)
$(RM) $@ && $(LN_S) rsabase/rsabase.dll$(DLLEXT) $@
secur32.dll$(DLLEXT): secur32/secur32.dll$(DLLEXT)
$(RM) $@ && $(LN_S) secur32/secur32.dll$(DLLEXT) $@
serialui.dll$(DLLEXT): serialui/serialui.dll$(DLLEXT)
$(RM) $@ && $(LN_S) serialui/serialui.dll$(DLLEXT) $@
......@@ -956,6 +961,7 @@ IMPORT_LIBS = \
libriched32 \
librpcrt4 \
librsabase \
libsecur32 \
libserialui \
libsetupapi \
libshdocvw \
......@@ -1394,6 +1400,11 @@ librsabase.def: rsabase/rsabase.spec.def
librsabase.a: rsabase/rsabase.spec.def
$(DLLTOOL) -k -l $@ -d rsabase/rsabase.spec.def
libsecur32.def: secur32/secur32.spec.def
$(RM) $@ && $(LN_S) secur32/secur32.spec.def $@
libsecur32.a: secur32/secur32.spec.def
$(DLLTOOL) -k -l $@ -d secur32/secur32.spec.def
libserialui.def: serialui/serialui.spec.def
$(RM) $@ && $(LN_S) serialui/serialui.spec.def $@
libserialui.a: serialui/serialui.spec.def
......@@ -1634,6 +1645,7 @@ rasapi32/rasapi32.spec.def: $(WINEBUILD)
richedit/riched32.spec.def: $(WINEBUILD)
rpcrt4/rpcrt4.spec.def: $(WINEBUILD)
rsabase/rsabase.spec.def: $(WINEBUILD)
secur32/secur32.spec.def: $(WINEBUILD)
serialui/serialui.spec.def: $(WINEBUILD)
setupapi/setupapi.spec.def: $(WINEBUILD)
shdocvw/shdocvw.spec.def: $(WINEBUILD)
......@@ -1767,6 +1779,7 @@ rasapi32/rasapi32.dll$(DLLEXT): rasapi32
richedit/riched32.dll$(DLLEXT): richedit
rpcrt4/rpcrt4.dll$(DLLEXT): rpcrt4
rsabase/rsabase.dll$(DLLEXT): rsabase
secur32/secur32.dll$(DLLEXT): secur32
serialui/serialui.dll$(DLLEXT): serialui
setupapi/setupapi.dll$(DLLEXT): setupapi
shdocvw/shdocvw.dll$(DLLEXT): shdocvw
......
Makefile
secur32.dll.dbg.c
secur32.spec.c
secur32.spec.def
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = secur32.dll
IMPORTS = user32 advapi32 kernel32 ntdll
C_SRCS = \
secur32.c \
thunks.c \
wrapper.c
@MAKE_DLL_RULES@
### Dependencies:
1 stub SecDeleteUserModeContext
2 stub SecInitUserModeContext
@ stdcall AcceptSecurityContext(ptr ptr ptr long long ptr ptr ptr ptr)
@ stdcall AcquireCredentialsHandleA(str str long ptr ptr ptr ptr ptr ptr)
@ stdcall AcquireCredentialsHandleW(wstr wstr long ptr ptr ptr ptr ptr ptr)
@ stdcall AddCredentialsA(ptr str str long ptr ptr ptr ptr)
@ stdcall AddCredentialsW(ptr wstr wstr long ptr ptr ptr ptr)
@ stub AddSecurityPackageA
@ stub AddSecurityPackageW
@ stdcall ApplyControlToken(ptr ptr)
@ stdcall CompleteAuthToken(ptr ptr)
@ stdcall DecryptMessage(ptr ptr long ptr)
@ stdcall DeleteSecurityContext(ptr)
@ stub DeleteSecurityPackageA
@ stub DeleteSecurityPackageW
@ stdcall EncryptMessage(ptr long ptr long)
@ stdcall EnumerateSecurityPackagesA(ptr ptr)
@ stdcall EnumerateSecurityPackagesW(ptr ptr)
@ stdcall ExportSecurityContext(ptr long ptr ptr)
@ stdcall FreeContextBuffer(ptr)
@ stdcall FreeCredentialsHandle(ptr)
@ stub GetComputerObjectNameA
@ stub GetComputerObjectNameW
@ stub GetSecurityUserInfo
@ stub GetUserNameExA
@ stub GetUserNameExW
@ stdcall ImpersonateSecurityContext(ptr)
@ stdcall ImportSecurityContextA(str ptr ptr ptr)
@ stdcall ImportSecurityContextW(wstr ptr ptr ptr)
@ stdcall InitSecurityInterfaceA()
@ stdcall InitSecurityInterfaceW()
@ stdcall InitializeSecurityContextA(ptr ptr str long long long ptr long ptr ptr ptr ptr)
@ stdcall InitializeSecurityContextW(ptr ptr wstr long long long ptr long ptr ptr ptr ptr)
@ stub LsaCallAuthenticationPackage
@ stub LsaConnectUntrusted
@ stub LsaDeregisterLogonProcess
@ stub LsaEnumerateLogonSessions
@ stub LsaFreeReturnBuffer
@ stub LsaGetLogonSessionData
@ stub LsaLogonUser
@ stub LsaLookupAuthenticationPackage
@ stub LsaRegisterLogonProcess
@ stub LsaRegisterPolicyChangeNotification
@ stub LsaUnregisterPolicyChangeNotification
@ stdcall MakeSignature(ptr long ptr long)
@ stdcall QueryContextAttributesA(ptr long ptr)
@ stdcall QueryContextAttributesW(ptr long ptr)
@ stdcall QueryCredentialsAttributesA(ptr long ptr)
@ stdcall QueryCredentialsAttributesW(ptr long ptr)
@ stdcall QuerySecurityContextToken(ptr ptr)
@ stdcall QuerySecurityPackageInfoA(str ptr)
@ stdcall QuerySecurityPackageInfoW(wstr ptr)
@ stdcall RevertSecurityContext(ptr)
@ stub SaslAcceptSecurityContext
@ stub SaslEnumerateProfilesA
@ stub SaslEnumerateProfilesW
@ stub SaslGetProfilePackageA
@ stub SaslGetProfilePackageW
@ stub SaslIdentifyPackageA
@ stub SaslIdentifyPackageW
@ stub SaslInitializeSecurityContextA
@ stub SaslInitializeSecurityContextW
@ stub SealMessage
@ stub SecCacheSspiPackages
@ stub SecGetLocaleSpecificEncryptionRules
@ stub SecpFreeMemory
@ stub SecpTranslateName
@ stub SecpTranslateNameEx
@ stub TranslateNameA
@ stub TranslateNameW
@ stub UnsealMessage
@ stdcall VerifySignature(ptr ptr long ptr)
/*
* secur32 private definitions.
*
* Copyright (C) 2004 Juan Lang
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __SECUR32_PRIV_H__
#define __SECUR32_PRIV_H__
/* Memory allocation functions for memory accessible by callers of secur32.
* There is no REALLOC, because LocalReAlloc can only work if used in
* conjunction with LMEM_MOVEABLE and LocalLock, but callers aren't using
* LocalLock. I don't use the Heap functions because there seems to be an
* implicit assumption that LocalAlloc and Free will be used--MS' secur32
* imports them (but not the heap functions), the sample SSP uses them, and
* there isn't an exported secur32 function to allocate memory.
*/
#define SECUR32_ALLOC(bytes) LocalAlloc(0, (bytes))
#define SECUR32_FREE(p) LocalFree(p)
typedef struct _SecureProvider
{
PWSTR moduleName;
HMODULE lib;
SecurityFunctionTableA fnTableA;
SecurityFunctionTableW fnTableW;
} SecureProvider;
typedef struct _SecurePackage
{
SecPkgInfoW infoW;
SecureProvider *provider;
} SecurePackage;
/* Tries to find the package named packageName. If it finds it, implicitly
* loads the package if it isn't already loaded.
*/
SecurePackage *SECUR32_findPackageW(PWSTR packageName);
/* Tries to find the package named packageName. (Thunks to _findPackageW)
*/
SecurePackage *SECUR32_findPackageA(PSTR packageName);
/* A few string helpers; will return NULL if str is NULL. Free return with
* SECUR32_FREE */
PWSTR SECUR32_strdupW(PCWSTR str);
PWSTR SECUR32_AllocWideFromMultiByte(PCSTR str);
PSTR SECUR32_AllocMultiByteFromWide(PCWSTR str);
#endif /* ndef __SECUR32_PRIV_H__ */
/* Copyright (C) 2004 Juan Lang
*
* This file defines thunks between wide char and multibyte functions for
* SSPs that only provide one or the other.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __SECUR32_THUNKS_H__
#define __SECUR32_THUNKS_H__
/* Prototypes for functions that thunk between wide char and multibyte versions,
* for SSPs that only provide one or the other.
*/
SECURITY_STATUS SEC_ENTRY thunk_AcquireCredentialsHandleA(
SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialsUse,
PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn,
PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry);
SECURITY_STATUS SEC_ENTRY thunk_AcquireCredentialsHandleW(
SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialsUse,
PLUID pvLogonID, PVOID pAuthData, SEC_GET_KEY_FN pGetKeyFn,
PVOID pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry);
SECURITY_STATUS SEC_ENTRY thunk_InitializeSecurityContextA(
PCredHandle phCredential, PCtxtHandle phContext,
SEC_CHAR *pszTargetName, unsigned long fContextReq,
unsigned long Reserved1, unsigned long TargetDataRep, PSecBufferDesc pInput,
unsigned long Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput,
unsigned long *pfContextAttr, PTimeStamp ptsExpiry);
SECURITY_STATUS SEC_ENTRY thunk_InitializeSecurityContextW(
PCredHandle phCredential, PCtxtHandle phContext,
SEC_WCHAR *pszTargetName, unsigned long fContextReq,
unsigned long Reserved1, unsigned long TargetDataRep, PSecBufferDesc pInput,
unsigned long Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput,
unsigned long *pfContextAttr, PTimeStamp ptsExpiry);
SECURITY_STATUS SEC_ENTRY thunk_ImportSecurityContextA(
SEC_CHAR *pszPackage, PSecBuffer pPackedContext, void *Token,
PCtxtHandle phContext);
SECURITY_STATUS SEC_ENTRY thunk_ImportSecurityContextW(
SEC_WCHAR *pszPackage, PSecBuffer pPackedContext, void *Token,
PCtxtHandle phContext);
SECURITY_STATUS SEC_ENTRY thunk_AddCredentialsA(PCredHandle hCredentials,
SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, unsigned long fCredentialUse,
void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument,
PTimeStamp ptsExpiry);
SECURITY_STATUS SEC_ENTRY thunk_AddCredentialsW(PCredHandle hCredentials,
SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, unsigned long fCredentialUse,
void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument,
PTimeStamp ptsExpiry);
SECURITY_STATUS SEC_ENTRY thunk_QueryCredentialsAttributesA(
PCredHandle phCredential, unsigned long ulAttribute, void *pBuffer);
SECURITY_STATUS SEC_ENTRY thunk_QueryCredentialsAttributesW(
PCredHandle phCredential, unsigned long ulAttribute, void *pBuffer);
SECURITY_STATUS SEC_ENTRY thunk_QueryContextAttributesA(
PCtxtHandle phContext, unsigned long ulAttribute, void *pBuffer);
SECURITY_STATUS SEC_ENTRY thunk_QueryContextAttributesW(
PCtxtHandle phContext, unsigned long ulAttribute, void *pBuffer);
SECURITY_STATUS SEC_ENTRY thunk_SetContextAttributesA(PCtxtHandle phContext,
unsigned long ulAttribute, void *pBuffer, unsigned long cbBuffer);
SECURITY_STATUS SEC_ENTRY thunk_SetContextAttributesW(PCtxtHandle phContext,
unsigned long ulAttribute, void *pBuffer, unsigned long cbBuffer);
#endif /* ndef __SECUR32_THUNKS_H__ */
......@@ -1535,6 +1535,7 @@
#define NOERROR _HRESULT_TYPEDEF_(0L)
#define S_OK _HRESULT_TYPEDEF_(0L)
#define SEC_E_OK _HRESULT_TYPEDEF_(0L)
#define S_FALSE _HRESULT_TYPEDEF_(1L)
#define E_PENDING _HRESULT_TYPEDEF_(0x8000000AL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment