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
6969cab5
Commit
6969cab5
authored
May 10, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
May 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Implement and test SystemFunction001.
parent
4f520dbd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
advapi32.spec
dlls/advapi32/advapi32.spec
+1
-1
crypt_lmhash.c
dlls/advapi32/crypt_lmhash.c
+23
-0
crypt_lmhash.c
dlls/advapi32/tests/crypt_lmhash.c
+26
-1
No files found.
dlls/advapi32/advapi32.spec
View file @
6969cab5
...
...
@@ -595,7 +595,7 @@
# @ stub StopTraceA
# @ stub StopTraceW
@ stdcall SynchronizeWindows31FilesAndWindowsNTRegistry(long long long long)
@ st
ub SystemFunction001
@ st
dcall SystemFunction001(ptr ptr ptr)
@ stub SystemFunction002
@ stub SystemFunction003
@ stub SystemFunction004
...
...
dlls/advapi32/crypt_lmhash.c
View file @
6969cab5
...
...
@@ -89,3 +89,26 @@ NTSTATUS WINAPI SystemFunction008(const LPBYTE challenge, const LPBYTE hash, LPB
return
STATUS_SUCCESS
;
}
/******************************************************************************
* SystemFunction001 [ADVAPI32.@]
*
* Encrypts a single block of data using DES
*
* PARAMS
* data [I] data to encrypt (8 bytes)
* key [I] key data (7 bytes)
* output [O] the encrypted data (8 bytes)
*
* RETURNS
* Success: STATUS_SUCCESS
* Failure: STATUS_UNSUCCESSFUL
*
*/
NTSTATUS
WINAPI
SystemFunction001
(
const
LPBYTE
data
,
const
LPBYTE
key
,
LPBYTE
output
)
{
if
(
!
data
||
!
output
)
return
STATUS_UNSUCCESSFUL
;
CRYPT_DEShash
(
output
,
key
,
data
);
return
STATUS_SUCCESS
;
}
dlls/advapi32/tests/crypt_lmhash.c
View file @
6969cab5
...
...
@@ -29,10 +29,12 @@
#include "winternl.h"
typedef
VOID
(
WINAPI
*
fnSystemFunction006
)(
PCSTR
passwd
,
PSTR
lmhash
);
typedef
DWORD
(
WINAPI
*
fnSystemFunction008
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction008
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
typedef
NTSTATUS
(
WINAPI
*
fnSystemFunction001
)(
const
LPBYTE
,
const
LPBYTE
,
LPBYTE
);
fnSystemFunction006
pSystemFunction006
;
fnSystemFunction008
pSystemFunction008
;
fnSystemFunction001
pSystemFunction001
;
static
void
test_SystemFunction006
(
void
)
{
...
...
@@ -93,6 +95,25 @@ static void test_SystemFunction008(void)
ok
(
!
memcmp
(
output
,
expected
,
sizeof
expected
),
"response wrong
\n
"
);
}
static
void
test_SystemFunction001
(
void
)
{
unsigned
char
key
[
8
]
=
{
0xff
,
0x37
,
0x50
,
0xbc
,
0xc2
,
0xb2
,
0x24
,
0
};
unsigned
char
data
[
8
]
=
{
0x01
,
0x23
,
0x45
,
0x67
,
0x89
,
0xab
,
0xcd
,
0xef
};
unsigned
char
expected
[
8
]
=
{
0xc3
,
0x37
,
0xcd
,
0x5c
,
0xbd
,
0x44
,
0xfc
,
0x97
};
unsigned
char
output
[
16
];
NTSTATUS
r
;
r
=
pSystemFunction001
(
0
,
0
,
0
);
ok
(
r
==
STATUS_UNSUCCESSFUL
,
"wrong error code
\n
"
);
memset
(
output
,
0
,
sizeof
output
);
r
=
pSystemFunction001
(
data
,
key
,
output
);
ok
(
r
==
STATUS_SUCCESS
,
"wrong error code
\n
"
);
ok
(
!
memcmp
(
output
,
expected
,
sizeof
expected
),
"response wrong
\n
"
);
}
START_TEST
(
crypt_lmhash
)
{
HMODULE
module
;
...
...
@@ -107,5 +128,9 @@ START_TEST(crypt_lmhash)
if
(
pSystemFunction008
)
test_SystemFunction008
();
pSystemFunction001
=
(
fnSystemFunction001
)
GetProcAddress
(
module
,
"SystemFunction001"
);
if
(
pSystemFunction001
)
test_SystemFunction001
();
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