schannel/tests: Fix crash on Win7.
This commit is contained in:
parent
2165c2640e
commit
875d3b9799
|
@ -109,6 +109,12 @@ static SECPKG_FUNCTION_TABLE secPkgFunctionTable[2] =
|
|||
NULL, /* SetExtendedInformation */
|
||||
NULL, /* SetContextAttributes */
|
||||
NULL, /* SetCredentialsAttributes */
|
||||
NULL, /* ChangeAccountPassword */
|
||||
NULL, /* QueryMetaData */
|
||||
NULL, /* ExchangeMetaData */
|
||||
NULL, /* GetCredUIContext */
|
||||
NULL, /* UpdateCredentials */
|
||||
NULL, /* ValidateTargetInfo */
|
||||
}, {
|
||||
NULL, /* InitializePackage */
|
||||
NULL, /* LsaLogonUser */
|
||||
|
@ -139,6 +145,12 @@ static SECPKG_FUNCTION_TABLE secPkgFunctionTable[2] =
|
|||
NULL, /* SetExtendedInformation */
|
||||
NULL, /* SetContextAttributes */
|
||||
NULL, /* SetCredentialsAttributes */
|
||||
NULL, /* ChangeAccountPassword */
|
||||
NULL, /* QueryMetaData */
|
||||
NULL, /* ExchangeMetaData */
|
||||
NULL, /* GetCredUIContext */
|
||||
NULL, /* UpdateCredentials */
|
||||
NULL, /* ValidateTargetInfo */
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -150,7 +162,7 @@ NTSTATUS WINAPI SpLsaModeInitialize(ULONG LsaVersion, PULONG PackageVersion,
|
|||
{
|
||||
TRACE("(%u, %p, %p, %p)\n", LsaVersion, PackageVersion, ppTables, pcTables);
|
||||
|
||||
*PackageVersion = SECPKG_INTERFACE_VERSION_3;
|
||||
*PackageVersion = SECPKG_INTERFACE_VERSION_6;
|
||||
*pcTables = 2;
|
||||
*ppTables = secPkgFunctionTable;
|
||||
|
||||
|
|
|
@ -37,7 +37,13 @@
|
|||
SetContextAttributes)
|
||||
#define SECPKG_FUNCTION_TABLE_SIZE_2 FIELD_OFFSET(SECPKG_FUNCTION_TABLE, \
|
||||
SetCredentialsAttributes)
|
||||
#define SECPKG_FUNCTION_TABLE_SIZE_3 sizeof(SECPKG_FUNCTION_TABLE)
|
||||
#define SECPKG_FUNCTION_TABLE_SIZE_3 FIELD_OFFSET(SECPKG_FUNCTION_TABLE, \
|
||||
ChangeAccountPassword)
|
||||
#define SECPKG_FUNCTION_TABLE_SIZE_4 FIELD_OFFSET(SECPKG_FUNCTION_TABLE, \
|
||||
QueryMetaData)
|
||||
#define SECPKG_FUNCTION_TABLE_SIZE_5 FIELD_OFFSET(SECPKG_FUNCTION_TABLE, \
|
||||
ValidateTargetInfo)
|
||||
#define SECPKG_FUNCTION_TABLE_SIZE_6 sizeof(SECPKG_FUNCTION_TABLE)
|
||||
|
||||
static NTSTATUS (NTAPI *pSpLsaModeInitialize)(ULONG, PULONG,
|
||||
PSECPKG_FUNCTION_TABLE*, PULONG);
|
||||
|
@ -121,6 +127,7 @@ static PSECPKG_FUNCTION_TABLE getNextSecPkgTable(PSECPKG_FUNCTION_TABLE pTable,
|
|||
ULONG Version)
|
||||
{
|
||||
size_t size;
|
||||
PSECPKG_FUNCTION_TABLE pNextTable;
|
||||
|
||||
if (Version == SECPKG_INTERFACE_VERSION)
|
||||
size = SECPKG_FUNCTION_TABLE_SIZE_1;
|
||||
|
@ -128,12 +135,32 @@ static PSECPKG_FUNCTION_TABLE getNextSecPkgTable(PSECPKG_FUNCTION_TABLE pTable,
|
|||
size = SECPKG_FUNCTION_TABLE_SIZE_2;
|
||||
else if (Version == SECPKG_INTERFACE_VERSION_3)
|
||||
size = SECPKG_FUNCTION_TABLE_SIZE_3;
|
||||
else if (Version == SECPKG_INTERFACE_VERSION_4)
|
||||
size = SECPKG_FUNCTION_TABLE_SIZE_4;
|
||||
else if (Version == SECPKG_INTERFACE_VERSION_5)
|
||||
size = SECPKG_FUNCTION_TABLE_SIZE_5;
|
||||
else if (Version == SECPKG_INTERFACE_VERSION_6)
|
||||
size = SECPKG_FUNCTION_TABLE_SIZE_6;
|
||||
else {
|
||||
ok(FALSE, "Unknown package version 0x%x\n", Version);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (PSECPKG_FUNCTION_TABLE)((PBYTE)pTable + size);
|
||||
pNextTable = (PSECPKG_FUNCTION_TABLE)((PBYTE)pTable + size);
|
||||
/* Win7 function tables appear to be SECPKG_INTERFACE_VERSION_6 format,
|
||||
but unfortunately SpLsaModeInitialize returns SECPKG_INTERFACE_VERSION_3.
|
||||
We detect that by comparing the "Initialize" pointer from the old table
|
||||
to the "FreeCredentialsHandle" pointer of the new table. These functions
|
||||
have different numbers of arguments, so they can't possibly point to the
|
||||
same implementation */
|
||||
if (broken((void *) pTable->Initialize == (void *) pNextTable->FreeCredentialsHandle &&
|
||||
pNextTable->FreeCredentialsHandle != NULL))
|
||||
{
|
||||
win_skip("Invalid function pointers for next package\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pNextTable;
|
||||
}
|
||||
|
||||
static void testGetInfo(void)
|
||||
|
@ -181,7 +208,9 @@ static void testGetInfo(void)
|
|||
PackageInfo.fCapabilities);
|
||||
ok(PackageInfo.wVersion == 1, "wVersion: %d\n", PackageInfo.wVersion);
|
||||
ok(PackageInfo.wRPCID == 14, "wRPCID: %d\n", PackageInfo.wRPCID);
|
||||
ok(PackageInfo.cbMaxToken == 0x4000, "cbMaxToken: 0x%x\n",
|
||||
ok(PackageInfo.cbMaxToken == 0x4000 ||
|
||||
PackageInfo.cbMaxToken == 0x6000, /* Win7 */
|
||||
"cbMaxToken: 0x%x\n",
|
||||
PackageInfo.cbMaxToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,9 @@ extern "C" {
|
|||
#define SECPKG_INTERFACE_VERSION 0x10000
|
||||
#define SECPKG_INTERFACE_VERSION_2 0x20000
|
||||
#define SECPKG_INTERFACE_VERSION_3 0x40000
|
||||
#define SECPKG_INTERFACE_VERSION_4 0x80000
|
||||
#define SECPKG_INTERFACE_VERSION_5 0x100000
|
||||
#define SECPKG_INTERFACE_VERSION_6 0x200000
|
||||
|
||||
/* enum definitions for Secure Service Provider/Authentication Packages */
|
||||
typedef enum _LSA_TOKEN_INFORMATION_TYPE {
|
||||
|
@ -144,6 +147,11 @@ typedef struct _SECPKG_EXTENDED_INFORMATION {
|
|||
} Info;
|
||||
} SECPKG_EXTENDED_INFORMATION, *PSECPKG_EXTENDED_INFORMATION;
|
||||
|
||||
typedef struct _SECPKG_TARGETINFO {
|
||||
PSID DomainSid;
|
||||
PCWSTR ComputerName;
|
||||
} SECPKG_TARGETINFO, *PSECPKG_TARGETINFO;
|
||||
|
||||
/* callbacks implemented by SSP/AP dlls and called by the LSA */
|
||||
typedef VOID (NTAPI *PLSA_CALLBACK_FUNCTION)(ULONG_PTR, ULONG_PTR, PSecBuffer,
|
||||
PSecBuffer);
|
||||
|
@ -345,6 +353,18 @@ typedef NTSTATUS (NTAPI SpSetContextAttributesFn)(LSA_SEC_HANDLE, ULONG, PVOID,
|
|||
ULONG);
|
||||
typedef NTSTATUS (NTAPI SpSetCredentialsAttributesFn)(LSA_SEC_HANDLE, ULONG,
|
||||
PVOID, ULONG);
|
||||
typedef NTSTATUS (NTAPI SpChangeAccountPasswordFn)(PUNICODE_STRING,
|
||||
PUNICODE_STRING, PUNICODE_STRING, PUNICODE_STRING, BOOLEAN, PSecBufferDesc);
|
||||
typedef NTSTATUS (NTAPI SpQueryMetaDataFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
|
||||
ULONG, PULONG, PUCHAR *, PLSA_SEC_HANDLE);
|
||||
typedef NTSTATUS (NTAPI SpExchangeMetaDataFn)(LSA_SEC_HANDLE, PUNICODE_STRING,
|
||||
ULONG, ULONG, PUCHAR, PLSA_SEC_HANDLE);
|
||||
typedef NTSTATUS (NTAPI SpGetCredUIContextFn)(LSA_SEC_HANDLE, GUID *, PULONG,
|
||||
PUCHAR *);
|
||||
typedef NTSTATUS (NTAPI SpUpdateCredentialsFn)(LSA_SEC_HANDLE, GUID *, ULONG,
|
||||
PUCHAR);
|
||||
typedef NTSTATUS (NTAPI SpValidateTargetInfoFn)(PLSA_CLIENT_REQUEST, PVOID,
|
||||
PVOID, ULONG, PSECPKG_TARGETINFO);
|
||||
|
||||
/* User-mode functions implemented by SSP/AP obtainable by a dispatch table */
|
||||
typedef NTSTATUS (NTAPI SpInstanceInitFn)(ULONG, PSECPKG_DLL_FUNCTIONS,
|
||||
|
@ -406,6 +426,15 @@ typedef struct SECPKG_FUNCTION_TABLE {
|
|||
/* Packages with version SECPKG_INTERFACE_VERSION_2 end here */
|
||||
SpSetCredentialsAttributesFn *SetCredentialsAttributes;
|
||||
/* Packages with version SECPKG_INTERFACE_VERSION_3 end here */
|
||||
SpChangeAccountPasswordFn *ChangeAccountPassword;
|
||||
/* Packages with version SECPKG_INTERFACE_VERSION_4 end here */
|
||||
SpQueryMetaDataFn *QueryMetaData;
|
||||
SpExchangeMetaDataFn *ExchangeMetaData;
|
||||
SpGetCredUIContextFn *GetCredUIContext;
|
||||
SpUpdateCredentialsFn *UpdateCredentials;
|
||||
/* Packages with version SECPKG_INTERFACE_VERSION_5 end here */
|
||||
SpValidateTargetInfoFn *ValidateTargetInfo;
|
||||
/* Packages with version SECPKG_INTERFACE_VERSION_6 end here */
|
||||
} SECPKG_FUNCTION_TABLE,
|
||||
*PSECPKG_FUNCTION_TABLE;
|
||||
|
||||
|
|
Loading…
Reference in New Issue