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
09fc7e04
Commit
09fc7e04
authored
May 14, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
May 15, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implement and test SystemFunction003.
parent
50ed147d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
13 deletions
+66
-13
advapi32.spec
dlls/advapi32/advapi32.spec
+1
-1
crypt_lmhash.c
dlls/advapi32/crypt_lmhash.c
+22
-0
crypt_lmhash.c
dlls/advapi32/tests/crypt_lmhash.c
+43
-12
No files found.
dlls/advapi32/advapi32.spec
View file @
09fc7e04
...
@@ -597,7 +597,7 @@
...
@@ -597,7 +597,7 @@
@ stdcall SynchronizeWindows31FilesAndWindowsNTRegistry(long long long long)
@ stdcall SynchronizeWindows31FilesAndWindowsNTRegistry(long long long long)
@ stdcall SystemFunction001(ptr ptr ptr)
@ stdcall SystemFunction001(ptr ptr ptr)
@ stdcall SystemFunction002(ptr ptr ptr)
@ stdcall SystemFunction002(ptr ptr ptr)
@ st
ub SystemFunction003
@ st
dcall SystemFunction003(ptr ptr)
@ stub SystemFunction004
@ stub SystemFunction004
@ stub SystemFunction005
@ stub SystemFunction005
@ stdcall SystemFunction006(ptr ptr)
@ stdcall SystemFunction006(ptr ptr)
...
...
dlls/advapi32/crypt_lmhash.c
View file @
09fc7e04
...
@@ -135,3 +135,25 @@ NTSTATUS WINAPI SystemFunction002(const LPBYTE data, const LPBYTE key, LPBYTE ou
...
@@ -135,3 +135,25 @@ NTSTATUS WINAPI SystemFunction002(const LPBYTE data, const LPBYTE key, LPBYTE ou
CRYPT_DESunhash
(
output
,
key
,
data
);
CRYPT_DESunhash
(
output
,
key
,
data
);
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
/******************************************************************************
* SystemFunction003 [ADVAPI32.@]
*
* Hashes a key using DES and a fixed datablock
*
* PARAMS
* key [I] key data (7 bytes)
* output [O] hashed key (8 bytes)
*
* RETURNS
* Success: STATUS_SUCCESS
* Failure: STATUS_UNSUCCESSFUL
*
*/
NTSTATUS
WINAPI
SystemFunction003
(
const
LPBYTE
key
,
LPBYTE
output
)
{
if
(
!
output
)
return
STATUS_UNSUCCESSFUL
;
CRYPT_DEShash
(
output
,
key
,
CRYPT_LMhash_Magic
);
return
STATUS_SUCCESS
;
}
dlls/advapi32/tests/crypt_lmhash.c
View file @
09fc7e04
...
@@ -34,16 +34,18 @@ struct ustring {
...
@@ -34,16 +34,18 @@ struct ustring {
unsigned
char
*
Buffer
;
unsigned
char
*
Buffer
;
};
};
typedef
VOID
(
WINAPI
*
fnSystemFunction006
)(
PCSTR
passwd
,
PSTR
lmhash
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction008
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction001
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction001
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction002
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction002
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction003
)(
const
LPBYTE
,
LPBYTE
);
typedef
VOID
(
WINAPI
*
fnSystemFunction006
)(
PCSTR
passwd
,
PSTR
lmhash
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction008
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction032
)(
struct
ustring
*
,
struct
ustring
*
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction032
)(
struct
ustring
*
,
struct
ustring
*
);
fnSystemFunction006
pSystemFunction006
;
fnSystemFunction008
pSystemFunction008
;
fnSystemFunction001
pSystemFunction001
;
fnSystemFunction001
pSystemFunction001
;
fnSystemFunction002
pSystemFunction002
;
fnSystemFunction002
pSystemFunction002
;
fnSystemFunction003
pSystemFunction003
;
fnSystemFunction006
pSystemFunction006
;
fnSystemFunction008
pSystemFunction008
;
fnSystemFunction032
pSystemFunction032
;
fnSystemFunction032
pSystemFunction032
;
static
void
test_SystemFunction006
(
void
)
static
void
test_SystemFunction006
(
void
)
...
@@ -163,12 +165,49 @@ static void test_SystemFunction032(void)
...
@@ -163,12 +165,49 @@ static void test_SystemFunction032(void)
ok
(
!
memcmp
(
expected
,
data
.
Buffer
,
data
.
Length
),
"wrong result
\n
"
);
ok
(
!
memcmp
(
expected
,
data
.
Buffer
,
data
.
Length
),
"wrong result
\n
"
);
}
}
static
void
test_SystemFunction003
(
void
)
{
unsigned
char
output
[
8
],
data
[
8
];
unsigned
char
key
[
7
]
=
{
0xff
,
0x37
,
0x50
,
0xbc
,
0xc2
,
0xb2
,
0x24
};
unsigned
char
exp1
[
8
]
=
{
0x9d
,
0x21
,
0xc8
,
0x86
,
0x6c
,
0x21
,
0xcf
,
0x43
};
char
exp2
[]
=
"KGS!@#$%"
;
int
r
;
r
=
pSystemFunction003
(
NULL
,
NULL
);
ok
(
r
==
STATUS_UNSUCCESSFUL
,
"function failed
\n
"
);
r
=
pSystemFunction003
(
key
,
NULL
);
ok
(
r
==
STATUS_UNSUCCESSFUL
,
"function failed
\n
"
);
memset
(
data
,
0
,
sizeof
data
);
r
=
pSystemFunction003
(
key
,
data
);
ok
(
r
==
STATUS_SUCCESS
,
"function failed
\n
"
);
ok
(
!
memcmp
(
exp1
,
data
,
sizeof
data
),
"decrypted message wrong
\n
"
);
memset
(
output
,
0
,
sizeof
output
);
r
=
pSystemFunction002
(
data
,
key
,
output
);
ok
(
!
memcmp
(
exp2
,
output
,
sizeof
output
),
"decrypted message wrong
\n
"
);
}
START_TEST
(
crypt_lmhash
)
START_TEST
(
crypt_lmhash
)
{
{
HMODULE
module
;
HMODULE
module
;
if
(
!
(
module
=
LoadLibrary
(
"advapi32.dll"
)))
return
;
if
(
!
(
module
=
LoadLibrary
(
"advapi32.dll"
)))
return
;
pSystemFunction001
=
(
fnSystemFunction001
)
GetProcAddress
(
module
,
"SystemFunction001"
);
if
(
pSystemFunction001
)
test_SystemFunction001
();
pSystemFunction002
=
(
fnSystemFunction002
)
GetProcAddress
(
module
,
"SystemFunction002"
);
if
(
pSystemFunction002
)
test_SystemFunction002
();
pSystemFunction003
=
(
fnSystemFunction003
)
GetProcAddress
(
module
,
"SystemFunction003"
);
if
(
pSystemFunction003
)
test_SystemFunction003
();
pSystemFunction006
=
(
fnSystemFunction006
)
GetProcAddress
(
module
,
"SystemFunction006"
);
pSystemFunction006
=
(
fnSystemFunction006
)
GetProcAddress
(
module
,
"SystemFunction006"
);
if
(
pSystemFunction006
)
if
(
pSystemFunction006
)
test_SystemFunction006
();
test_SystemFunction006
();
...
@@ -177,17 +216,9 @@ START_TEST(crypt_lmhash)
...
@@ -177,17 +216,9 @@ START_TEST(crypt_lmhash)
if
(
pSystemFunction008
)
if
(
pSystemFunction008
)
test_SystemFunction008
();
test_SystemFunction008
();
pSystemFunction001
=
(
fnSystemFunction001
)
GetProcAddress
(
module
,
"SystemFunction001"
);
if
(
pSystemFunction001
)
test_SystemFunction001
();
pSystemFunction032
=
(
fnSystemFunction032
)
GetProcAddress
(
module
,
"SystemFunction032"
);
pSystemFunction032
=
(
fnSystemFunction032
)
GetProcAddress
(
module
,
"SystemFunction032"
);
if
(
pSystemFunction032
)
if
(
pSystemFunction032
)
test_SystemFunction032
();
test_SystemFunction032
();
pSystemFunction002
=
(
fnSystemFunction002
)
GetProcAddress
(
module
,
"SystemFunction002"
);
if
(
pSystemFunction002
)
test_SystemFunction002
();
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