Commit d42a601b authored by Zhangrong Huang's avatar Zhangrong Huang Committed by Alexandre Julliard

secur32: Allow loading external schannel.dll.

parent 746cdb4a
...@@ -358,11 +358,12 @@ static const SecurityFunctionTableW schanTableW = { ...@@ -358,11 +358,12 @@ static const SecurityFunctionTableW schanTableW = {
static const WCHAR schannelComment[] = { 'S','c','h','a','n','n','e','l',' ', static const WCHAR schannelComment[] = { 'S','c','h','a','n','n','e','l',' ',
'S','e','c','u','r','i','t','y',' ','P','a','c','k','a','g','e',0 }; 'S','e','c','u','r','i','t','y',' ','P','a','c','k','a','g','e',0 };
static const WCHAR schannelDllName[] = { 's','c','h','a','n','n','e','l','.','d','l','l',0 };
void SECUR32_initSchannelSP(void) void SECUR32_initSchannelSP(void)
{ {
SecureProvider *provider = SECUR32_addProvider(&schanTableA, &schanTableW, SecureProvider *provider = SECUR32_addProvider(&schanTableA, &schanTableW,
NULL); schannelDllName);
if (provider) if (provider)
{ {
......
...@@ -419,10 +419,10 @@ SecureProvider *SECUR32_addProvider(const SecurityFunctionTableA *fnTableA, ...@@ -419,10 +419,10 @@ SecureProvider *SECUR32_addProvider(const SecurityFunctionTableA *fnTableA,
if (fnTableA || fnTableW) if (fnTableA || fnTableW)
{ {
ret->moduleName = NULL; ret->moduleName = moduleName ? SECUR32_strdupW(moduleName) : NULL;
_makeFnTableA(&ret->fnTableA, fnTableA, fnTableW); _makeFnTableA(&ret->fnTableA, fnTableA, fnTableW);
_makeFnTableW(&ret->fnTableW, fnTableA, fnTableW); _makeFnTableW(&ret->fnTableW, fnTableA, fnTableW);
ret->loaded = TRUE; ret->loaded = moduleName ? FALSE : TRUE;
} }
else else
{ {
...@@ -505,9 +505,19 @@ static void _tryLoadProvider(PWSTR moduleName) ...@@ -505,9 +505,19 @@ static void _tryLoadProvider(PWSTR moduleName)
if (pInitSecurityInterfaceW) if (pInitSecurityInterfaceW)
fnTableW = pInitSecurityInterfaceW(); fnTableW = pInitSecurityInterfaceW();
if (fnTableW && fnTableW->EnumerateSecurityPackagesW) if (fnTableW && fnTableW->EnumerateSecurityPackagesW)
ret = fnTableW->EnumerateSecurityPackagesW(&toAdd, &infoW); {
if (fnTableW != &securityFunctionTableW)
ret = fnTableW->EnumerateSecurityPackagesW(&toAdd, &infoW);
else
TRACE("%s has built-in providers, skip adding\n", debugstr_w(moduleName));
}
else if (fnTableA && fnTableA->EnumerateSecurityPackagesA) else if (fnTableA && fnTableA->EnumerateSecurityPackagesA)
ret = fnTableA->EnumerateSecurityPackagesA(&toAdd, &infoA); {
if (fnTableA != &securityFunctionTableA)
ret = fnTableA->EnumerateSecurityPackagesA(&toAdd, &infoA);
else
TRACE("%s has built-in providers, skip adding\n", debugstr_w(moduleName));
}
if (ret == SEC_E_OK && toAdd > 0 && (infoW || infoA)) if (ret == SEC_E_OK && toAdd > 0 && (infoW || infoA))
{ {
SecureProvider *provider = SECUR32_addProvider(NULL, NULL, SecureProvider *provider = SECUR32_addProvider(NULL, NULL,
...@@ -624,8 +634,11 @@ SecurePackage *SECUR32_findPackageW(PCWSTR packageName) ...@@ -624,8 +634,11 @@ SecurePackage *SECUR32_findPackageW(PCWSTR packageName)
fnTableA = pInitSecurityInterfaceA(); fnTableA = pInitSecurityInterfaceA();
if (pInitSecurityInterfaceW) if (pInitSecurityInterfaceW)
fnTableW = pInitSecurityInterfaceW(); fnTableW = pInitSecurityInterfaceW();
_makeFnTableA(&ret->provider->fnTableA, fnTableA, fnTableW); /* dont't update built-in SecurityFunctionTable */
_makeFnTableW(&ret->provider->fnTableW, fnTableA, fnTableW); if (fnTableA != &securityFunctionTableA)
_makeFnTableA(&ret->provider->fnTableA, fnTableA, fnTableW);
if (fnTableW != &securityFunctionTableW)
_makeFnTableW(&ret->provider->fnTableW, fnTableA, fnTableW);
ret->provider->loaded = TRUE; ret->provider->loaded = TRUE;
} }
else else
......
...@@ -89,7 +89,8 @@ typedef enum _sign_direction { ...@@ -89,7 +89,8 @@ typedef enum _sign_direction {
} SignDirection; } SignDirection;
/* Allocates space for and initializes a new provider. If fnTableA or fnTableW /* Allocates space for and initializes a new provider. If fnTableA or fnTableW
* is non-NULL, assumes the provider is built-in (and is thus already loaded.) * is non-NULL, assumes the provider is built-in, and if moduleName is non-NULL,
* means must load the LSA/user mode functions tables from external SSP/AP module.
* Otherwise moduleName must not be NULL. * Otherwise moduleName must not be NULL.
* Returns a pointer to the stored provider entry, for use adding packages. * Returns a pointer to the stored provider entry, for use adding packages.
*/ */
......
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