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
b4899f07
Commit
b4899f07
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 SystemFunction010.
parent
64ae8285
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
1 deletion
+49
-1
advapi32.spec
dlls/advapi32/advapi32.spec
+1
-1
crypt_md4.c
dlls/advapi32/crypt_md4.c
+27
-0
crypt_md4.c
dlls/advapi32/tests/crypt_md4.c
+21
-0
No files found.
dlls/advapi32/advapi32.spec
View file @
b4899f07
...
@@ -604,7 +604,7 @@
...
@@ -604,7 +604,7 @@
@ stdcall SystemFunction007(ptr ptr)
@ stdcall SystemFunction007(ptr ptr)
@ stdcall SystemFunction008(ptr ptr ptr)
@ stdcall SystemFunction008(ptr ptr ptr)
@ stdcall SystemFunction009(ptr ptr ptr)
@ stdcall SystemFunction009(ptr ptr ptr)
@ st
ub SystemFunction010
@ st
dcall SystemFunction010(ptr ptr ptr)
@ stub SystemFunction011
@ stub SystemFunction011
@ stub SystemFunction012
@ stub SystemFunction012
@ stub SystemFunction013
@ stub SystemFunction013
...
...
dlls/advapi32/crypt_md4.c
View file @
b4899f07
...
@@ -296,3 +296,30 @@ NTSTATUS WINAPI SystemFunction007(PUNICODE_STRING string, LPBYTE hash)
...
@@ -296,3 +296,30 @@ NTSTATUS WINAPI SystemFunction007(PUNICODE_STRING string, LPBYTE hash)
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
/******************************************************************************
* SystemFunction010 [ADVAPI32.@]
*
* MD4 hashes 16 bytes of data
*
* PARAMS
* unknown [] seems to have no effect on the output
* data [I] pointer to data to hash (16 bytes)
* output [O] the md4 hash of the data (16 bytes)
*
* RETURNS
* Success: STATUS_SUCCESS
* Failure: STATUS_UNSUCCESSFUL
*
*/
NTSTATUS
WINAPI
SystemFunction010
(
LPVOID
unknown
,
LPBYTE
data
,
LPBYTE
hash
)
{
MD4_CTX
ctx
;
MD4Init
(
&
ctx
);
MD4Update
(
&
ctx
,
data
,
0x10
);
MD4Final
(
&
ctx
);
memcpy
(
hash
,
ctx
.
digest
,
0x10
);
return
STATUS_SUCCESS
;
}
dlls/advapi32/tests/crypt_md4.c
View file @
b4899f07
...
@@ -40,11 +40,13 @@ typedef VOID (WINAPI *fnMD4Init)( MD4_CTX *ctx );
...
@@ -40,11 +40,13 @@ typedef VOID (WINAPI *fnMD4Init)( MD4_CTX *ctx );
typedef
VOID
(
WINAPI
*
fnMD4Update
)(
MD4_CTX
*
ctx
,
const
unsigned
char
*
src
,
const
int
len
);
typedef
VOID
(
WINAPI
*
fnMD4Update
)(
MD4_CTX
*
ctx
,
const
unsigned
char
*
src
,
const
int
len
);
typedef
VOID
(
WINAPI
*
fnMD4Final
)(
MD4_CTX
*
ctx
);
typedef
VOID
(
WINAPI
*
fnMD4Final
)(
MD4_CTX
*
ctx
);
typedef
int
(
WINAPI
*
fnSystemFunction007
)(
PUNICODE_STRING
,
LPBYTE
);
typedef
int
(
WINAPI
*
fnSystemFunction007
)(
PUNICODE_STRING
,
LPBYTE
);
typedef
int
(
WINAPI
*
fnSystemFunction010
)(
LPVOID
,
const
LPBYTE
,
LPBYTE
);
fnMD4Init
pMD4Init
;
fnMD4Init
pMD4Init
;
fnMD4Update
pMD4Update
;
fnMD4Update
pMD4Update
;
fnMD4Final
pMD4Final
;
fnMD4Final
pMD4Final
;
fnSystemFunction007
pSystemFunction007
;
fnSystemFunction007
pSystemFunction007
;
fnSystemFunction010
pSystemFunction010
;
#define ctxcmp( a, b ) memcmp( (char*)a, (char*)b, FIELD_OFFSET( MD4_CTX, in ) )
#define ctxcmp( a, b ) memcmp( (char*)a, (char*)b, FIELD_OFFSET( MD4_CTX, in ) )
...
@@ -124,6 +126,21 @@ static void test_SystemFunction007(void)
...
@@ -124,6 +126,21 @@ static void test_SystemFunction007(void)
ok
(
!
memcmp
(
output
,
expected
,
sizeof
expected
),
"response wrong
\n
"
);
ok
(
!
memcmp
(
output
,
expected
,
sizeof
expected
),
"response wrong
\n
"
);
}
}
static
void
test_SystemFunction010
(
void
)
{
unsigned
char
expected
[
0x10
]
=
{
0x48
,
0x7c
,
0x3f
,
0x5e
,
0x2b
,
0x0d
,
0x6a
,
0x79
,
0x32
,
0x4e
,
0xcd
,
0xbe
,
0x9c
,
0x15
,
0x16
,
0x6f
};
unsigned
char
in
[
0x10
],
output
[
0x10
];
int
r
;
memset
(
in
,
0
,
sizeof
in
);
memset
(
output
,
0
,
sizeof
output
);
r
=
pSystemFunction010
(
0
,
in
,
output
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code
\n
"
);
ok
(
!
memcmp
(
expected
,
output
,
sizeof
output
),
"output wrong
\n
"
);
}
START_TEST
(
crypt_md4
)
START_TEST
(
crypt_md4
)
{
{
HMODULE
module
;
HMODULE
module
;
...
@@ -141,5 +158,9 @@ START_TEST(crypt_md4)
...
@@ -141,5 +158,9 @@ START_TEST(crypt_md4)
if
(
pSystemFunction007
)
if
(
pSystemFunction007
)
test_SystemFunction007
();
test_SystemFunction007
();
pSystemFunction010
=
(
fnSystemFunction010
)
GetProcAddress
(
module
,
"SystemFunction010"
);
if
(
pSystemFunction010
)
test_SystemFunction010
();
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