From: Dmitry Timoshkov dmitry@baikal.ru
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/secur32/tests/ntlm.c | 334 ++++++++++++++------------------------ 1 file changed, 126 insertions(+), 208 deletions(-)
diff --git a/dlls/secur32/tests/ntlm.c b/dlls/secur32/tests/ntlm.c index 42d9b580d71..973cb9b7855 100644 --- a/dlls/secur32/tests/ntlm.c +++ b/dlls/secur32/tests/ntlm.c @@ -60,34 +60,6 @@ SECPKG_FLAG_NEGOTIABLE | \ SECPKG_FLAG_LOGON )
-static HMODULE secdll; -static PSecurityFunctionTableA (SEC_ENTRY * pInitSecurityInterfaceA)(void); -static SECURITY_STATUS (SEC_ENTRY * pFreeContextBuffer)(PVOID pv); -static SECURITY_STATUS (SEC_ENTRY * pQuerySecurityPackageInfoA)(SEC_CHAR*, PSecPkgInfoA*); -static SECURITY_STATUS (SEC_ENTRY * pAcquireCredentialsHandleA)(SEC_CHAR*, SEC_CHAR*, - ULONG, PLUID, PVOID, SEC_GET_KEY_FN, PVOID, PCredHandle, PTimeStamp); -static SECURITY_STATUS (SEC_ENTRY * pAcquireCredentialsHandleW)(SEC_CHAR*, SEC_WCHAR*, - ULONG, PLUID, void*, SEC_GET_KEY_FN, void*, CredHandle*, TimeStamp*); -static SECURITY_STATUS (SEC_ENTRY * pInitializeSecurityContextA)(PCredHandle, PCtxtHandle, - SEC_CHAR*, ULONG, ULONG, ULONG, PSecBufferDesc, ULONG, - PCtxtHandle, PSecBufferDesc, PULONG, PTimeStamp); -static SECURITY_STATUS (SEC_ENTRY * pCompleteAuthToken)(PCtxtHandle, PSecBufferDesc); -static SECURITY_STATUS (SEC_ENTRY * pAcceptSecurityContext)(PCredHandle, PCtxtHandle, - PSecBufferDesc, ULONG, ULONG, PCtxtHandle, PSecBufferDesc, - PULONG, PTimeStamp); -static SECURITY_STATUS (SEC_ENTRY * pFreeCredentialsHandle)(PCredHandle); -static SECURITY_STATUS (SEC_ENTRY * pDeleteSecurityContext)(PCtxtHandle); -static SECURITY_STATUS (SEC_ENTRY * pQueryContextAttributesA)(PCtxtHandle, ULONG, PVOID); -static SECURITY_STATUS (SEC_ENTRY * pMakeSignature)(PCtxtHandle, ULONG, - PSecBufferDesc, ULONG); -static SECURITY_STATUS (SEC_ENTRY * pVerifySignature)(PCtxtHandle, PSecBufferDesc, - ULONG, PULONG); -static SECURITY_STATUS (SEC_ENTRY * pEncryptMessage)(PCtxtHandle, ULONG, - PSecBufferDesc, ULONG); -static SECURITY_STATUS (SEC_ENTRY * pDecryptMessage)(PCtxtHandle, PSecBufferDesc, - ULONG, PULONG); -static BOOLEAN (WINAPI * pGetUserNameExA)(EXTENDED_NAME_FORMAT, LPSTR, PULONG); - typedef struct _SspiData { CredHandle cred; CtxtHandle ctxt; @@ -180,32 +152,6 @@ static char test_user[] = "testuser", test_pass[] = "testpass", sec_pkg_name[] = "NTLM";
-static void InitFunctionPtrs(void) -{ - secdll = LoadLibraryA("secur32.dll"); - if(!secdll) - secdll = LoadLibraryA("security.dll"); - if(secdll) - { - pInitSecurityInterfaceA = (PVOID)GetProcAddress(secdll, "InitSecurityInterfaceA"); - pFreeContextBuffer = (PVOID)GetProcAddress(secdll, "FreeContextBuffer"); - pQuerySecurityPackageInfoA = (PVOID)GetProcAddress(secdll, "QuerySecurityPackageInfoA"); - pAcquireCredentialsHandleA = (PVOID)GetProcAddress(secdll, "AcquireCredentialsHandleA"); - pAcquireCredentialsHandleW = (void*)GetProcAddress(secdll, "AcquireCredentialsHandleW"); - pInitializeSecurityContextA = (PVOID)GetProcAddress(secdll, "InitializeSecurityContextA"); - pCompleteAuthToken = (PVOID)GetProcAddress(secdll, "CompleteAuthToken"); - pAcceptSecurityContext = (PVOID)GetProcAddress(secdll, "AcceptSecurityContext"); - pFreeCredentialsHandle = (PVOID)GetProcAddress(secdll, "FreeCredentialsHandle"); - pDeleteSecurityContext = (PVOID)GetProcAddress(secdll, "DeleteSecurityContext"); - pQueryContextAttributesA = (PVOID)GetProcAddress(secdll, "QueryContextAttributesA"); - pMakeSignature = (PVOID)GetProcAddress(secdll, "MakeSignature"); - pVerifySignature = (PVOID)GetProcAddress(secdll, "VerifySignature"); - pEncryptMessage = (PVOID)GetProcAddress(secdll, "EncryptMessage"); - pDecryptMessage = (PVOID)GetProcAddress(secdll, "DecryptMessage"); - pGetUserNameExA = (PVOID)GetProcAddress(secdll, "GetUserNameExA"); - } -} - static const char* getSecError(SECURITY_STATUS status) { static char buf[20]; @@ -344,15 +290,15 @@ static SECURITY_STATUS setupClient(SspiData *sspi_data, SEC_CHAR *provider) SecPkgInfoA *sec_pkg_info;
trace("Running setupClient\n"); - - ret = pQuerySecurityPackageInfoA(provider, &sec_pkg_info); + + ret = QuerySecurityPackageInfoA(provider, &sec_pkg_info);
ok(ret == SEC_E_OK, "QuerySecurityPackageInfo returned %s\n", getSecError(ret));
setupBuffers(sspi_data, sec_pkg_info); - pFreeContextBuffer(sec_pkg_info); - - if((ret = pAcquireCredentialsHandleA(NULL, provider, SECPKG_CRED_OUTBOUND, + FreeContextBuffer(sec_pkg_info); + + if((ret = AcquireCredentialsHandleA(NULL, provider, SECPKG_CRED_OUTBOUND, NULL, sspi_data->id, NULL, NULL, &sspi_data->cred, &ttl)) != SEC_E_OK) { @@ -374,14 +320,14 @@ static SECURITY_STATUS setupServer(SspiData *sspi_data, SEC_CHAR *provider)
trace("Running setupServer\n");
- ret = pQuerySecurityPackageInfoA(provider, &sec_pkg_info); + ret = QuerySecurityPackageInfoA(provider, &sec_pkg_info);
ok(ret == SEC_E_OK, "QuerySecurityPackageInfo returned %s\n", getSecError(ret));
setupBuffers(sspi_data, sec_pkg_info); - pFreeContextBuffer(sec_pkg_info); + FreeContextBuffer(sec_pkg_info);
- if((ret = pAcquireCredentialsHandleA(NULL, provider, SECPKG_CRED_INBOUND, + if((ret = AcquireCredentialsHandleA(NULL, provider, SECPKG_CRED_INBOUND, NULL, NULL, NULL, NULL, &sspi_data->cred, &ttl)) != SEC_E_OK) { trace("AcquireCredentialsHandle() returned %s\n", getSecError(ret)); @@ -402,13 +348,13 @@ static SECURITY_STATUS setupFakeServer(SspiData *sspi_data, SEC_CHAR *provider)
trace("Running setupFakeServer\n");
- ret = pQuerySecurityPackageInfoA(provider, &sec_pkg_info); + ret = QuerySecurityPackageInfoA(provider, &sec_pkg_info);
ok(ret == SEC_E_OK, "QuerySecurityPackageInfo returned %s\n", getSecError(ret));
ret = setupBuffers(sspi_data, sec_pkg_info); - pFreeContextBuffer(sec_pkg_info); - + FreeContextBuffer(sec_pkg_info); + return ret; }
@@ -448,7 +394,7 @@ static SECURITY_STATUS runClient(SspiData *sspi_data, BOOL first, ULONG data_rep void *old_buf;
/* pass NULL as an output buffer */ - ret = pInitializeSecurityContextA(&sspi_data->cred, NULL, NULL, req_attr, + ret = InitializeSecurityContextA(&sspi_data->cred, NULL, NULL, req_attr, 0, data_rep, NULL, 0, &sspi_data->ctxt, NULL, &ctxt_attr, &ttl);
@@ -458,7 +404,7 @@ static SECURITY_STATUS runClient(SspiData *sspi_data, BOOL first, ULONG data_rep old_buf = out_buf->pBuffers[0].pvBuffer; out_buf->pBuffers[0].pvBuffer = NULL;
- ret = pInitializeSecurityContextA(&sspi_data->cred, NULL, NULL, req_attr, + ret = InitializeSecurityContextA(&sspi_data->cred, NULL, NULL, req_attr, 0, data_rep, NULL, 0, &sspi_data->ctxt, out_buf, &ctxt_attr, &ttl);
@@ -470,7 +416,7 @@ static SECURITY_STATUS runClient(SspiData *sspi_data, BOOL first, ULONG data_rep /* pass an output buffer of 0 size */ out_buf->pBuffers[0].cbBuffer = 0;
- ret = pInitializeSecurityContextA(&sspi_data->cred, NULL, NULL, req_attr, + ret = InitializeSecurityContextA(&sspi_data->cred, NULL, NULL, req_attr, 0, data_rep, NULL, 0, &sspi_data->ctxt, out_buf, &ctxt_attr, &ttl);
@@ -482,7 +428,7 @@ static SECURITY_STATUS runClient(SspiData *sspi_data, BOOL first, ULONG data_rep out_buf->pBuffers[0].cbBuffer = sspi_data->max_token; out_buf->pBuffers[0].BufferType = SECBUFFER_DATA;
- ret = pInitializeSecurityContextA(&sspi_data->cred, NULL, NULL, req_attr, + ret = InitializeSecurityContextA(&sspi_data->cred, NULL, NULL, req_attr, 0, data_rep, NULL, 0, &sspi_data->ctxt, out_buf, &ctxt_attr, &ttl);
@@ -492,13 +438,13 @@ static SECURITY_STATUS runClient(SspiData *sspi_data, BOOL first, ULONG data_rep
out_buf->pBuffers[0].cbBuffer = sspi_data->max_token;
- ret = pInitializeSecurityContextA(first?&sspi_data->cred:NULL, first?NULL:&sspi_data->ctxt, NULL, req_attr, + ret = InitializeSecurityContextA(first?&sspi_data->cred:NULL, first?NULL:&sspi_data->ctxt, NULL, req_attr, 0, data_rep, first?NULL:in_buf, 0, &sspi_data->ctxt, out_buf, &ctxt_attr, &ttl);
if(ret == SEC_I_COMPLETE_AND_CONTINUE || ret == SEC_I_COMPLETE_NEEDED) { - pCompleteAuthToken(&sspi_data->ctxt, out_buf); + CompleteAuthToken(&sspi_data->ctxt, out_buf); if(ret == SEC_I_COMPLETE_AND_CONTINUE) ret = SEC_I_CONTINUE_NEEDED; else if(ret == SEC_I_COMPLETE_NEEDED) @@ -523,13 +469,13 @@ static SECURITY_STATUS runServer(SspiData *sspi_data, BOOL first, ULONG data_rep
trace("Running the server the %s time\n", first?"first":"second");
- ret = pAcceptSecurityContext(&sspi_data->cred, first?NULL:&sspi_data->ctxt, + ret = AcceptSecurityContext(&sspi_data->cred, first?NULL:&sspi_data->ctxt, sspi_data->in_buf, 0, data_rep, &sspi_data->ctxt, sspi_data->out_buf, &ctxt_attr, &ttl);
if(ret == SEC_I_COMPLETE_AND_CONTINUE || ret == SEC_I_COMPLETE_NEEDED) { - pCompleteAuthToken(&sspi_data->ctxt, sspi_data->out_buf); + CompleteAuthToken(&sspi_data->ctxt, sspi_data->out_buf); if(ret == SEC_I_COMPLETE_AND_CONTINUE) ret = SEC_I_CONTINUE_NEEDED; else if(ret == SEC_I_COMPLETE_NEEDED) @@ -604,13 +550,13 @@ static void testInitializeSecurityContextFlags(void) TimeStamp ttl; PBYTE packet;
- if(pQuerySecurityPackageInfoA( sec_pkg_name, &pkg_info) != SEC_E_OK) + if(QuerySecurityPackageInfoA( sec_pkg_name, &pkg_info) != SEC_E_OK) { ok(0, "NTLM package not installed, skipping test.\n"); return; }
- pFreeContextBuffer(pkg_info); + FreeContextBuffer(pkg_info); id.User = (unsigned char*) test_user; id.UserLength = strlen((char *) id.User); id.Domain = (unsigned char *) workgroup; @@ -637,7 +583,7 @@ static void testInitializeSecurityContextFlags(void) /* Without any flags, the lowest byte should not have bits 0x20 or 0x10 set*/ req_attr = 0;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -649,12 +595,12 @@ static void testInitializeSecurityContextFlags(void) ok(((packet[12] & 0x10) == 0) && ((packet[12] & 0x20) == 0), "With req_attr == 0, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_CONNECTION, the lowest byte should not have bits 0x20 or 0x10 set*/ req_attr = ISC_REQ_CONNECTION;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -666,12 +612,12 @@ static void testInitializeSecurityContextFlags(void) ok(((packet[12] & 0x10) == 0) && ((packet[12] & 0x20) == 0), "For ISC_REQ_CONNECTION, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_EXTENDED_ERROR, the lowest byte should not have bits 0x20 or 0x10 set*/ req_attr = ISC_REQ_EXTENDED_ERROR;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -683,12 +629,12 @@ static void testInitializeSecurityContextFlags(void) ok(((packet[12] & 0x10) == 0) && ((packet[12] & 0x20) == 0), "For ISC_REQ_EXTENDED_ERROR, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_MUTUAL_AUTH, the lowest byte should not have bits 0x20 or 0x10 set*/ req_attr = ISC_REQ_MUTUAL_AUTH;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -700,12 +646,12 @@ static void testInitializeSecurityContextFlags(void) ok(((packet[12] & 0x10) == 0) && ((packet[12] & 0x20) == 0), "For ISC_REQ_MUTUAL_AUTH, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_USE_DCE_STYLE, the lowest byte should not have bits 0x20 or 0x10 set*/ req_attr = ISC_REQ_USE_DCE_STYLE;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -717,12 +663,12 @@ static void testInitializeSecurityContextFlags(void) ok(((packet[12] & 0x10) == 0) && ((packet[12] & 0x20) == 0), "For ISC_REQ_USE_DCE_STYLE, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_DELEGATE, the lowest byte should not have bits 0x20 or 0x10 set*/ req_attr = ISC_REQ_DELEGATE;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -734,12 +680,12 @@ static void testInitializeSecurityContextFlags(void) ok(((packet[12] & 0x10) == 0) && ((packet[12] & 0x20) == 0), "For ISC_REQ_DELEGATE, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_INTEGRITY, the lowest byte should have bit 0x10 set */ req_attr = ISC_REQ_INTEGRITY;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -751,12 +697,12 @@ static void testInitializeSecurityContextFlags(void) ok((packet[12] & 0x10) != 0, "For ISC_REQ_INTEGRITY, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_REPLAY_DETECT, the lowest byte should have bit 0x10 set */ req_attr = ISC_REQ_REPLAY_DETECT;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -768,12 +714,12 @@ static void testInitializeSecurityContextFlags(void) ok((packet[12] & 0x10) != 0, "For ISC_REQ_REPLAY_DETECT, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_SEQUENCE_DETECT, the lowest byte should have bit 0x10 set */ req_attr = ISC_REQ_SEQUENCE_DETECT;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -785,12 +731,12 @@ static void testInitializeSecurityContextFlags(void) ok((packet[12] & 0x10) != 0, "For ISC_REQ_SEQUENCE_DETECT, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
/* With ISC_REQ_CONFIDENTIALITY, the lowest byte should have bit 0x20 set */ req_attr = ISC_REQ_CONFIDENTIALITY;
- if((sec_status = pInitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, + if((sec_status = InitializeSecurityContextA(&client.cred, NULL, NULL, req_attr, 0, SECURITY_NETWORK_DREP, NULL, 0, &client.ctxt, client.out_buf, &ctxt_attr, &ttl)) != SEC_I_CONTINUE_NEEDED) { @@ -802,11 +748,11 @@ static void testInitializeSecurityContextFlags(void) ok((packet[12] & 0x20) != 0, "For ISC_REQ_CONFIDENTIALITY, flags are 0x%02x%02x%02x%02x.\n", packet[15], packet[14], packet[13], packet[12]); - pDeleteSecurityContext(&client.ctxt); + DeleteSecurityContext(&client.ctxt);
tISCFend: cleanupBuffers(&client); - pFreeCredentialsHandle(&client.cred); + FreeCredentialsHandle(&client.cred); }
/**********************************************************************/ @@ -827,13 +773,13 @@ static void testAuth(ULONG data_rep, BOOL fake) SecPkgContext_SessionKey session_key; SecPkgInfoA *pi;
- if(pQuerySecurityPackageInfoA( sec_pkg_name, &pkg_info)!= SEC_E_OK) + if(QuerySecurityPackageInfoA( sec_pkg_name, &pkg_info)!= SEC_E_OK) { ok(0, "NTLM package not installed, skipping test.\n"); return; }
- pFreeContextBuffer(pkg_info); + FreeContextBuffer(pkg_info); id.User = (unsigned char*) test_user; id.UserLength = strlen((char *) id.User); id.Domain = (unsigned char *) workgroup; @@ -850,7 +796,7 @@ static void testAuth(ULONG data_rep, BOOL fake) { skip("Error: Setting up the client returned %s, exiting test!\n", getSecError(sec_status)); - pFreeCredentialsHandle(&client.cred); + FreeCredentialsHandle(&client.cred); return; }
@@ -863,8 +809,8 @@ static void testAuth(ULONG data_rep, BOOL fake) { skip("Error: Setting up the server returned %s, exiting test!\n", getSecError(sec_status)); - pFreeCredentialsHandle(&server.cred); - pFreeCredentialsHandle(&client.cred); + FreeCredentialsHandle(&server.cred); + FreeCredentialsHandle(&client.cred); return; }
@@ -899,21 +845,21 @@ static void testAuth(ULONG data_rep, BOOL fake) goto tAuthend; }
- sec_status = pQueryContextAttributesA(&client.ctxt, SECPKG_ATTR_SIZES, &sizes); - ok(sec_status == SEC_E_OK, "pQueryContextAttributesA(SECPKG_ATTR_SIZES) returned %s\n", getSecError(sec_status)); + sec_status = QueryContextAttributesA(&client.ctxt, SECPKG_ATTR_SIZES, &sizes); + ok(sec_status == SEC_E_OK, "QueryContextAttributesA(SECPKG_ATTR_SIZES) returned %s\n", getSecError(sec_status)); ok((sizes.cbMaxToken == 1904) || (sizes.cbMaxToken == 2888), "cbMaxToken should be 1904 or 2888 but is %lu\n", sizes.cbMaxToken); ok(sizes.cbMaxSignature == 16, "cbMaxSignature should be 16 but is %lu\n", sizes.cbMaxSignature); ok(sizes.cbSecurityTrailer == 16, "cbSecurityTrailer should be 16 but is %lu\n", sizes.cbSecurityTrailer); ok(sizes.cbBlockSize == 0, "cbBlockSize should be 0 but is %lu\n", sizes.cbBlockSize);
- sec_status = pQueryContextAttributesA(&client.ctxt, SECPKG_ATTR_STREAM_SIZES, &stream_sizes); - ok(sec_status == SEC_E_UNSUPPORTED_FUNCTION, "pQueryContextAttributesA(SECPKG_ATTR_STREAM_SIZES) returned %s\n", + sec_status = QueryContextAttributesA(&client.ctxt, SECPKG_ATTR_STREAM_SIZES, &stream_sizes); + ok(sec_status == SEC_E_UNSUPPORTED_FUNCTION, "QueryContextAttributesA(SECPKG_ATTR_STREAM_SIZES) returned %s\n", getSecError(sec_status));
memset( &key, 0, sizeof(key) ); sec_status = QueryContextAttributesA( &client.ctxt, SECPKG_ATTR_KEY_INFO, &key ); - ok( sec_status == SEC_E_OK, "pQueryContextAttributesA returned %08lx\n", sec_status ); + ok( sec_status == SEC_E_OK, "QueryContextAttributesA returned %08lx\n", sec_status ); if (fake) { ok( !strcmp(key.sSignatureAlgorithmName, "RSADSI RC4-CRC32"), "got '%s'\n", key.sSignatureAlgorithmName ); @@ -933,7 +879,7 @@ static void testAuth(ULONG data_rep, BOOL fake)
memset( &session_key, 0, sizeof(session_key) ); sec_status = QueryContextAttributesA( &client.ctxt, SECPKG_ATTR_SESSION_KEY, &session_key ); - ok( sec_status == SEC_E_OK, "pQueryContextAttributesA returned %08lx\n", sec_status ); + ok( sec_status == SEC_E_OK, "QueryContextAttributesA returned %08lx\n", sec_status ); ok( session_key.SessionKeyLength, "got 0 key length\n" ); ok( session_key.SessionKey != NULL, "got NULL session key\n" ); FreeContextBuffer( session_key.SessionKey ); @@ -979,23 +925,23 @@ tAuthend:
if(!fake) { - sec_status = pDeleteSecurityContext(&server.ctxt); + sec_status = DeleteSecurityContext(&server.ctxt); ok(sec_status == SEC_E_OK, "DeleteSecurityContext(server) returned %s\n", getSecError(sec_status)); }
- sec_status = pDeleteSecurityContext(&client.ctxt); + sec_status = DeleteSecurityContext(&client.ctxt); ok(sec_status == SEC_E_OK, "DeleteSecurityContext(client) returned %s\n", getSecError(sec_status));
if(!fake) { - sec_status = pFreeCredentialsHandle(&server.cred); + sec_status = FreeCredentialsHandle(&server.cred); ok(sec_status == SEC_E_OK, "FreeCredentialsHandle(server) returned %s\n", getSecError(sec_status)); }
- sec_status = pFreeCredentialsHandle(&client.cred); + sec_status = FreeCredentialsHandle(&client.cred); ok(sec_status == SEC_E_OK, "FreeCredentialsHandle(client) returned %s\n", getSecError(sec_status)); } @@ -1021,13 +967,13 @@ static void testSignSeal(void) * This is basically the same as in testAuth with a fake server, * as we need a valid, authenticated context. */ - if(pQuerySecurityPackageInfoA( sec_pkg_name, &pkg_info) != SEC_E_OK) + if(QuerySecurityPackageInfoA( sec_pkg_name, &pkg_info) != SEC_E_OK) { ok(0, "NTLM package not installed, skipping test.\n"); return; }
- pFreeContextBuffer(pkg_info); + FreeContextBuffer(pkg_info); id.User = (unsigned char*) test_user; id.UserLength = strlen((char *) id.User); id.Domain = (unsigned char *) workgroup; @@ -1044,7 +990,7 @@ static void testSignSeal(void) { skip("Error: Setting up the client returned %s, exiting test!\n", getSecError(sec_status)); - pFreeCredentialsHandle(&client.cred); + FreeCredentialsHandle(&client.cred); return; }
@@ -1078,7 +1024,7 @@ static void testSignSeal(void) * Now start with the actual testing * ********************************************/
- if(pQueryContextAttributesA(&client.ctxt, SECPKG_ATTR_SIZES, + if(QueryContextAttributesA(&client.ctxt, SECPKG_ATTR_SIZES, &ctxt_sizes) != SEC_E_OK) { skip("Failed to get context sizes, aborting test.\n"); @@ -1098,7 +1044,7 @@ static void testSignSeal(void) fake_data[1].cbBuffer = lstrlenA(message); fake_data[1].pvBuffer = HeapAlloc(GetProcessHeap(), 0, fake_data[1].cbBuffer);
- sec_status = pMakeSignature(&client.ctxt, 0, &crypt, 0); + sec_status = MakeSignature(&client.ctxt, 0, &crypt, 0); ok(sec_status == SEC_E_INVALID_TOKEN, "MakeSignature returned %s, not SEC_E_INVALID_TOKEN.\n", getSecError(sec_status)); @@ -1118,7 +1064,7 @@ static void testSignSeal(void) * we should get the same signature for our data, no matter if * it is sent by the client or the server */ - sec_status = pMakeSignature(&client.ctxt, 0, &crypt, 0); + sec_status = MakeSignature(&client.ctxt, 0, &crypt, 0); ok(sec_status == SEC_E_OK, "MakeSignature returned %s, not SEC_E_OK.\n", getSecError(sec_status)); ok(!memcmp(crypt.pBuffers[0].pvBuffer, message_signature, @@ -1128,19 +1074,19 @@ static void testSignSeal(void)
memcpy(data[0].pvBuffer, crypt_trailer_client, data[0].cbBuffer);
- sec_status = pVerifySignature(&client.ctxt, &crypt, 0, &qop); + sec_status = VerifySignature(&client.ctxt, &crypt, 0, &qop); ok(sec_status == SEC_E_MESSAGE_ALTERED, "VerifySignature returned %s, not SEC_E_MESSAGE_ALTERED.\n", getSecError(sec_status)); ok(qop == 0xdeadbeef, "qop changed to %lu\n", qop);
memcpy(data[0].pvBuffer, message_signature, data[0].cbBuffer); - sec_status = pVerifySignature(&client.ctxt, &crypt, 0, &qop); + sec_status = VerifySignature(&client.ctxt, &crypt, 0, &qop); ok(sec_status == SEC_E_OK, "VerifySignature returned %s, not SEC_E_OK.\n", getSecError(sec_status)); ok(qop == 0xdeadbeef, "qop changed to %lu\n", qop);
- sec_status = pEncryptMessage(&client.ctxt, 0, &crypt, 0); + sec_status = EncryptMessage(&client.ctxt, 0, &crypt, 0); if (sec_status == SEC_E_UNSUPPORTED_FUNCTION) { skip("Encrypt message returned SEC_E_UNSUPPORTED_FUNCTION. " @@ -1178,7 +1124,7 @@ static void testSignSeal(void) memcpy(data[0].pvBuffer, crypt_trailer_server, data[0].cbBuffer); memcpy(data[1].pvBuffer, crypt_message_server, data[1].cbBuffer);
- sec_status = pDecryptMessage(&client.ctxt, &crypt, 0, &qop); + sec_status = DecryptMessage(&client.ctxt, &crypt, 0, &qop);
ok(sec_status == SEC_E_OK, "DecryptMessage returned %s, not SEC_E_OK.\n", getSecError(sec_status)); @@ -1212,7 +1158,7 @@ static void testSignSeal(void) complex_data[3].pvBuffer = HeapAlloc(GetProcessHeap(), 0, complex_data[3].cbBuffer);
/* We should get a dummy signature again. */ - sec_status = pMakeSignature(&client.ctxt, 0, &crypt, 0); + sec_status = MakeSignature(&client.ctxt, 0, &crypt, 0); ok(sec_status == SEC_E_OK, "MakeSignature returned %s, not SEC_E_OK.\n", getSecError(sec_status)); ok(!memcmp(crypt.pBuffers[3].pvBuffer, message_signature, @@ -1220,12 +1166,12 @@ static void testSignSeal(void)
/* Being a dummy signature, it will verify right away, as if the server * sent it */ - sec_status = pVerifySignature(&client.ctxt, &crypt, 0, &qop); + sec_status = VerifySignature(&client.ctxt, &crypt, 0, &qop); ok(sec_status == SEC_E_OK, "VerifySignature returned %s, not SEC_E_OK\n", getSecError(sec_status)); ok(qop == 0xdeadbeef, "qop changed to %lu\n", qop);
- sec_status = pEncryptMessage(&client.ctxt, 0, &crypt, 0); + sec_status = EncryptMessage(&client.ctxt, 0, &crypt, 0); ok(sec_status == SEC_E_OK, "EncryptMessage returned %s, not SEC_E_OK.\n", getSecError(sec_status));
@@ -1252,7 +1198,7 @@ static void testSignSeal(void) memcpy(complex_data[1].pvBuffer, crypt_message_server2, complex_data[1].cbBuffer); memcpy(complex_data[3].pvBuffer, crypt_trailer_server2, complex_data[3].cbBuffer);
- sec_status = pDecryptMessage(&client.ctxt, &crypt, 0, &qop); + sec_status = DecryptMessage(&client.ctxt, &crypt, 0, &qop); ok(sec_status == SEC_E_OK, "DecryptMessage returned %s, not SEC_E_OK.\n", getSecError(sec_status)); ok(qop == 0xdeadbeef, "qop changed to %lu\n", qop); @@ -1262,14 +1208,14 @@ end: cleanupBuffers(&client); cleanupBuffers(&server);
- pDeleteSecurityContext(&client.ctxt); - pFreeCredentialsHandle(&client.cred); + DeleteSecurityContext(&client.ctxt); + FreeCredentialsHandle(&client.cred);
HeapFree(GetProcessHeap(), 0, complex_data[1].pvBuffer); HeapFree(GetProcessHeap(), 0, complex_data[3].pvBuffer); }
-static BOOL testAcquireCredentialsHandle(void) +static void testAcquireCredentialsHandle(void) { CredHandle cred; TimeStamp ttl; @@ -1277,12 +1223,12 @@ static BOOL testAcquireCredentialsHandle(void) SEC_WINNT_AUTH_IDENTITY_A id; PSecPkgInfoA pkg_info = NULL;
- if(pQuerySecurityPackageInfoA(sec_pkg_name, &pkg_info) != SEC_E_OK) + if(QuerySecurityPackageInfoA(sec_pkg_name, &pkg_info) != SEC_E_OK) { ok(0, "NTLM package not installed, skipping test\n"); - return FALSE; + return; } - pFreeContextBuffer(pkg_info); + FreeContextBuffer(pkg_info);
id.User = (unsigned char*) test_user; id.UserLength = strlen((char *) id.User); @@ -1292,46 +1238,45 @@ static BOOL testAcquireCredentialsHandle(void) id.PasswordLength = strlen((char *) id.Password); id.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
- ret = pAcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandle() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
id.DomainLength = 0; - ret = pAcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandle() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
id.Domain = NULL; - ret = pAcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandle() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
id.Domain = (unsigned char *) workgroup; id.DomainLength = strlen((char *) id.Domain); id.UserLength = 0; id.User = NULL; - ret = pAcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandle() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
id.User = (unsigned char*) test_user; id.UserLength = strlen((char *) id.User); id.Password = NULL; id.PasswordLength = 0; - ret = pAcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandle() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); - return TRUE; + FreeCredentialsHandle(&cred); }
static void testAcquireCredentialsHandleW(void) @@ -1347,18 +1292,12 @@ static void testAcquireCredentialsHandleW(void) SEC_WINNT_AUTH_IDENTITY_W id; PSecPkgInfoA pkg_info = NULL;
- if(!pAcquireCredentialsHandleW) - { - win_skip("AcquireCredentialsHandleW not available\n"); - return; - } - - if(pQuerySecurityPackageInfoA(sec_pkg_name, &pkg_info) != SEC_E_OK) + if(QuerySecurityPackageInfoA(sec_pkg_name, &pkg_info) != SEC_E_OK) { ok(0, "NTLM package not installed, skipping test\n"); return; } - pFreeContextBuffer(pkg_info); + FreeContextBuffer(pkg_info);
id.User = test_userW; id.UserLength = lstrlenW(test_userW); @@ -1368,45 +1307,45 @@ static void testAcquireCredentialsHandleW(void) id.PasswordLength = lstrlenW(test_passW); id.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
- ret = pAcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandeW() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
id.DomainLength = 0; - ret = pAcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandeW() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
id.Domain = NULL; - ret = pAcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandeW() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
id.Domain = workgroupW; id.DomainLength = lstrlenW(workgroupW); id.UserLength = 0; id.User = NULL; - ret = pAcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandeW() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
id.User = test_userW; id.UserLength = lstrlenW(test_userW); id.Password = test_passW; /* NULL string causes a crash. */ id.PasswordLength = 0; - ret = pAcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandeW() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred);
/* Test using the ANSI structure. */ idA.User = (unsigned char*) test_user; @@ -1417,11 +1356,11 @@ static void testAcquireCredentialsHandleW(void) idA.PasswordLength = strlen(test_pass); idA.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
- ret = pAcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleW(NULL, sec_pkg_nameW, SECPKG_CRED_OUTBOUND, NULL, &idA, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandeW() returned %s\n", getSecError(ret)); - pFreeCredentialsHandle(&cred); + FreeCredentialsHandle(&cred); }
static void test_cred_multiple_use(void) @@ -1437,7 +1376,7 @@ static void test_cred_multiple_use(void) ULONG ctxt_attr; TimeStamp ttl;
- if(pQuerySecurityPackageInfoA(sec_pkg_name, &pkg_info) != SEC_E_OK) + if(QuerySecurityPackageInfoA(sec_pkg_name, &pkg_info) != SEC_E_OK) { ok(0, "NTLM package not installed, skipping test\n"); return; @@ -1446,7 +1385,7 @@ static void test_cred_multiple_use(void) buffers[0].BufferType = SECBUFFER_TOKEN; buffers[0].pvBuffer = HeapAlloc(GetProcessHeap(), 0, buffers[0].cbBuffer);
- pFreeContextBuffer(pkg_info); + FreeContextBuffer(pkg_info);
id.User = (unsigned char*) test_user; id.UserLength = strlen((char *) id.User); @@ -1456,7 +1395,7 @@ static void test_cred_multiple_use(void) id.PasswordLength = strlen((char *) id.Password); id.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;
- ret = pAcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, + ret = AcquireCredentialsHandleA(NULL, sec_pkg_name, SECPKG_CRED_OUTBOUND, NULL, &id, NULL, NULL, &cred, &ttl); ok(ret == SEC_E_OK, "AcquireCredentialsHandle() returned %s\n", getSecError(ret)); @@ -1465,21 +1404,21 @@ static void test_cred_multiple_use(void) buffer_desc.cBuffers = ARRAY_SIZE(buffers); buffer_desc.pBuffers = buffers;
- ret = pInitializeSecurityContextA(&cred, NULL, NULL, ISC_REQ_CONNECTION, + ret = InitializeSecurityContextA(&cred, NULL, NULL, ISC_REQ_CONNECTION, 0, SECURITY_NETWORK_DREP, NULL, 0, &ctxt1, &buffer_desc, &ctxt_attr, &ttl); ok(ret == SEC_I_CONTINUE_NEEDED, "InitializeSecurityContextA failed with error 0x%lx\n", ret);
- ret = pInitializeSecurityContextA(&cred, NULL, NULL, ISC_REQ_CONNECTION, + ret = InitializeSecurityContextA(&cred, NULL, NULL, ISC_REQ_CONNECTION, 0, SECURITY_NETWORK_DREP, NULL, 0, &ctxt2, &buffer_desc, &ctxt_attr, &ttl); ok(ret == SEC_I_CONTINUE_NEEDED, "Second InitializeSecurityContextA on cred handle failed with error 0x%lx\n", ret);
- ret = pDeleteSecurityContext(&ctxt1); + ret = DeleteSecurityContext(&ctxt1); ok(ret == SEC_E_OK, "DeleteSecurityContext failed with error 0x%lx\n", ret); - ret = pDeleteSecurityContext(&ctxt2); + ret = DeleteSecurityContext(&ctxt2); ok(ret == SEC_E_OK, "DeleteSecurityContext failed with error 0x%lx\n", ret); - ret = pFreeCredentialsHandle(&cred); + ret = FreeCredentialsHandle(&cred); ok(ret == SEC_E_OK, "FreeCredentialsHandle failed with error 0x%lx\n", ret);
HeapFree(GetProcessHeap(), 0, buffers[0].pvBuffer); @@ -1498,13 +1437,13 @@ static void test_null_auth_data(void) ULONG attr, size; BOOLEAN ret;
- if(pQuerySecurityPackageInfoA((SEC_CHAR *)"NTLM", &info) != SEC_E_OK) + if(QuerySecurityPackageInfoA((SEC_CHAR *)"NTLM", &info) != SEC_E_OK) { ok(0, "NTLM package not installed, skipping test\n"); return; }
- status = pAcquireCredentialsHandleA(NULL, (SEC_CHAR *)"NTLM", SECPKG_CRED_OUTBOUND, + status = AcquireCredentialsHandleA(NULL, (SEC_CHAR *)"NTLM", SECPKG_CRED_OUTBOUND, NULL, NULL, NULL, NULL, &cred, &ttl); ok(status == SEC_E_OK, "AcquireCredentialsHandle() failed %s\n", getSecError(status));
@@ -1517,54 +1456,33 @@ static void test_null_auth_data(void) buffer_desc.pBuffers = buffers;
size = sizeof(user); - ret = pGetUserNameExA(NameSamCompatible, user, &size); + ret = GetUserNameExA(NameSamCompatible, user, &size); ok(ret, "GetUserNameExA failed %lu\n", GetLastError());
- status = pInitializeSecurityContextA(&cred, NULL, (SEC_CHAR *)user, + status = InitializeSecurityContextA(&cred, NULL, (SEC_CHAR *)user, ISC_REQ_CONNECTION, 0, SECURITY_NETWORK_DREP, NULL, 0, &ctx, &buffer_desc, &attr, &ttl); ok(status == SEC_I_CONTINUE_NEEDED, "InitializeSecurityContextA failed %s\n", getSecError(status));
- ret = pDeleteSecurityContext(&ctx); + ret = DeleteSecurityContext(&ctx); ok(ret == SEC_E_OK, "DeleteSecurityContext failed with error 0x%x\n", ret); - ret = pFreeCredentialsHandle(&cred); + ret = FreeCredentialsHandle(&cred); ok(ret == SEC_E_OK, "FreeCredentialsHandle failed with error 0x%x\n", ret);
- pFreeContextBuffer(info); + FreeContextBuffer(info); HeapFree(GetProcessHeap(), 0, buffers[0].pvBuffer); }
START_TEST(ntlm) { - InitFunctionPtrs(); - - if(pFreeCredentialsHandle && pDeleteSecurityContext && - pAcquireCredentialsHandleA && pInitializeSecurityContextA && - pCompleteAuthToken && pQuerySecurityPackageInfoA) - { - testAcquireCredentialsHandleW(); - - if(!testAcquireCredentialsHandle()) - goto cleanup; - testInitializeSecurityContextFlags(); - if(pAcceptSecurityContext) - { - testAuth(SECURITY_NATIVE_DREP, TRUE); - testAuth(SECURITY_NETWORK_DREP, TRUE); - testAuth(SECURITY_NATIVE_DREP, FALSE); - testAuth(SECURITY_NETWORK_DREP, FALSE); - } - if(pMakeSignature && pVerifySignature && pEncryptMessage && - pDecryptMessage) - testSignSeal(); - - test_cred_multiple_use(); - if (pGetUserNameExA) test_null_auth_data(); - } - else - win_skip("Needed functions are not available\n"); - -cleanup: - if(secdll) - FreeLibrary(secdll); + testAcquireCredentialsHandleW(); + testAcquireCredentialsHandle(); + testInitializeSecurityContextFlags(); + testAuth(SECURITY_NATIVE_DREP, TRUE); + testAuth(SECURITY_NETWORK_DREP, TRUE); + testAuth(SECURITY_NATIVE_DREP, FALSE); + testAuth(SECURITY_NETWORK_DREP, FALSE); + testSignSeal(); + test_cred_multiple_use(); + test_null_auth_data(); }