Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
eb1b3976
Commit
eb1b3976
authored
May 21, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
May 22, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implement and test SystemFunction026+027.
parent
c3a1e873
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
37 deletions
+38
-37
advapi32.spec
dlls/advapi32/advapi32.spec
+2
-2
crypt_lmhash.c
dlls/advapi32/tests/crypt_lmhash.c
+36
-35
No files found.
dlls/advapi32/advapi32.spec
View file @
eb1b3976
...
@@ -620,8 +620,8 @@
...
@@ -620,8 +620,8 @@
@ stdcall SystemFunction023(ptr ptr ptr) SystemFunction013
@ stdcall SystemFunction023(ptr ptr ptr) SystemFunction013
@ stdcall SystemFunction024(ptr ptr ptr)
@ stdcall SystemFunction024(ptr ptr ptr)
@ stdcall SystemFunction025(ptr ptr ptr)
@ stdcall SystemFunction025(ptr ptr ptr)
@ st
ub SystemFunction026
@ st
dcall SystemFunction026(ptr ptr ptr) SystemFunction024
@ st
ub SystemFunction027
@ st
dcall SystemFunction027(ptr ptr ptr) SystemFunction025
@ stub SystemFunction028
@ stub SystemFunction028
@ stub SystemFunction029
@ stub SystemFunction029
@ stub SystemFunction030
@ stub SystemFunction030
...
...
dlls/advapi32/tests/crypt_lmhash.c
View file @
eb1b3976
...
@@ -70,8 +70,14 @@ descrypt pSystemFunction019;
...
@@ -70,8 +70,14 @@ descrypt pSystemFunction019;
descrypt
pSystemFunction021
;
descrypt
pSystemFunction021
;
descrypt
pSystemFunction023
;
descrypt
pSystemFunction023
;
/* encrypt two blocks with a 32bit key */
descrypt
pSystemFunction024
;
descrypt
pSystemFunction024
;
descrypt
pSystemFunction025
;
descrypt
pSystemFunction025
;
/* decrypt two blocks with a 32bit key */
descrypt
pSystemFunction026
;
descrypt
pSystemFunction027
;
fnSystemFunction032
pSystemFunction032
;
fnSystemFunction032
pSystemFunction032
;
static
void
test_SystemFunction006
(
void
)
static
void
test_SystemFunction006
(
void
)
...
@@ -425,55 +431,47 @@ static void test_SystemFunction_decrypt(descrypt func, int num)
...
@@ -425,55 +431,47 @@ static void test_SystemFunction_decrypt(descrypt func, int num)
ok
(
!
memcmp
(
des_plaintext
,
output
,
sizeof
des_plaintext
),
"plaintext wrong (%d)
\n
"
,
num
);
ok
(
!
memcmp
(
des_plaintext
,
output
,
sizeof
des_plaintext
),
"plaintext wrong (%d)
\n
"
,
num
);
}
}
static
void
test_SystemFunction024
(
void
)
static
unsigned
char
des_ciphertext32
[]
=
{
0x69
,
0x51
,
0x35
,
0x69
,
0x0d
,
0x29
,
0x24
,
0xad
,
0x23
,
0x6d
,
0xfd
,
0x43
,
0x0d
,
0xd3
,
0x25
,
0x81
,
0
};
static
void
test_SystemFunction_enc32
(
descrypt
func
,
int
num
)
{
{
unsigned
char
key
[
0x10
],
output
[
0x20
];
unsigned
char
key
[
4
],
output
[
0x11
];
int
r
;
int
r
;
if
(
!
func
)
return
;
memset
(
output
,
0
,
sizeof
output
);
memset
(
output
,
0
,
sizeof
output
);
memset
(
key
,
0
,
sizeof
key
);
/* two keys are generated using 4 bytes, repeated 4 times ... */
/* two keys are generated using 4 bytes, repeated 4 times ... */
memcpy
(
key
,
"foo"
,
4
);
memcpy
(
key
,
"foo"
,
4
);
r
=
pSystemFunction024
(
des_plaintext
,
key
,
output
);
r
=
func
(
des_plaintext
,
key
,
output
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code
\n
"
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code (%d)
\n
"
,
num
);
memcpy
(
key
,
"foo"
,
4
);
memcpy
(
key
+
4
,
"foo"
,
4
);
memcpy
(
key
+
8
,
"foo"
,
4
);
memcpy
(
key
+
12
,
"foo"
,
4
);
r
=
pSystemFunction022
(
des_plaintext
,
key
,
output
+
0x10
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code
\n
"
);
ok
(
!
memcmp
(
output
,
output
+
0x10
,
0x10
),
"ciphertext wrong
\n
"
);
ok
(
!
memcmp
(
output
,
des_ciphertext32
,
sizeof
des_ciphertext32
),
"ciphertext wrong (%d)
\n
"
,
num
);
}
}
static
void
test_SystemFunction
025
(
void
)
static
void
test_SystemFunction
_dec32
(
descrypt
func
,
int
num
)
{
{
unsigned
char
key
[
0x10
],
output
[
0x20
];
unsigned
char
key
[
4
],
output
[
0x11
];
int
r
;
int
r
;
if
(
!
func
)
return
;
memset
(
output
,
0
,
sizeof
output
);
memset
(
output
,
0
,
sizeof
output
);
memset
(
key
,
0
,
sizeof
key
);
/* two keys are generated using 4 bytes, repeated 4 times ... */
/* two keys are generated using 4 bytes, repeated 4 times ... */
memcpy
(
key
,
"foo"
,
4
);
memcpy
(
key
,
"foo"
,
4
);
/* decrypts output of function 025 */
r
=
func
(
des_ciphertext32
,
key
,
output
);
r
=
pSystemFunction025
(
des_ciphertext
,
key
,
output
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code (%d)
\n
"
,
num
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code
\n
"
);
memcpy
(
key
,
"foo"
,
4
);
ok
(
!
memcmp
(
output
,
des_plaintext
,
sizeof
des_plaintext
),
"plaintext wrong (%d)
\n
"
,
num
);
memcpy
(
key
+
4
,
"foo"
,
4
);
memcpy
(
key
+
8
,
"foo"
,
4
);
memcpy
(
key
+
12
,
"foo"
,
4
);
r
=
pSystemFunction023
(
des_ciphertext
,
key
,
output
+
0x10
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code
\n
"
);
ok
(
!
memcmp
(
output
,
output
+
0x10
,
0x10
),
"plaintext wrong
\n
"
);
}
}
START_TEST
(
crypt_lmhash
)
START_TEST
(
crypt_lmhash
)
...
@@ -548,12 +546,15 @@ START_TEST(crypt_lmhash)
...
@@ -548,12 +546,15 @@ START_TEST(crypt_lmhash)
test_SystemFunction_decrypt
(
pSystemFunction023
,
23
);
test_SystemFunction_decrypt
(
pSystemFunction023
,
23
);
pSystemFunction024
=
(
descrypt
)
GetProcAddress
(
module
,
"SystemFunction024"
);
pSystemFunction024
=
(
descrypt
)
GetProcAddress
(
module
,
"SystemFunction024"
);
if
(
pSystemFunction024
)
test_SystemFunction024
();
pSystemFunction025
=
(
descrypt
)
GetProcAddress
(
module
,
"SystemFunction025"
);
pSystemFunction025
=
(
descrypt
)
GetProcAddress
(
module
,
"SystemFunction025"
);
if
(
pSystemFunction025
)
pSystemFunction026
=
(
descrypt
)
GetProcAddress
(
module
,
"SystemFunction026"
);
test_SystemFunction025
();
pSystemFunction027
=
(
descrypt
)
GetProcAddress
(
module
,
"SystemFunction027"
);
/* these encrypt two DES blocks with a short key */
test_SystemFunction_enc32
(
pSystemFunction024
,
24
);
test_SystemFunction_enc32
(
pSystemFunction026
,
26
);
FreeLibrary
(
module
);
/* these descrypt two DES blocks with a short key */
test_SystemFunction_dec32
(
pSystemFunction025
,
25
);
test_SystemFunction_dec32
(
pSystemFunction027
,
27
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment