Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/dlls/advapi32/tests/crypt_lmhash.c
8725 views
1
/*
2
* Unit tests for SystemFunctionXXX (LMHash?)
3
*
4
* Copyright 2004 Hans Leidekker
5
* Copyright 2006 Mike McCormack
6
*
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.
11
*
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.
16
*
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
20
*/
21
22
#include <stdio.h>
23
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"
30
31
struct ustring {
32
DWORD Length;
33
DWORD MaximumLength;
34
unsigned char *Buffer;
35
};
36
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 *);
47
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;
55
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;
63
64
/* encrypt two blocks with a 32bit key */
65
static descrypt pSystemFunction024;
66
static descrypt pSystemFunction025;
67
68
/* decrypt two blocks with a 32bit key */
69
static descrypt pSystemFunction026;
70
static descrypt pSystemFunction027;
71
72
typedef int (WINAPI *memcmpfunc)(unsigned char *, unsigned char *);
73
static memcmpfunc pSystemFunction030;
74
static memcmpfunc pSystemFunction031;
75
76
static void test_SystemFunction006(void)
77
{
78
char lmhash[16 + 1];
79
char passwd[] = { 's','e','c','r','e','t', 0, 0, 0, 0, 0, 0, 0, 0 };
80
unsigned char expect[] =
81
{ 0x85, 0xf5, 0x28, 0x9f, 0x09, 0xdc, 0xa7, 0xeb,
82
0xaa, 0xd3, 0xb4, 0x35, 0xb5, 0x14, 0x04, 0xee };
83
84
if (0) /* crashes on win11 */
85
{
86
pSystemFunction006( passwd, lmhash );
87
88
ok( !memcmp( lmhash, expect, sizeof(expect) ),
89
"lmhash: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n",
90
lmhash[0], lmhash[1], lmhash[2], lmhash[3], lmhash[4], lmhash[5],
91
lmhash[6], lmhash[7], lmhash[8], lmhash[9], lmhash[10], lmhash[11],
92
lmhash[12], lmhash[13], lmhash[14], lmhash[15] );
93
}
94
}
95
96
static void test_SystemFunction008(void)
97
{
98
/* example data from http://davenport.sourceforge.net/ntlm.html */
99
unsigned char hash[0x40] = {
100
0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0x12,
101
0xc2, 0x26, 0x5b, 0x23, 0x73, 0x4e, 0x0d, 0xac };
102
unsigned char challenge[0x40] = {
103
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
104
unsigned char expected[0x18] = {
105
0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
106
0x82, 0xa6, 0x67, 0xaf, 0x6d, 0x42, 0x7c, 0x6d,
107
0xe6, 0x7c, 0x20, 0xc2, 0xd3, 0xe7, 0x7c, 0x56 };
108
unsigned char output[0x18];
109
NTSTATUS r;
110
111
if (0) /* crashes */
112
{
113
r = pSystemFunction008(NULL, NULL, NULL);
114
ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
115
116
r = pSystemFunction008(challenge, NULL, NULL);
117
ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
118
119
r = pSystemFunction008(challenge, hash, NULL);
120
ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
121
122
r = pSystemFunction008(challenge, NULL, output);
123
ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
124
125
r = pSystemFunction008(NULL, NULL, output);
126
ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
127
}
128
129
memset(output, 0, sizeof output);
130
r = pSystemFunction008(challenge, hash, output);
131
ok( r == STATUS_SUCCESS, "wrong error code\n");
132
133
ok( !memcmp(output, expected, sizeof expected), "response wrong\n");
134
}
135
136
static void test_SystemFunction001(void)
137
{
138
unsigned char key[8] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0 };
139
unsigned char data[8] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
140
unsigned char expected[8] = { 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97 };
141
unsigned char output[16];
142
NTSTATUS r;
143
144
if (0) /* crashes on win11 */
145
{
146
r = pSystemFunction001(NULL, NULL, NULL);
147
ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
148
}
149
memset(output, 0, sizeof output);
150
151
r = pSystemFunction001(data,key,output);
152
ok( r == STATUS_SUCCESS, "wrong error code\n");
153
154
ok(!memcmp(output, expected, sizeof expected), "response wrong\n");
155
}
156
157
static void test_SystemFunction002(void)
158
{
159
/* reverse of SystemFunction001 */
160
unsigned char key[8] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0 };
161
unsigned char expected[8] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
162
unsigned char data[8] = { 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97 };
163
unsigned char output[8];
164
int r;
165
166
memset(output, 0, sizeof output);
167
r = pSystemFunction002(data, key, output);
168
ok(r == STATUS_SUCCESS, "function failed\n");
169
ok(!memcmp(output, expected, sizeof expected), "response wrong\n");
170
}
171
172
static void test_SystemFunction032(void)
173
{
174
struct ustring key, data;
175
unsigned char szKey[] = { 'f','o','o',0 };
176
unsigned char szData[8] = { 'b','a','r',0 };
177
unsigned char expected[] = {0x28, 0xb9, 0xf8, 0xe1};
178
int r;
179
180
if (0) /* crashes */
181
{
182
pSystemFunction032(NULL, NULL);
183
}
184
key.Buffer = szKey;
185
key.Length = sizeof szKey;
186
key.MaximumLength = key.Length;
187
188
data.Buffer = szData;
189
data.Length = 4;
190
data.MaximumLength = 8;
191
192
r = pSystemFunction032(&data, &key);
193
ok(r == STATUS_SUCCESS, "function failed\n");
194
195
ok(!memcmp(expected, data.Buffer, data.Length), "wrong result\n");
196
}
197
198
static void test_SystemFunction003(void)
199
{
200
unsigned char output[8], data[8];
201
unsigned char key[7] = { 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24 };
202
unsigned char exp1[8] = { 0x9d, 0x21, 0xc8, 0x86, 0x6c, 0x21, 0xcf, 0x43 };
203
char exp2[] = "KGS!@#$%";
204
int r;
205
206
if (0) /* crashes on win11 */
207
{
208
r = pSystemFunction003(NULL, NULL);
209
ok(r == STATUS_UNSUCCESSFUL, "function failed\n");
210
211
r = pSystemFunction003(key, NULL);
212
ok(r == STATUS_UNSUCCESSFUL, "function failed\n");
213
}
214
215
memset(data, 0, sizeof data);
216
r = pSystemFunction003(key, data);
217
ok(r == STATUS_SUCCESS, "function failed\n");
218
ok( !memcmp(exp1, data, sizeof data), "decrypted message wrong\n");
219
220
memset(output, 0, sizeof output);
221
r = pSystemFunction002(data, key, output);
222
ok(r == STATUS_SUCCESS, "function failed\n");
223
224
ok( !memcmp(exp2, output, sizeof output), "decrypted message wrong\n");
225
}
226
227
static void test_SystemFunction004(void)
228
{
229
unsigned char inbuf[0x100], keybuf[0x100], resbuf[0x100];
230
unsigned char output[8];
231
int r;
232
struct ustring in, key, out;
233
234
if (0)
235
{
236
r = pSystemFunction004(NULL, NULL, NULL);
237
ok(r == STATUS_UNSUCCESSFUL, "function failed\n");
238
}
239
240
memset(inbuf, 0, sizeof inbuf);
241
memset(keybuf, 0, sizeof keybuf);
242
memset(resbuf, 0, sizeof resbuf);
243
244
in.Buffer = NULL;
245
in.Length = in.MaximumLength = 0;
246
247
key.Buffer = NULL;
248
key.Length = key.MaximumLength = 0;
249
250
out.Buffer = NULL;
251
out.Length = out.MaximumLength = 0;
252
253
r = pSystemFunction004(&in, &key, &out);
254
ok(r == STATUS_INVALID_PARAMETER_2, "function failed\n");
255
256
key.Buffer = keybuf;
257
key.Length = 0x100;
258
key.MaximumLength = 0x100;
259
260
r = pSystemFunction004(&in, &key, &out);
261
ok(r == STATUS_BUFFER_TOO_SMALL, "function failed\n");
262
263
in.Buffer = inbuf;
264
in.Length = 0x0c;
265
in.MaximumLength = 0;
266
267
/* add two identical blocks... */
268
inbuf[0] = 1;
269
inbuf[1] = 2;
270
inbuf[2] = 3;
271
inbuf[3] = 4;
272
273
inbuf[8] = 1;
274
inbuf[9] = 2;
275
inbuf[10] = 3;
276
inbuf[11] = 4;
277
278
/* check that the Length field is really obeyed */
279
keybuf[6] = 1;
280
281
key.Buffer = keybuf;
282
key.Length = 6;
283
key.MaximumLength = 0;
284
285
keybuf[1] = 0x33;
286
287
out.Buffer = resbuf;
288
out.Length = 0;
289
out.MaximumLength = 0x40;
290
r = pSystemFunction004(&in, &key, &out);
291
ok(r == STATUS_SUCCESS, "function failed\n");
292
293
keybuf[6] = 0;
294
295
memset(output, 0, sizeof output);
296
r = pSystemFunction002(out.Buffer, key.Buffer, output);
297
ok(r == STATUS_SUCCESS, "function failed\n");
298
299
ok(((unsigned int*)output)[0] == in.Length, "encrypted length wrong\n");
300
ok(((unsigned int*)output)[1] == 1, "encrypted value wrong\n");
301
302
memset(output, 0, sizeof output);
303
r = pSystemFunction002(out.Buffer+8, key.Buffer, output);
304
ok(r == STATUS_SUCCESS, "function failed\n");
305
ok(!memcmp(output, inbuf, sizeof output), "encrypted data wrong\n");
306
307
memset(output, 0, sizeof output);
308
r = pSystemFunction002(out.Buffer+16, key.Buffer, output);
309
ok(r == STATUS_SUCCESS, "function failed\n");
310
ok(!memcmp(output, inbuf, sizeof output), "encrypted data wrong\n");
311
}
312
313
static void test_SystemFunction005(void)
314
{
315
char output[0x40], result[0x40];
316
int r;
317
struct ustring in, key, out, res;
318
static char datastr[] = "twinkle twinkle little star";
319
static char keystr[] = "byolnim";
320
321
in.Buffer = (unsigned char *)datastr;
322
in.Length = strlen(datastr);
323
in.MaximumLength = 0;
324
325
key.Buffer = (unsigned char *)keystr;
326
key.Length = strlen(keystr);
327
key.MaximumLength = 0;
328
329
out.Buffer = (unsigned char *)output;
330
out.Length = out.MaximumLength = sizeof output;
331
332
r = pSystemFunction004(&in, &key, &out);
333
ok(r == STATUS_SUCCESS, "function failed\n");
334
335
memset(result, 0, sizeof result);
336
res.Buffer = (unsigned char *)result;
337
res.Length = 0;
338
res.MaximumLength = sizeof result;
339
340
r = pSystemFunction005(&out, &key, &res);
341
ok(r == STATUS_SUCCESS, "function failed\n");
342
343
r = pSystemFunction005(&out, &key, &res);
344
ok(r == STATUS_SUCCESS, "function failed\n");
345
346
ok(res.Length == in.Length, "Length wrong\n");
347
ok(!memcmp(res.Buffer, in.Buffer, in.Length), "data wrong\n");
348
349
out.Length = 0;
350
out.MaximumLength = 0;
351
r = pSystemFunction005(&out, &key, &res);
352
ok(r == STATUS_SUCCESS ||
353
r == STATUS_INVALID_PARAMETER_1, /* Vista */
354
"Expected STATUS_SUCCESS or STATUS_INVALID_PARAMETER_1, got %08x\n", r);
355
356
ok(res.Length == in.Length, "Length wrong\n");
357
ok(!memcmp(res.Buffer, in.Buffer, in.Length), "data wrong\n");
358
359
res.MaximumLength = 0;
360
r = pSystemFunction005(&out, &key, &res);
361
ok(r == STATUS_BUFFER_TOO_SMALL ||
362
r == STATUS_INVALID_PARAMETER_1, /* Vista */
363
"Expected STATUS_BUFFER_TOO_SMALL or STATUS_INVALID_PARAMETER_1, got %08x\n", r);
364
365
key.Length = 1;
366
r = pSystemFunction005(&out, &key, &res);
367
ok(r == STATUS_UNKNOWN_REVISION ||
368
r == STATUS_INVALID_PARAMETER_1, /* Vista */
369
"Expected STATUS_UNKNOWN_REVISION or STATUS_INVALID_PARAMETER_1, got %08x\n", r);
370
371
key.Length = 0;
372
r = pSystemFunction005(&out, &key, &res);
373
ok(r == STATUS_INVALID_PARAMETER_2, "function failed\n");
374
}
375
376
static void test_SystemFunction009(void)
377
{
378
unsigned char hash[0x10] = {
379
0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0x12,
380
0xc2, 0x26, 0x5b, 0x23, 0x73, 0x4e, 0x0d, 0xac };
381
unsigned char challenge[8] = {
382
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
383
unsigned char expected[0x18] = {
384
0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
385
0x82, 0xa6, 0x67, 0xaf, 0x6d, 0x42, 0x7c, 0x6d,
386
0xe6, 0x7c, 0x20, 0xc2, 0xd3, 0xe7, 0x7c, 0x56 };
387
unsigned char output[0x18];
388
int r;
389
390
memset(output, 0, sizeof output);
391
r = pSystemFunction009(challenge, hash, output);
392
ok( r == STATUS_SUCCESS, "wrong error code\n");
393
ok(!memcmp(output, expected, sizeof expected), "response wrong\n");
394
}
395
396
static unsigned char des_key[] = {
397
0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24,
398
0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24,
399
};
400
static unsigned char des_plaintext[] = {
401
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
402
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0
403
};
404
static unsigned char des_ciphertext[] = {
405
0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97,
406
0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97, 0
407
};
408
409
/* test functions that encrypt two DES blocks */
410
static void test_SystemFunction_encrypt(descrypt func, int num)
411
{
412
unsigned char output[0x11];
413
int r;
414
415
if (!func)
416
{
417
win_skip("SystemFunction%03d is not available\n", num);
418
return;
419
}
420
421
if (0) /* crash */
422
{
423
r = func(NULL, NULL, NULL);
424
ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
425
}
426
memset(output, 0, sizeof output);
427
r = func(des_plaintext, des_key, output);
428
ok( r == STATUS_SUCCESS, "wrong error code\n");
429
ok( !memcmp(des_ciphertext, output, sizeof des_ciphertext), "ciphertext wrong (%d)\n", num);
430
}
431
432
/* test functions that decrypt two DES blocks */
433
static void test_SystemFunction_decrypt(descrypt func, int num)
434
{
435
unsigned char output[0x11];
436
int r;
437
438
if (!func)
439
{
440
win_skip("SystemFunction%03d is not available\n", num);
441
return;
442
}
443
444
if (0) /* crash */
445
{
446
r = func(NULL, NULL, NULL);
447
ok( r == STATUS_UNSUCCESSFUL, "wrong error code\n");
448
}
449
memset(output, 0, sizeof output);
450
451
r = func(des_ciphertext, des_key, output);
452
ok( r == STATUS_SUCCESS, "wrong error code\n");
453
ok( !memcmp(des_plaintext, output, sizeof des_plaintext), "plaintext wrong (%d)\n", num);
454
}
455
456
static unsigned char des_ciphertext32[] = {
457
0x69, 0x51, 0x35, 0x69, 0x0d, 0x29, 0x24, 0xad,
458
0x23, 0x6d, 0xfd, 0x43, 0x0d, 0xd3, 0x25, 0x81, 0
459
};
460
461
static void test_SystemFunction_enc32(descrypt func, int num)
462
{
463
unsigned char key[4], output[0x11];
464
int r;
465
466
if (!func)
467
{
468
win_skip("SystemFunction%03d is not available\n", num);
469
return;
470
}
471
472
memset(output, 0, sizeof output);
473
474
/* two keys are generated using 4 bytes, repeated 4 times ... */
475
memcpy(key, "foo", 4);
476
477
r = func(des_plaintext, key, output);
478
ok( r == STATUS_SUCCESS, "wrong error code (%d)\n", num);
479
480
ok( !memcmp( output, des_ciphertext32, sizeof des_ciphertext32), "ciphertext wrong (%d)\n", num);
481
}
482
483
static void test_SystemFunction_dec32(descrypt func, int num)
484
{
485
unsigned char key[4], output[0x11];
486
int r;
487
488
if (!func)
489
{
490
win_skip("SystemFunction%03d is not available\n", num);
491
return;
492
}
493
494
memset(output, 0, sizeof output);
495
496
/* two keys are generated using 4 bytes, repeated 4 times ... */
497
memcpy(key, "foo", 4);
498
499
r = func(des_ciphertext32, key, output);
500
ok( r == STATUS_SUCCESS, "wrong error code (%d)\n", num);
501
502
ok( !memcmp( output, des_plaintext, sizeof des_plaintext), "plaintext wrong (%d)\n", num);
503
}
504
505
static void test_memcmpfunc(memcmpfunc fn)
506
{
507
unsigned char arg1[0x20], arg2[0x20];
508
int r;
509
510
if (!fn)
511
{
512
win_skip("function is not available\n");
513
return;
514
}
515
516
memset(arg1, 0, sizeof arg1);
517
memset(arg2, 0, sizeof arg2);
518
arg1[0x10] = 1;
519
520
r = fn(arg1, arg2);
521
ok( r == 1, "wrong error code\n");
522
523
memset(arg1, 1, sizeof arg1);
524
memset(arg2, 1, sizeof arg2);
525
arg1[0x10] = 0;
526
527
r = fn(arg1, arg2);
528
ok( r == 1, "wrong error code\n");
529
530
memset(arg1, 0, sizeof arg1);
531
memset(arg2, 1, sizeof arg2);
532
533
r = fn(arg1, arg2);
534
ok( r == 0, "wrong error code\n");
535
536
memset(arg1, 1, sizeof arg1);
537
memset(arg2, 0, sizeof arg2);
538
539
r = fn(arg1, arg2);
540
ok( r == 0, "wrong error code\n");
541
}
542
543
START_TEST(crypt_lmhash)
544
{
545
HMODULE module = GetModuleHandleA("advapi32.dll");
546
547
pSystemFunction001 = (void *)GetProcAddress( module, "SystemFunction001" );
548
if (pSystemFunction001)
549
test_SystemFunction001();
550
else
551
win_skip("SystemFunction001 is not available\n");
552
553
pSystemFunction002 = (void *)GetProcAddress( module, "SystemFunction002" );
554
if (pSystemFunction002)
555
test_SystemFunction002();
556
else
557
win_skip("SystemFunction002 is not available\n");
558
559
pSystemFunction003 = (void *)GetProcAddress( module, "SystemFunction003" );
560
if (pSystemFunction003)
561
test_SystemFunction003();
562
else
563
win_skip("SystemFunction002 is not available\n");
564
565
pSystemFunction004 = (void *)GetProcAddress( module, "SystemFunction004" );
566
if (pSystemFunction004)
567
test_SystemFunction004();
568
else
569
win_skip("SystemFunction004 is not available\n");
570
571
pSystemFunction005 = (void *)GetProcAddress( module, "SystemFunction005" );
572
if (pSystemFunction005)
573
test_SystemFunction005();
574
else
575
win_skip("SystemFunction005 is not available\n");
576
577
pSystemFunction006 = (void *)GetProcAddress( module, "SystemFunction006" );
578
if (pSystemFunction006)
579
test_SystemFunction006();
580
else
581
win_skip("SystemFunction006 is not available\n");
582
583
pSystemFunction008 = (void *)GetProcAddress( module, "SystemFunction008" );
584
if (pSystemFunction008)
585
test_SystemFunction008();
586
else
587
win_skip("SystemFunction008 is not available\n");
588
589
pSystemFunction009 = (void *)GetProcAddress( module, "SystemFunction009" );
590
if (pSystemFunction009)
591
test_SystemFunction009();
592
else
593
win_skip("SystemFunction009 is not available\n");
594
595
pSystemFunction012 = (descrypt) GetProcAddress( module, "SystemFunction012");
596
pSystemFunction013 = (descrypt) GetProcAddress( module, "SystemFunction013");
597
pSystemFunction014 = (descrypt) GetProcAddress( module, "SystemFunction014");
598
pSystemFunction015 = (descrypt) GetProcAddress( module, "SystemFunction015");
599
pSystemFunction016 = (descrypt) GetProcAddress( module, "SystemFunction016");
600
pSystemFunction017 = (descrypt) GetProcAddress( module, "SystemFunction017");
601
pSystemFunction018 = (descrypt) GetProcAddress( module, "SystemFunction018");
602
pSystemFunction019 = (descrypt) GetProcAddress( module, "SystemFunction019");
603
pSystemFunction020 = (descrypt) GetProcAddress( module, "SystemFunction020");
604
pSystemFunction021 = (descrypt) GetProcAddress( module, "SystemFunction021");
605
pSystemFunction022 = (descrypt) GetProcAddress( module, "SystemFunction022");
606
pSystemFunction023 = (descrypt) GetProcAddress( module, "SystemFunction023");
607
608
/* these all encrypt two DES blocks */
609
test_SystemFunction_encrypt(pSystemFunction012, 12);
610
test_SystemFunction_encrypt(pSystemFunction014, 14);
611
test_SystemFunction_encrypt(pSystemFunction016, 16);
612
test_SystemFunction_encrypt(pSystemFunction018, 18);
613
test_SystemFunction_encrypt(pSystemFunction020, 20);
614
test_SystemFunction_encrypt(pSystemFunction022, 22);
615
616
/* these all decrypt two DES blocks */
617
test_SystemFunction_decrypt(pSystemFunction013, 13);
618
test_SystemFunction_decrypt(pSystemFunction015, 15);
619
test_SystemFunction_decrypt(pSystemFunction017, 17);
620
test_SystemFunction_decrypt(pSystemFunction019, 19);
621
test_SystemFunction_decrypt(pSystemFunction021, 21);
622
test_SystemFunction_decrypt(pSystemFunction023, 23);
623
624
pSystemFunction024 = (descrypt) GetProcAddress( module, "SystemFunction024");
625
pSystemFunction025 = (descrypt) GetProcAddress( module, "SystemFunction025");
626
pSystemFunction026 = (descrypt) GetProcAddress( module, "SystemFunction026");
627
pSystemFunction027 = (descrypt) GetProcAddress( module, "SystemFunction027");
628
629
/* these encrypt two DES blocks with a short key */
630
test_SystemFunction_enc32(pSystemFunction024, 24);
631
test_SystemFunction_enc32(pSystemFunction026, 26);
632
633
/* these descrypt two DES blocks with a short key */
634
test_SystemFunction_dec32(pSystemFunction025, 25);
635
test_SystemFunction_dec32(pSystemFunction027, 27);
636
637
pSystemFunction030 = (memcmpfunc) GetProcAddress( module, "SystemFunction030" );
638
pSystemFunction031 = (memcmpfunc) GetProcAddress( module, "SystemFunction031" );
639
640
test_memcmpfunc(pSystemFunction030);
641
test_memcmpfunc(pSystemFunction031);
642
643
pSystemFunction032 = (void *)GetProcAddress( module, "SystemFunction032" );
644
if (pSystemFunction032)
645
test_SystemFunction032();
646
else
647
win_skip("SystemFunction032 is not available\n");
648
}
649
650