39#define NEGOTIATE_BASE_CAPS ( \
40 SECPKG_FLAG_INTEGRITY | \
41 SECPKG_FLAG_PRIVACY | \
42 SECPKG_FLAG_CONNECTION | \
43 SECPKG_FLAG_MULTI_REQUIRED | \
44 SECPKG_FLAG_EXTENDED_ERROR | \
45 SECPKG_FLAG_IMPERSONATION | \
46 SECPKG_FLAG_ACCEPT_WIN32_NAME | \
47 SECPKG_FLAG_NEGOTIABLE | \
48 SECPKG_FLAG_GSS_COMPATIBLE | \
51#define NTLM_BASE_CAPS ( \
52 SECPKG_FLAG_INTEGRITY | \
53 SECPKG_FLAG_PRIVACY | \
54 SECPKG_FLAG_TOKEN_ONLY | \
55 SECPKG_FLAG_CONNECTION | \
56 SECPKG_FLAG_MULTI_REQUIRED | \
57 SECPKG_FLAG_IMPERSONATION | \
58 SECPKG_FLAG_ACCEPT_WIN32_NAME | \
59 SECPKG_FLAG_NEGOTIABLE | \
100 {0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00,
101 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x30, 0x00, 0x00, 0x00,
102 0x05, 0x82, 0x82, 0xa0, 0xe9, 0x58, 0x7f, 0x14, 0xa2, 0x86,
103 0x3b, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
104 0x54, 0x00, 0x54, 0x00, 0x40, 0x00, 0x00, 0x00, 0x43, 0x00,
105 0x41, 0x00, 0x53, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x4f, 0x00,
106 0x30, 0x00, 0x31, 0x00, 0x02, 0x00, 0x10, 0x00, 0x43, 0x00,
107 0x41, 0x00, 0x53, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x4f, 0x00,
108 0x30, 0x00, 0x31, 0x00, 0x01, 0x00, 0x10, 0x00, 0x43, 0x00,
109 0x41, 0x00, 0x53, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x4f, 0x00,
110 0x30, 0x00, 0x31, 0x00, 0x04, 0x00, 0x10, 0x00, 0x63, 0x00,
111 0x61, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00,
112 0x30, 0x00, 0x31, 0x00, 0x03, 0x00, 0x10, 0x00, 0x63, 0x00,
113 0x61, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00,
114 0x30, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00};
117 {0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00,
118 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x30, 0x00, 0x00, 0x00,
119 0x05, 0x82, 0x82, 0xa0, 0xb5, 0x60, 0x8e, 0x95, 0xb5, 0x3c,
120 0xee, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
121 0x54, 0x00, 0x54, 0x00, 0x40, 0x00, 0x00, 0x00, 0x43, 0x00,
122 0x41, 0x00, 0x53, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x4f, 0x00,
123 0x30, 0x00, 0x31, 0x00, 0x02, 0x00, 0x10, 0x00, 0x43, 0x00,
124 0x41, 0x00, 0x53, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x4f, 0x00,
125 0x30, 0x00, 0x31, 0x00, 0x01, 0x00, 0x10, 0x00, 0x43, 0x00,
126 0x41, 0x00, 0x53, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x4f, 0x00,
127 0x30, 0x00, 0x31, 0x00, 0x04, 0x00, 0x10, 0x00, 0x63, 0x00,
128 0x61, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00,
129 0x30, 0x00, 0x31, 0x00, 0x03, 0x00, 0x10, 0x00, 0x63, 0x00,
130 0x61, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x6f, 0x00,
131 0x30, 0x00, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00};
134 {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
135 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
138 {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x77, 0x6f, 0x72,
146 {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0xc7,
147 0xaa, 0x26, 0x16, 0x39, 0x07, 0x4e};
150 {0x86, 0x9c, 0x5a, 0x10, 0x78, 0xb3, 0x30, 0x98, 0x46, 0x15,
154 {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc5, 0xa7,
155 0xf7, 0x0f, 0x5b, 0x25, 0xbe, 0xa4};
158 {0x20, 0x6c, 0x01, 0xab, 0xb0, 0x4c, 0x93, 0xe4, 0x1e, 0xfc,
162 {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x46,
163 0x2e, 0x77, 0xeb, 0xf0, 0xf6, 0x9e};
166 {0xf6, 0xb7, 0x92, 0x0c, 0xac, 0xea, 0x98, 0xe6, 0xef, 0xa0,
170 {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb1, 0x4e,
171 0x46, 0xb7, 0xca, 0xf7, 0x7f, 0xb3};
174 {0xc8, 0xf2, 0x39, 0x7f, 0x0c, 0xaf, 0xf5, 0x5d, 0xef, 0x0c,
212#define _SEC_ERR(x) case (x): return #x;
255 if(sec_buffer ==
NULL){
256 trace(
"in_buf: sec_buffer == NULL\n");
264 sec_buffer->cbBuffer = sec_pkg_info->
cbMaxToken;
269 trace(
"in_buf: sec_buffer->pvBuffer == NULL\n");
275 trace(
"HeapAlloc in_buf returned NULL\n");
284 if(sec_buffer ==
NULL){
285 trace(
"out_buf: sec_buffer == NULL\n");
293 sec_buffer->cbBuffer = sec_pkg_info->
cbMaxToken;
297 trace(
"out_buf: sec_buffer->pvBuffer == NULL\n");
303 trace(
"HeapAlloc out_buf returned NULL\n");
345 trace(
"Running setupClient\n");
347 ret = pQuerySecurityPackageInfoA(provider, &sec_pkg_info);
352 pFreeContextBuffer(sec_pkg_info);
361 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandle() returned %s\n",
374 trace(
"Running setupServer\n");
376 ret = pQuerySecurityPackageInfoA(provider, &sec_pkg_info);
381 pFreeContextBuffer(sec_pkg_info);
389 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandle() returned %s\n",
402 trace(
"Running setupFakeServer\n");
404 ret = pQuerySecurityPackageInfoA(provider, &sec_pkg_info);
409 pFreeContextBuffer(sec_pkg_info);
428 assert(in_buf->pBuffers[0].cbBuffer != 0);
431 assert(out_buf->pBuffers[0].pvBuffer !=
NULL);
432 assert(out_buf->pBuffers[0].cbBuffer != 0);
434 trace(
"Running the client the %s time.\n",
first?
"first":
"second");
457 old_buf = out_buf->pBuffers[0].pvBuffer;
458 out_buf->pBuffers[0].pvBuffer =
NULL;
465 "expected SEC_E_INTERNAL_ERROR or SEC_I_CONTINUE_NEEDED, got %s\n",
getSecError(
ret));
467 out_buf->pBuffers[0].pvBuffer = old_buf;
470 out_buf->pBuffers[0].cbBuffer = 0;
478 ok(out_buf->pBuffers[0].cbBuffer == 0,
479 "InitializeSecurityContext set buffer size to %u\n", out_buf->pBuffers[0].cbBuffer);
508 "buffer type was changed from SECBUFFER_TOKEN to %d\n", out_buf->pBuffers[0].BufferType);
510 "InitializeSecurityContext set buffer size to %u\n", out_buf->pBuffers[0].cbBuffer);
523 trace(
"Running the server the %s time\n",
first?
"first":
"second");
545 trace(
"Running the fake server the %s time\n",
first?
"first":
"second");
575 trace(
"Running communicate.\n");
578 if((
from->out_buf->pBuffers[0].pvBuffer !=
NULL) &&
584 from->out_buf->pBuffers[0].pvBuffer,
585 from->out_buf->pBuffers[0].cbBuffer);
587 to->
in_buf->pBuffers[0].cbBuffer =
from->out_buf->pBuffers[0].cbBuffer;
602 ULONG req_attr, ctxt_attr;
608 ok(0,
"NTLM package not installed, skipping test.\n");
612 pFreeContextBuffer(pkg_info);
614 id.UserLength =
strlen((
char *)
id.User);
616 id.DomainLength =
strlen((
char *)
id.Domain);
617 id.Password = (
unsigned char*)
test_pass;
625 skip(
"Setting up the client returned %s, skipping test!\n",
639 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
643 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
649 "With req_attr == 0, flags are 0x%02x%02x%02x%02x.\n",
651 pDeleteSecurityContext(&
client.ctxt);
656 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
660 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
666 "For ISC_REQ_CONNECTION, flags are 0x%02x%02x%02x%02x.\n",
668 pDeleteSecurityContext(&
client.ctxt);
673 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
677 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
683 "For ISC_REQ_EXTENDED_ERROR, flags are 0x%02x%02x%02x%02x.\n",
685 pDeleteSecurityContext(&
client.ctxt);
690 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
694 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
700 "For ISC_REQ_MUTUAL_AUTH, flags are 0x%02x%02x%02x%02x.\n",
702 pDeleteSecurityContext(&
client.ctxt);
707 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
711 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
717 "For ISC_REQ_USE_DCE_STYLE, flags are 0x%02x%02x%02x%02x.\n",
719 pDeleteSecurityContext(&
client.ctxt);
724 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
728 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
734 "For ISC_REQ_DELEGATE, flags are 0x%02x%02x%02x%02x.\n",
736 pDeleteSecurityContext(&
client.ctxt);
741 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
745 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
751 "For ISC_REQ_INTEGRITY, flags are 0x%02x%02x%02x%02x.\n",
753 pDeleteSecurityContext(&
client.ctxt);
758 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
762 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
768 "For ISC_REQ_REPLAY_DETECT, flags are 0x%02x%02x%02x%02x.\n",
770 pDeleteSecurityContext(&
client.ctxt);
775 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
779 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
785 "For ISC_REQ_SEQUENCE_DETECT, flags are 0x%02x%02x%02x%02x.\n",
787 pDeleteSecurityContext(&
client.ctxt);
792 if((sec_status = pInitializeSecurityContextA(&
client.cred,
NULL,
NULL, req_attr,
796 trace(
"InitializeSecurityContext returned %s not SEC_I_CONTINUE_NEEDED, aborting.\n",
802 "For ISC_REQ_CONFIDENTIALITY, flags are 0x%02x%02x%02x%02x.\n",
804 pDeleteSecurityContext(&
client.ctxt);
808 pFreeCredentialsHandle(&
client.cred);
828 ok(0,
"NTLM package not installed, skipping test.\n");
832 pFreeContextBuffer(pkg_info);
834 id.UserLength =
strlen((
char *)
id.User);
836 id.DomainLength =
strlen((
char *)
id.Domain);
837 id.Password = (
unsigned char*)
test_pass;
847 skip(
"Error: Setting up the client returned %s, exiting test!\n",
849 pFreeCredentialsHandle(&
client.cred);
860 skip(
"Error: Setting up the server returned %s, exiting test!\n",
862 pFreeCredentialsHandle(&
server.cred);
863 pFreeCredentialsHandle(&
client.cred);
872 "Running the client returned %s, more tests will fail.\n",
884 "Running the server returned %s, more tests will fail from now.\n",
894 skip(
"Authentication failed, skipping test.\n");
902 "pQueryContextAttributesA(SECPKG_ATTR_SIZES) returned %s\n",
905 "cbMaxToken should be 1904 or 2888 but is %u\n",
908 "cbMaxSignature should be 16 but is %u\n",
911 "cbSecurityTrailer should be 16 but is %u\n",
914 "cbBlockSize should be 0 but is %u\n",
919 ok(sec_status ==
SEC_E_OK,
"QueryContextAttributesA returned %08x\n", sec_status);
923 ok(
pi !=
NULL,
"expected non-NULL PackageInfo\n");
936 "got %08x\n",
pi->fCapabilities);
937 ok(
pi->wVersion == 1,
"got %u\n",
pi->wVersion);
945 ok(
pi->Name +
lstrlenA(
pi->Name) < eob,
"Name doesn't fit into allocated block\n");
946 ok(
pi->Comment +
lstrlenA(
pi->Comment) < eob,
"Comment doesn't fit into allocated block\n");
949 ok(sec_status ==
SEC_E_OK,
"FreeContextBuffer error %#x\n", sec_status);
958 sec_status = pDeleteSecurityContext(&
server.ctxt);
959 ok(sec_status ==
SEC_E_OK,
"DeleteSecurityContext(server) returned %s\n",
963 sec_status = pDeleteSecurityContext(&
client.ctxt);
964 ok(sec_status ==
SEC_E_OK,
"DeleteSecurityContext(client) returned %s\n",
969 sec_status = pFreeCredentialsHandle(&
server.cred);
970 ok(sec_status ==
SEC_E_OK,
"FreeCredentialsHandle(server) returned %s\n",
974 sec_status = pFreeCredentialsHandle(&
client.cred);
975 ok(sec_status ==
SEC_E_OK,
"FreeCredentialsHandle(client) returned %s\n",
991 ULONG qop = 0xdeadbeef;
994 complex_data[1].pvBuffer = complex_data[3].pvBuffer =
NULL;
1002 ok(0,
"NTLM package not installed, skipping test.\n");
1006 pFreeContextBuffer(pkg_info);
1008 id.UserLength =
strlen((
char *)
id.User);
1009 id.Domain = (
unsigned char *)
workgroup;
1010 id.DomainLength =
strlen((
char *)
id.Domain);
1011 id.Password = (
unsigned char*)
test_pass;
1021 skip(
"Error: Setting up the client returned %s, exiting test!\n",
1023 pFreeCredentialsHandle(&
client.cred);
1035 "Running the client returned %s, more tests will fail.\n",
1049 skip(
"Authentication failed, skipping test.\n");
1060 skip(
"Failed to get context sizes, aborting test.\n");
1067 crypt.pBuffers = fake_data;
1077 sec_status = pMakeSignature(&
client.ctxt, 0, &crypt, 0);
1079 "MakeSignature returned %s, not SEC_E_INVALID_TOKEN.\n",
1082 crypt.pBuffers =
data;
1097 sec_status = pMakeSignature(&
client.ctxt, 0, &crypt, 0);
1098 ok(sec_status ==
SEC_E_OK,
"MakeSignature returned %s, not SEC_E_OK.\n",
1101 crypt.pBuffers[0].cbBuffer),
"Signature is not as expected.\n");
1107 sec_status = pVerifySignature(&
client.ctxt, &crypt, 0, &qop);
1109 "VerifySignature returned %s, not SEC_E_MESSAGE_ALTERED.\n",
1111 ok(qop == 0xdeadbeef,
"qop changed to %u\n", qop);
1114 sec_status = pVerifySignature(&
client.ctxt, &crypt, 0, &qop);
1115 ok(sec_status ==
SEC_E_OK,
"VerifySignature returned %s, not SEC_E_OK.\n",
1117 ok(qop == 0xdeadbeef,
"qop changed to %u\n", qop);
1119 sec_status = pEncryptMessage(&
client.ctxt, 0, &crypt, 0);
1122 skip(
"Encrypt message returned SEC_E_UNSUPPORTED_FUNCTION. "
1123 "Expected on Vista.\n");
1126 ok(sec_status ==
SEC_E_OK,
"EncryptMessage returned %s, not SEC_E_OK.\n",
1136 crypt.pBuffers[0].cbBuffer),
"Crypt trailer not as expected.\n");
1138 crypt.pBuffers[1].cbBuffer),
"Crypt message not as expected.\n");
1140 crypt.pBuffers[1].cbBuffer))
1143 for (
i = 0;
i < crypt.pBuffers[1].cbBuffer;
i++)
1146 printf(
"0x%02x,", ((
unsigned char *)crypt.pBuffers[1].pvBuffer)[
i]);
1157 sec_status = pDecryptMessage(&
client.ctxt, &crypt, 0, &qop);
1159 ok(sec_status ==
SEC_E_OK,
"DecryptMessage returned %s, not SEC_E_OK.\n",
1162 crypt.pBuffers[1].cbBuffer),
1163 "Failed to decrypt message correctly.\n");
1164 ok(qop == 0xdeadbeef,
"qop changed to %u\n", qop);
1166 else trace(
"A different session key is being used\n" );
1168 trace(
"Testing with more than one buffer.\n");
1171 crypt.pBuffers = complex_data;
1180 memcpy(complex_data[1].pvBuffer,
message, complex_data[1].cbBuffer);
1191 sec_status = pMakeSignature(&
client.ctxt, 0, &crypt, 0);
1192 ok(sec_status ==
SEC_E_OK,
"MakeSignature returned %s, not SEC_E_OK.\n",
1195 crypt.pBuffers[3].cbBuffer),
"Signature is not as expected.\n");
1199 sec_status = pVerifySignature(&
client.ctxt, &crypt, 0, &qop);
1200 ok(sec_status ==
SEC_E_OK,
"VerifySignature returned %s, not SEC_E_OK\n",
1202 ok(qop == 0xdeadbeef,
"qop changed to %u\n", qop);
1204 sec_status = pEncryptMessage(&
client.ctxt, 0, &crypt, 0);
1205 ok(sec_status ==
SEC_E_OK,
"EncryptMessage returned %s, not SEC_E_OK.\n",
1211 crypt.pBuffers[3].cbBuffer))
goto end;
1214 crypt.pBuffers[1].cbBuffer),
"Crypt message not as expected.\n");
1216 crypt.pBuffers[1].cbBuffer))
1219 for (
i = 0;
i < crypt.pBuffers[1].cbBuffer;
i++)
1222 printf(
"0x%02x,", ((
unsigned char *)crypt.pBuffers[1].pvBuffer)[
i]);
1231 sec_status = pDecryptMessage(&
client.ctxt, &crypt, 0, &qop);
1232 ok(sec_status ==
SEC_E_OK,
"DecryptMessage returned %s, not SEC_E_OK.\n",
1234 ok(qop == 0xdeadbeef,
"qop changed to %u\n", qop);
1241 pDeleteSecurityContext(&
client.ctxt);
1242 pFreeCredentialsHandle(&
client.cred);
1258 ok(0,
"NTLM package not installed, skipping test\n");
1261 pFreeContextBuffer(pkg_info);
1264 id.UserLength =
strlen((
char *)
id.User);
1265 id.Domain = (
unsigned char *)
workgroup;
1266 id.DomainLength =
strlen((
char *)
id.Domain);
1267 id.Password = (
unsigned char*)
test_pass;
1273 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandle() returned %s\n",
1275 pFreeCredentialsHandle(&cred);
1277 id.DomainLength = 0;
1280 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandle() returned %s\n",
1282 pFreeCredentialsHandle(&cred);
1287 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandle() returned %s\n",
1289 pFreeCredentialsHandle(&cred);
1291 id.Domain = (
unsigned char *)
workgroup;
1292 id.DomainLength =
strlen((
char *)
id.Domain);
1297 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandle() returned %s\n",
1299 pFreeCredentialsHandle(&cred);
1302 id.UserLength =
strlen((
char *)
id.User);
1304 id.PasswordLength = 0;
1307 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandle() returned %s\n",
1309 pFreeCredentialsHandle(&cred);
1317 static WCHAR sec_pkg_nameW[] = {
'N',
'T',
'L',
'M',0 };
1318 static WCHAR test_userW[] = {
't',
'e',
's',
't',
'u',
's',
'e',
'r',0 };
1319 static WCHAR workgroupW[] = {
'W',
'O',
'R',
'K',
'G',
'R',
'O',
'U',
'P',0};
1320 static WCHAR test_passW[] = {
't',
'e',
's',
't',
'p',
'a',
's',
's',0};
1326 if(!pAcquireCredentialsHandleW)
1328 win_skip(
"AcquireCredentialsHandleW not available\n");
1334 ok(0,
"NTLM package not installed, skipping test\n");
1337 pFreeContextBuffer(pkg_info);
1339 id.User = test_userW;
1340 id.UserLength =
lstrlenW(test_userW);
1341 id.Domain = workgroupW;
1342 id.DomainLength =
lstrlenW(workgroupW);
1343 id.Password = test_passW;
1344 id.PasswordLength =
lstrlenW(test_passW);
1349 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandeW() returned %s\n",
1351 pFreeCredentialsHandle(&cred);
1353 id.DomainLength = 0;
1356 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandeW() returned %s\n",
1358 pFreeCredentialsHandle(&cred);
1363 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandeW() returned %s\n",
1365 pFreeCredentialsHandle(&cred);
1367 id.Domain = workgroupW;
1368 id.DomainLength =
lstrlenW(workgroupW);
1373 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandeW() returned %s\n",
1375 pFreeCredentialsHandle(&cred);
1377 id.User = test_userW;
1378 id.UserLength =
lstrlenW(test_userW);
1379 id.Password = test_passW;
1380 id.PasswordLength = 0;
1383 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandeW() returned %s\n",
1385 pFreeCredentialsHandle(&cred);
1398 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandeW() returned %s\n",
1400 pFreeCredentialsHandle(&cred);
1418 ok(0,
"NTLM package not installed, skipping test\n");
1425 pFreeContextBuffer(pkg_info);
1428 id.UserLength =
strlen((
char *)
id.User);
1429 id.Domain = (
unsigned char *)
workgroup;
1430 id.DomainLength =
strlen((
char *)
id.Domain);
1431 id.Password = (
unsigned char*)
test_pass;
1437 ok(
ret ==
SEC_E_OK,
"AcquireCredentialsHandle() returned %s\n",
1442 buffer_desc.pBuffers =
buffers;
1454 ret = pDeleteSecurityContext(&ctxt1);
1455 ok(
ret ==
SEC_E_OK,
"DeleteSecurityContext failed with error 0x%x\n",
ret);
1456 ret = pDeleteSecurityContext(&ctxt2);
1457 ok(
ret ==
SEC_E_OK,
"DeleteSecurityContext failed with error 0x%x\n",
ret);
1458 ret = pFreeCredentialsHandle(&cred);
1459 ok(
ret ==
SEC_E_OK,
"FreeCredentialsHandle failed with error 0x%x\n",
ret);
1479 ok(0,
"NTLM package not installed, skipping test\n");
1493 buffer_desc.pBuffers =
buffers;
1496 ret = pGetUserNameExA(NameSamCompatible,
user, &
size);
1504 ret = pDeleteSecurityContext(&
ctx);
1505 ok(
ret ==
SEC_E_OK,
"DeleteSecurityContext failed with error 0x%x\n",
ret);
1506 ret = pFreeCredentialsHandle(&cred);
1507 ok(
ret ==
SEC_E_OK,
"FreeCredentialsHandle failed with error 0x%x\n",
ret);
1509 pFreeContextBuffer(
info);
1517 if(pFreeCredentialsHandle && pDeleteSecurityContext &&
1518 pAcquireCredentialsHandleA && pInitializeSecurityContextA &&
1519 pCompleteAuthToken && pQuerySecurityPackageInfoA)
1526 if(pAcceptSecurityContext)
1533 if(pMakeSignature && pVerifySignature && pEncryptMessage &&
1541 win_skip(
"Needed functions are not available\n");
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
void user(int argc, const char *argv[])
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
static void cleanup(void)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
#define sprintf(buf, format,...)
static SECURITY_STATUS runClient(SspiData *sspi_data, BOOL first, ULONG data_rep)
static char sec_pkg_name[]
static SECURITY_STATUS setupClient(SspiData *sspi_data, SEC_CHAR *provider)
static BYTE network_challenge[]
static void cleanupBuffers(SspiData *sspi_data)
static void testSignSeal(void)
static BYTE crypt_message_client[]
static void test_cred_multiple_use(void)
static BYTE crypt_message_client2[]
static void testAuth(ULONG data_rep, BOOL fake)
static SECURITY_STATUS setupFakeServer(SspiData *sspi_data, SEC_CHAR *provider)
static BYTE crypt_trailer_client[]
static void test_null_auth_data(void)
static SECURITY_STATUS setupBuffers(SspiData *sspi_data, SecPkgInfoA *sec_pkg_info)
static PSecPkgInfoA *static SEC_CHAR ULONG
static SECURITY_STATUS runServer(SspiData *sspi_data, BOOL first, ULONG data_rep)
static BYTE crypt_message_server2[]
static BYTE crypt_trailer_server[]
static SECURITY_STATUS setupServer(SspiData *sspi_data, SEC_CHAR *provider)
static SECURITY_STATUS runFakeServer(SspiData *sspi_data, BOOL first, ULONG data_rep)
static BYTE crypt_message_server[]
static void InitFunctionPtrs(void)
static void communicate(SspiData *from, SspiData *to)
static PSecPkgInfoA *static SEC_CHAR PLUID
static BYTE message_signature[]
static BYTE crypt_trailer_client2[]
static void testAcquireCredentialsHandleW(void)
static BYTE message_binary[]
static BOOL testAcquireCredentialsHandle(void)
static PSecPkgInfoA *static SEC_CHAR PVOID
static PSecPkgInfoA *static SEC_CHAR PCredHandle
static BYTE crypt_trailer_server2[]
struct _SspiData SspiData
static const char * getSecError(SECURITY_STATUS status)
static void testInitializeSecurityContextFlags(void)
static char message_header[]
static SEC_WCHAR void void CredHandle TimeStamp *static PCtxtHandle
static BYTE native_challenge[]
static SEC_WCHAR void void CredHandle TimeStamp *static SEC_CHAR PULONG
static PSecPkgInfoA *static SEC_CHAR PTimeStamp
static SEC_WCHAR void void CredHandle TimeStamp *static SEC_CHAR PSecBufferDesc
PVOID *typedef PSecBuffer
#define SECPKG_FLAG_APPCONTAINER_CHECKS
#define ISC_REQ_CONFIDENTIALITY
#define SECPKG_CRED_OUTBOUND
#define ISC_REQ_EXTENDED_ERROR
#define SECURITY_NETWORK_DREP
#define ISC_REQ_SEQUENCE_DETECT
#define SECPKG_FLAG_RESTRICTED_TOKENS
#define SECPKG_ATTR_NEGOTIATION_INFO
#define ISC_REQ_REPLAY_DETECT
#define SECURITY_NATIVE_DREP
#define SECPKG_FLAG_APPLY_LOOPBACK
#define ISC_REQ_INTEGRITY
struct _SECURITY_FUNCTION_TABLE_A * PSecurityFunctionTableA
void(SEC_ENTRY * SEC_GET_KEY_FN)(void *Arg, void *Principal, ULONG KeyVer, void **Key, SECURITY_STATUS *Status)
#define SECBUFFER_READONLY_WITH_CHECKSUM
#define SECPKG_CRED_INBOUND
#define SECPKG_ATTR_SIZES
#define SECPKG_NEGOTIATION_COMPLETE
#define ISC_REQ_MUTUAL_AUTH
#define SECPKG_FLAG_READONLY_WITH_CHECKSUM
#define SECBUFFER_VERSION
#define ISC_REQ_CONNECTION
#define ISC_REQ_USE_DCE_STYLE
#define SEC_WINNT_AUTH_IDENTITY_UNICODE
#define SEC_WINNT_AUTH_IDENTITY_ANSI
#define RPC_C_AUTHN_WINNT
static QUERY_CONTEXT_ATTRIBUTES_FN_A pQueryContextAttributesA
SECURITY_STATUS WINAPI FreeContextBuffer(PVOID pv)
PSEC_WINNT_AUTH_IDENTITY_A id
PSEC_WINNT_AUTH_IDENTITY_A id
static rfbScreenInfoPtr server
SIZE_T WINAPI HeapSize(HANDLE, DWORD, LPCVOID)
DWORD WINAPI GetLastError(void)
#define SEC_E_INVALID_HANDLE
#define SEC_E_LOGON_DENIED
#define SEC_E_INTERNAL_ERROR
#define SEC_E_CANNOT_INSTALL
#define SEC_E_NO_IMPERSONATION
#define SEC_E_UNSUPPORTED_FUNCTION
#define SEC_E_BUFFER_TOO_SMALL
#define SEC_E_ILLEGAL_MESSAGE
#define SEC_E_SECPKG_NOT_FOUND
#define SEC_I_COMPLETE_NEEDED
#define SEC_E_CANNOT_PACK
#define SEC_E_MESSAGE_ALTERED
#define SEC_E_INVALID_TOKEN
#define SEC_E_OUT_OF_SEQUENCE
#define SEC_E_NO_CREDENTIALS
#define SEC_E_QOP_NOT_SUPPORTED
#define SEC_E_INSUFFICIENT_MEMORY
#define SEC_I_CONTINUE_NEEDED
#define SEC_I_COMPLETE_AND_CONTINUE
#define SEC_E_TARGET_UNKNOWN
SECURITY_STATUS WINAPI QueryContextAttributesA(PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)