Release 1.3.7.
[wine/gsoc-2012-control.git] / dlls / advapi32 / tests / crypt_lmhash.c
blob384221f065d734121d769a077a69d9e6c0942e4a
1 /*
2 * Unit tests for SystemFunctionXXX (LMHash?)
4 * Copyright 2004 Hans Leidekker
5 * Copyright 2006 Mike McCormack
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include <stdio.h>
24 #include "ntstatus.h"
25 #define WIN32_NO_STATUS
26 #include "wine/test.h"
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winternl.h"
31 struct ustring {
32 DWORD Length;
33 DWORD MaximumLength;
34 unsigned char *Buffer;
37 typedef int (WINAPI *descrypt)(unsigned char *, unsigned char *, unsigned char *);
38 static NTSTATUS (WINAPI *pSystemFunction001)(const BYTE *, const BYTE *, LPBYTE);
39 static NTSTATUS (WINAPI *pSystemFunction002)(const BYTE *, const BYTE *, LPBYTE);
40 static NTSTATUS (WINAPI *pSystemFunction003)(const BYTE *, LPBYTE);
41 static NTSTATUS (WINAPI *pSystemFunction004)(const struct ustring *, const struct ustring *, struct ustring *);
42 static NTSTATUS (WINAPI *pSystemFunction005)(const struct ustring *, const struct ustring *, struct ustring *);
43 static VOID (WINAPI *pSystemFunction006)( PCSTR passwd, PSTR lmhash );
44 static NTSTATUS (WINAPI *pSystemFunction008)(const BYTE *, const BYTE *, LPBYTE);
45 static NTSTATUS (WINAPI *pSystemFunction009)(const BYTE *, const BYTE *, LPBYTE);
46 static NTSTATUS (WINAPI *pSystemFunction032)(struct ustring *, const struct ustring *);
48 /* encrypt two blocks */
49 static descrypt pSystemFunction012;
50 static descrypt pSystemFunction014;
51 static descrypt pSystemFunction016;
52 static descrypt pSystemFunction018;
53 static descrypt pSystemFunction020;
54 static descrypt pSystemFunction022;
56 /* decrypt two blocks */
57 static descrypt pSystemFunction013;
58 static descrypt pSystemFunction015;
59 static descrypt pSystemFunction017;
60 static descrypt pSystemFunction019;
61 static descrypt pSystemFunction021;
62 static descrypt pSystemFunction023;
64 /* encrypt two blocks with a 32bit key */
65 static descrypt pSystemFunction024;
66 static descrypt pSystemFunction025;
68 /* decrypt two blocks with a 32bit key */
69 static descrypt pSystemFunction026;
70 static descrypt pSystemFunction027;
72 typedef int (WINAPI *memcmpfunc)(unsigned char *, unsigned char *);
73 static memcmpfunc pSystemFunction030;
74 static memcmpfunc pSystemFunction031;
76 static void test_SystemFunction006(void)
78 char lmhash[16 + 1];
80 char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 };
81 unsigned char expect[] =
82 { 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb,
83 0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee };
85 pSystemFunction006( passwd, lmhash );
87 ok( !memcmp( lmhash, expect, sizeof(expect) ),
88 "lmhash: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
89 lmhash[0], lmhash[1], lmhash[2], lmhash[3], lmhash[4], lmhash[5],
90 lmhash[6], lmhash[7], lmhash[8], lmhash[9], lmhash[10], lmhash[11],
91 lmhash[12], lmhash[13], lmhash[14], lmhash[15] );
94 static void test_SystemFunction008(void)
96 /* example data from http://davenport.sourceforge.net/ntlm.html */
97 unsigned char hash[0x40] = {
98 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0x12,
99 0xc2, 0x26, 0x5b, 0x23, 0x73, 0x4e, 0x0d, 0xac };
100 unsigned char challenge[0x40] = {
101 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
102 unsigned char expected[0x18] = {
103 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
104 0x82, 0xa6, 0x67, 0xaf, 0x6d, 0x42, 0x7c, 0x6d,
105 0xe6, 0x7c, 0x20, 0xc2, 0xd3, 0xe7, 0x7c, 0x56 };
106 unsigned char output[0x18];
107 NTSTATUS r;
109 r = pSystemFunction008(0,0,0);
110 ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
112 r = pSystemFunction008(challenge,0,0);
113 ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
115 r = pSystemFunction008(challenge, hash, 0);
116 ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
118 /* crashes */
119 if (0)
121 r = pSystemFunction008(challenge, 0, output);
122 ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
125 r = pSystemFunction008(0, 0, output);
126 ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
128 memset(output, 0, sizeof output);
129 r = pSystemFunction008(challenge, hash, output);
130 ok( r == STATUS_SUCCESS, "wrong error code\n");
132 ok( !memcmp(output, expected, sizeof expected), "response wrong\n");
135 static void test_SystemFunction001(void)
137 unsigned char key[8] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0 };
138 unsigned char data[8] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
139 unsigned char expected[8] = { 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97 };
140 unsigned char output[16];
141 NTSTATUS r;
143 r = pSystemFunction001(0,0,0);
144 ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
146 memset(output, 0, sizeof output);
148 r = pSystemFunction001(data,key,output);
149 ok( r == STATUS_SUCCESS, "wrong error code\n");
151 ok(!memcmp(output, expected, sizeof expected), "response wrong\n");
154 static void test_SystemFunction002(void)
156 /* reverse of SystemFunction001 */
157 unsigned char key[8] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0 };
158 unsigned char expected[8] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
159 unsigned char data[8] = { 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97 };
160 unsigned char output[8];
161 int r;
163 memset(output, 0, sizeof output);
164 r = pSystemFunction002(data, key, output);
165 ok(r == STATUS_SUCCESS, "function failed\n");
166 ok(!memcmp(output, expected, sizeof expected), "response wrong\n");
169 static void test_SystemFunction032(void)
171 struct ustring key, data;
172 unsigned char szKey[] = { 'f','o','o',0 };
173 unsigned char szData[8] = { 'b','a','r',0 };
174 unsigned char expected[] = {0x28, 0xb9, 0xf8, 0xe1};
175 int r;
177 /* crashes: pSystemFunction032(NULL,NULL); */
179 key.Buffer = szKey;
180 key.Length = sizeof szKey;
181 key.MaximumLength = key.Length;
183 data.Buffer = szData;
184 data.Length = 4;
185 data.MaximumLength = 8;
187 r = pSystemFunction032(&data, &key);
188 ok(r == STATUS_SUCCESS, "function failed\n");
190 ok(!memcmp(expected, data.Buffer, data.Length), "wrong result\n");
193 static void test_SystemFunction003(void)
195 unsigned char output[8], data[8];
196 unsigned char key[7] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24 };
197 unsigned char exp1[8] = { 0x9d, 0x21, 0xc8, 0x86, 0x6c, 0x21, 0xcf, 0x43 };
198 char exp2[] = "KGS!@#$%";
199 int r;
201 r = pSystemFunction003(NULL, NULL);
202 ok(r == STATUS_UNSUCCESSFUL, "function failed\n");
204 r = pSystemFunction003(key, NULL);
205 ok(r == STATUS_UNSUCCESSFUL, "function failed\n");
207 memset(data, 0, sizeof data);
208 r = pSystemFunction003(key, data);
209 ok(r == STATUS_SUCCESS, "function failed\n");
210 ok( !memcmp(exp1, data, sizeof data), "decrypted message wrong\n");
212 memset(output, 0, sizeof output);
213 r = pSystemFunction002(data, key, output);
215 ok( !memcmp(exp2, output, sizeof output), "decrypted message wrong\n");
218 static void test_SystemFunction004(void)
220 unsigned char inbuf[0x100], keybuf[0x100], resbuf[0x100];
221 unsigned char output[8];
222 int r;
223 struct ustring in, key, out;
225 /* crash
226 r = pSystemFunction004(NULL, NULL, NULL);
227 ok(r == STATUS_UNSUCCESSFUL, "function failed\n");
230 memset(inbuf, 0, sizeof inbuf);
231 memset(keybuf, 0, sizeof keybuf);
232 memset(resbuf, 0, sizeof resbuf);
234 in.Buffer = NULL;
235 in.Length = in.MaximumLength = 0;
237 key.Buffer = NULL;
238 key.Length = key.MaximumLength = 0;
240 out.Buffer = NULL;
241 out.Length = out.MaximumLength = 0;
243 r = pSystemFunction004(&in, &key, &out);
244 ok(r == STATUS_INVALID_PARAMETER_2, "function failed\n");
246 key.Buffer = keybuf;
247 key.Length = 0x100;
248 key.MaximumLength = 0x100;
250 r = pSystemFunction004(&in, &key, &out);
251 ok(r == STATUS_BUFFER_TOO_SMALL, "function failed\n");
253 in.Buffer = inbuf;
254 in.Length = 0x0c;
255 in.MaximumLength = 0;
257 /* add two identical blocks... */
258 inbuf[0] = 1;
259 inbuf[1] = 2;
260 inbuf[2] = 3;
261 inbuf[3] = 4;
263 inbuf[8] = 1;
264 inbuf[9] = 2;
265 inbuf[10] = 3;
266 inbuf[11] = 4;
268 /* check that the Length field is really obeyed */
269 keybuf[6] = 1;
271 key.Buffer = keybuf;
272 key.Length = 6;
273 key.MaximumLength = 0;
275 keybuf[1] = 0x33;
277 out.Buffer = resbuf;
278 out.Length = 0;
279 out.MaximumLength = 0x40;
280 r = pSystemFunction004(&in, &key, &out);
281 ok(r == STATUS_SUCCESS, "function failed\n");
283 keybuf[6] = 0;
285 memset(output, 0, sizeof output);
286 r = pSystemFunction002(out.Buffer, key.Buffer, output);
288 ok(((unsigned int*)output)[0] == in.Length, "crypted length wrong\n");
289 ok(((unsigned int*)output)[1] == 1, "crypted value wrong\n");
291 memset(output, 0, sizeof output);
292 r = pSystemFunction002(out.Buffer+8, key.Buffer, output);
293 ok(!memcmp(output, inbuf, sizeof output), "crypted data wrong\n");
295 memset(output, 0, sizeof output);
296 r = pSystemFunction002(out.Buffer+16, key.Buffer, output);
297 ok(!memcmp(output, inbuf, sizeof output), "crypted data wrong\n");
300 static void test_SystemFunction005(void)
302 char output[0x40], result[0x40];
303 int r;
304 struct ustring in, key, out, res;
305 static char datastr[] = "twinkle twinkle little star";
306 static char keystr[] = "byolnim";
308 in.Buffer = (unsigned char *)datastr;
309 in.Length = strlen(datastr);
310 in.MaximumLength = 0;
312 key.Buffer = (unsigned char *)keystr;
313 key.Length = strlen(keystr);
314 key.MaximumLength = 0;
316 out.Buffer = (unsigned char *)output;
317 out.Length = out.MaximumLength = sizeof output;
319 r = pSystemFunction004(&in, &key, &out);
320 ok(r == STATUS_SUCCESS, "function failed\n");
322 memset(result, 0, sizeof result);
323 res.Buffer = (unsigned char *)result;
324 res.Length = 0;
325 res.MaximumLength = sizeof result;
327 r = pSystemFunction005(&out, &key, &res);
328 ok(r == STATUS_SUCCESS, "function failed\n");
330 r = pSystemFunction005(&out, &key, &res);
331 ok(r == STATUS_SUCCESS, "function failed\n");
333 ok(res.Length == in.Length, "Length wrong\n");
334 ok(!memcmp(res.Buffer, in.Buffer, in.Length), "data wrong\n");
336 out.Length = 0;
337 out.MaximumLength = 0;
338 r = pSystemFunction005(&out, &key, &res);
339 ok(r == STATUS_SUCCESS ||
340 r == STATUS_INVALID_PARAMETER_1, /* Vista */
341 "Expected STATUS_SUCCESS or STATUS_INVALID_PARAMETER_1, got %08x\n", r);
343 ok(res.Length == in.Length, "Length wrong\n");
344 ok(!memcmp(res.Buffer, in.Buffer, in.Length), "data wrong\n");
346 res.MaximumLength = 0;
347 r = pSystemFunction005(&out, &key, &res);
348 ok(r == STATUS_BUFFER_TOO_SMALL ||
349 r == STATUS_INVALID_PARAMETER_1, /* Vista */
350 "Expected STATUS_BUFFER_TOO_SMALL or STATUS_INVALID_PARAMETER_1, got %08x\n", r);
352 key.Length = 1;
353 r = pSystemFunction005(&out, &key, &res);
354 ok(r == STATUS_UNKNOWN_REVISION ||
355 r == STATUS_INVALID_PARAMETER_1, /* Vista */
356 "Expected STATUS_UNKNOWN_REVISION or STATUS_INVALID_PARAMETER_1, got %08x\n", r);
358 key.Length = 0;
359 r = pSystemFunction005(&out, &key, &res);
360 ok(r == STATUS_INVALID_PARAMETER_2, "function failed\n");
363 static void test_SystemFunction009(void)
365 unsigned char hash[0x10] = {
366 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0x12,
367 0xc2, 0x26, 0x5b, 0x23, 0x73, 0x4e, 0x0d, 0xac };
368 unsigned char challenge[8] = {
369 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
370 unsigned char expected[0x18] = {
371 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
372 0x82, 0xa6, 0x67, 0xaf, 0x6d, 0x42, 0x7c, 0x6d,
373 0xe6, 0x7c, 0x20, 0xc2, 0xd3, 0xe7, 0x7c, 0x56 };
374 unsigned char output[0x18];
375 int r;
377 memset(output, 0, sizeof output);
378 r = pSystemFunction009(challenge, hash, output);
379 ok( r == STATUS_SUCCESS, "wrong error code\n");
380 ok(!memcmp(output, expected, sizeof expected), "response wrong\n");
383 static unsigned char des_key[] = {
384 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24,
385 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24,
387 static unsigned char des_plaintext[] = {
388 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
389 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0
391 static unsigned char des_ciphertext[] = {
392 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
393 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97, 0
396 /* test functions that encrypt two DES blocks */
397 static void test_SystemFunction_encrypt(descrypt func, int num)
399 unsigned char output[0x11];
400 int r;
402 if (!func)
404 win_skip("SystemFunction%03d is not available\n", num);
405 return;
408 r = func(NULL, NULL, NULL);
409 ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
411 memset(output, 0, sizeof output);
412 r = func(des_plaintext, des_key, output);
413 ok( r == STATUS_SUCCESS, "wrong error code\n");
414 ok( !memcmp(des_ciphertext, output, sizeof des_ciphertext), "ciphertext wrong (%d)\n", num);
417 /* test functions that decrypt two DES blocks */
418 static void test_SystemFunction_decrypt(descrypt func, int num)
420 unsigned char output[0x11];
421 int r;
423 if (!func)
425 win_skip("SystemFunction%03d is not available\n", num);
426 return;
429 r = func(NULL, NULL, NULL);
430 ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
432 memset(output, 0, sizeof output);
434 r = func(des_ciphertext, des_key, output);
435 ok( r == STATUS_SUCCESS, "wrong error code\n");
436 ok( !memcmp(des_plaintext, output, sizeof des_plaintext), "plaintext wrong (%d)\n", num);
439 static unsigned char des_ciphertext32[] = {
440 0x69, 0x51, 0x35, 0x69, 0x0d, 0x29, 0x24, 0xad,
441 0x23, 0x6d, 0xfd, 0x43, 0x0d, 0xd3, 0x25, 0x81, 0
444 static void test_SystemFunction_enc32(descrypt func, int num)
446 unsigned char key[4], output[0x11];
447 int r;
449 if (!func)
451 win_skip("SystemFunction%03d is not available\n", num);
452 return;
455 memset(output, 0, sizeof output);
457 /* two keys are generated using 4 bytes, repeated 4 times ... */
458 memcpy(key, "foo", 4);
460 r = func(des_plaintext, key, output);
461 ok( r == STATUS_SUCCESS, "wrong error code (%d)\n", num);
463 ok( !memcmp( output, des_ciphertext32, sizeof des_ciphertext32), "ciphertext wrong (%d)\n", num);
466 static void test_SystemFunction_dec32(descrypt func, int num)
468 unsigned char key[4], output[0x11];
469 int r;
471 if (!func)
473 win_skip("SystemFunction%03d is not available\n", num);
474 return;
477 memset(output, 0, sizeof output);
479 /* two keys are generated using 4 bytes, repeated 4 times ... */
480 memcpy(key, "foo", 4);
482 r = func(des_ciphertext32, key, output);
483 ok( r == STATUS_SUCCESS, "wrong error code (%d)\n", num);
485 ok( !memcmp( output, des_plaintext, sizeof des_plaintext), "plaintext wrong (%d)\n", num);
488 static void test_memcmpfunc(memcmpfunc fn)
490 unsigned char arg1[0x20], arg2[0x20];
491 int r;
493 if (!fn)
495 win_skip("function is not available\n");
496 return;
499 if (0)
501 /* crashes */
502 r = fn(NULL, NULL);
505 memset(arg1, 0, sizeof arg1);
506 memset(arg2, 0, sizeof arg2);
507 arg1[0x10] = 1;
509 r = fn(arg1, arg2);
510 ok( r == 1, "wrong error code\n");
512 memset(arg1, 1, sizeof arg1);
513 memset(arg2, 1, sizeof arg2);
514 arg1[0x10] = 0;
516 r = fn(arg1, arg2);
517 ok( r == 1, "wrong error code\n");
519 memset(arg1, 0, sizeof arg1);
520 memset(arg2, 1, sizeof arg2);
522 r = fn(arg1, arg2);
523 ok( r == 0, "wrong error code\n");
525 memset(arg1, 1, sizeof arg1);
526 memset(arg2, 0, sizeof arg2);
528 r = fn(arg1, arg2);
529 ok( r == 0, "wrong error code\n");
532 START_TEST(crypt_lmhash)
534 HMODULE module = GetModuleHandleA("advapi32.dll");
536 pSystemFunction001 = (void *)GetProcAddress( module, "SystemFunction001" );
537 if (pSystemFunction001)
538 test_SystemFunction001();
539 else
540 win_skip("SystemFunction001 is not available\n");
542 pSystemFunction002 = (void *)GetProcAddress( module, "SystemFunction002" );
543 if (pSystemFunction002)
544 test_SystemFunction002();
545 else
546 win_skip("SystemFunction002 is not available\n");
548 pSystemFunction003 = (void *)GetProcAddress( module, "SystemFunction003" );
549 if (pSystemFunction003)
550 test_SystemFunction003();
551 else
552 win_skip("SystemFunction002 is not available\n");
554 pSystemFunction004 = (void *)GetProcAddress( module, "SystemFunction004" );
555 if (pSystemFunction004)
556 test_SystemFunction004();
557 else
558 win_skip("SystemFunction004 is not available\n");
560 pSystemFunction005 = (void *)GetProcAddress( module, "SystemFunction005" );
561 if (pSystemFunction005)
562 test_SystemFunction005();
563 else
564 win_skip("SystemFunction005 is not available\n");
566 pSystemFunction006 = (void *)GetProcAddress( module, "SystemFunction006" );
567 if (pSystemFunction006)
568 test_SystemFunction006();
569 else
570 win_skip("SystemFunction006 is not available\n");
572 pSystemFunction008 = (void *)GetProcAddress( module, "SystemFunction008" );
573 if (pSystemFunction008)
574 test_SystemFunction008();
575 else
576 win_skip("SystemFunction008 is not available\n");
578 pSystemFunction009 = (void *)GetProcAddress( module, "SystemFunction009" );
579 if (pSystemFunction009)
580 test_SystemFunction009();
581 else
582 win_skip("SystemFunction009 is not available\n");
584 pSystemFunction012 = (descrypt) GetProcAddress( module, "SystemFunction012");
585 pSystemFunction013 = (descrypt) GetProcAddress( module, "SystemFunction013");
586 pSystemFunction014 = (descrypt) GetProcAddress( module, "SystemFunction014");
587 pSystemFunction015 = (descrypt) GetProcAddress( module, "SystemFunction015");
588 pSystemFunction016 = (descrypt) GetProcAddress( module, "SystemFunction016");
589 pSystemFunction017 = (descrypt) GetProcAddress( module, "SystemFunction017");
590 pSystemFunction018 = (descrypt) GetProcAddress( module, "SystemFunction018");
591 pSystemFunction019 = (descrypt) GetProcAddress( module, "SystemFunction019");
592 pSystemFunction020 = (descrypt) GetProcAddress( module, "SystemFunction020");
593 pSystemFunction021 = (descrypt) GetProcAddress( module, "SystemFunction021");
594 pSystemFunction022 = (descrypt) GetProcAddress( module, "SystemFunction022");
595 pSystemFunction023 = (descrypt) GetProcAddress( module, "SystemFunction023");
597 /* these all encrypt two DES blocks */
598 test_SystemFunction_encrypt(pSystemFunction012, 12);
599 test_SystemFunction_encrypt(pSystemFunction014, 14);
600 test_SystemFunction_encrypt(pSystemFunction016, 16);
601 test_SystemFunction_encrypt(pSystemFunction018, 18);
602 test_SystemFunction_encrypt(pSystemFunction020, 20);
603 test_SystemFunction_encrypt(pSystemFunction022, 22);
605 /* these all decrypt two DES blocks */
606 test_SystemFunction_decrypt(pSystemFunction013, 13);
607 test_SystemFunction_decrypt(pSystemFunction015, 15);
608 test_SystemFunction_decrypt(pSystemFunction017, 17);
609 test_SystemFunction_decrypt(pSystemFunction019, 19);
610 test_SystemFunction_decrypt(pSystemFunction021, 21);
611 test_SystemFunction_decrypt(pSystemFunction023, 23);
613 pSystemFunction024 = (descrypt) GetProcAddress( module, "SystemFunction024");
614 pSystemFunction025 = (descrypt) GetProcAddress( module, "SystemFunction025");
615 pSystemFunction026 = (descrypt) GetProcAddress( module, "SystemFunction026");
616 pSystemFunction027 = (descrypt) GetProcAddress( module, "SystemFunction027");
618 /* these encrypt two DES blocks with a short key */
619 test_SystemFunction_enc32(pSystemFunction024, 24);
620 test_SystemFunction_enc32(pSystemFunction026, 26);
622 /* these descrypt two DES blocks with a short key */
623 test_SystemFunction_dec32(pSystemFunction025, 25);
624 test_SystemFunction_dec32(pSystemFunction027, 27);
626 pSystemFunction030 = (memcmpfunc) GetProcAddress( module, "SystemFunction030" );
627 pSystemFunction031 = (memcmpfunc) GetProcAddress( module, "SystemFunction031" );
629 test_memcmpfunc(pSystemFunction030);
630 test_memcmpfunc(pSystemFunction031);
632 pSystemFunction032 = (void *)GetProcAddress( module, "SystemFunction032" );
633 if (pSystemFunction032)
634 test_SystemFunction032();
635 else
636 win_skip("SystemFunction032 is not available\n");