Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
500384b0
Commit
500384b0
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: Test and implement SystemFunction024/025.
parent
6fad2cba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
2 deletions
+119
-2
advapi32.spec
dlls/advapi32/advapi32.spec
+2
-2
crypt_lmhash.c
dlls/advapi32/crypt_lmhash.c
+56
-0
crypt_lmhash.c
dlls/advapi32/tests/crypt_lmhash.c
+61
-0
No files found.
dlls/advapi32/advapi32.spec
View file @
500384b0
...
@@ -618,8 +618,8 @@
...
@@ -618,8 +618,8 @@
@ stdcall SystemFunction021(ptr ptr ptr) SystemFunction013
@ stdcall SystemFunction021(ptr ptr ptr) SystemFunction013
@ stdcall SystemFunction022(ptr ptr ptr) SystemFunction012
@ stdcall SystemFunction022(ptr ptr ptr) SystemFunction012
@ stdcall SystemFunction023(ptr ptr ptr) SystemFunction013
@ stdcall SystemFunction023(ptr ptr ptr) SystemFunction013
@ st
ub SystemFunction024
@ st
dcall SystemFunction024(ptr ptr ptr)
@ st
ub SystemFunction025
@ st
dcall SystemFunction025(ptr ptr ptr)
@ stub SystemFunction026
@ stub SystemFunction026
@ stub SystemFunction027
@ stub SystemFunction027
@ stub SystemFunction028
@ stub SystemFunction028
...
...
dlls/advapi32/crypt_lmhash.c
View file @
500384b0
...
@@ -348,3 +348,59 @@ NTSTATUS WINAPI SystemFunction013(const LPBYTE in, const LPBYTE key, LPBYTE out)
...
@@ -348,3 +348,59 @@ NTSTATUS WINAPI SystemFunction013(const LPBYTE in, const LPBYTE key, LPBYTE out)
CRYPT_DESunhash
(
out
+
8
,
key
+
7
,
in
+
8
);
CRYPT_DESunhash
(
out
+
8
,
key
+
7
,
in
+
8
);
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
/******************************************************************************
* SystemFunction024 [ADVAPI32.@]
*
* Encrypts two DES blocks with a 32 bit key...
*
* PARAMS
* data [I] data to encrypt (16 bytes)
* key [I] key data (4 bytes)
* output [O] buffer to receive encrypted data (16 bytes)
*
* RETURNS
* Success: STATUS_SUCCESS
*/
NTSTATUS
WINAPI
SystemFunction024
(
const
LPBYTE
in
,
const
LPBYTE
key
,
LPBYTE
out
)
{
BYTE
deskey
[
0x10
];
memcpy
(
deskey
,
key
,
4
);
memcpy
(
deskey
+
4
,
key
,
4
);
memcpy
(
deskey
+
8
,
key
,
4
);
memcpy
(
deskey
+
12
,
key
,
4
);
CRYPT_DEShash
(
out
,
deskey
,
in
);
CRYPT_DEShash
(
out
+
8
,
deskey
+
7
,
in
+
8
);
return
STATUS_SUCCESS
;
}
/******************************************************************************
* SystemFunction025 [ADVAPI32.@]
*
* Decrypts two DES blocks with a 32 bit key...
*
* PARAMS
* data [I] data to encrypt (16 bytes)
* key [I] key data (4 bytes)
* output [O] buffer to receive encrypted data (16 bytes)
*
* RETURNS
* Success: STATUS_SUCCESS
*/
NTSTATUS
WINAPI
SystemFunction025
(
const
LPBYTE
in
,
const
LPBYTE
key
,
LPBYTE
out
)
{
BYTE
deskey
[
0x10
];
memcpy
(
deskey
,
key
,
4
);
memcpy
(
deskey
+
4
,
key
,
4
);
memcpy
(
deskey
+
8
,
key
,
4
);
memcpy
(
deskey
+
12
,
key
,
4
);
CRYPT_DESunhash
(
out
,
deskey
,
in
);
CRYPT_DESunhash
(
out
+
8
,
deskey
+
7
,
in
+
8
);
return
STATUS_SUCCESS
;
}
dlls/advapi32/tests/crypt_lmhash.c
View file @
500384b0
...
@@ -70,6 +70,8 @@ descrypt pSystemFunction019;
...
@@ -70,6 +70,8 @@ descrypt pSystemFunction019;
descrypt
pSystemFunction021
;
descrypt
pSystemFunction021
;
descrypt
pSystemFunction023
;
descrypt
pSystemFunction023
;
descrypt
pSystemFunction024
;
descrypt
pSystemFunction025
;
fnSystemFunction032
pSystemFunction032
;
fnSystemFunction032
pSystemFunction032
;
static
void
test_SystemFunction006
(
void
)
static
void
test_SystemFunction006
(
void
)
...
@@ -423,6 +425,57 @@ static void test_SystemFunction_decrypt(descrypt func, int num)
...
@@ -423,6 +425,57 @@ 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
)
{
unsigned
char
key
[
0x10
],
output
[
0x20
];
int
r
;
memset
(
output
,
0
,
sizeof
output
);
memset
(
key
,
0
,
sizeof
key
);
/* two keys are generated using 4 bytes, repeated 4 times ... */
memcpy
(
key
,
"foo"
,
4
);
r
=
pSystemFunction024
(
des_plaintext
,
key
,
output
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code
\n
"
);
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
"
);
}
static
void
test_SystemFunction025
(
void
)
{
unsigned
char
key
[
0x10
],
output
[
0x20
];
int
r
;
memset
(
output
,
0
,
sizeof
output
);
memset
(
key
,
0
,
sizeof
key
);
/* two keys are generated using 4 bytes, repeated 4 times ... */
memcpy
(
key
,
"foo"
,
4
);
/* decrypts output of function 025 */
r
=
pSystemFunction025
(
des_ciphertext
,
key
,
output
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code
\n
"
);
memcpy
(
key
,
"foo"
,
4
);
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
)
{
{
HMODULE
module
;
HMODULE
module
;
...
@@ -494,5 +547,13 @@ START_TEST(crypt_lmhash)
...
@@ -494,5 +547,13 @@ START_TEST(crypt_lmhash)
test_SystemFunction_decrypt
(
pSystemFunction021
,
21
);
test_SystemFunction_decrypt
(
pSystemFunction021
,
21
);
test_SystemFunction_decrypt
(
pSystemFunction023
,
23
);
test_SystemFunction_decrypt
(
pSystemFunction023
,
23
);
pSystemFunction024
=
(
descrypt
)
GetProcAddress
(
module
,
"SystemFunction024"
);
if
(
pSystemFunction024
)
test_SystemFunction024
();
pSystemFunction025
=
(
descrypt
)
GetProcAddress
(
module
,
"SystemFunction025"
);
if
(
pSystemFunction025
)
test_SystemFunction025
();
FreeLibrary
(
module
);
FreeLibrary
(
module
);
}
}
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