From 64ae8285cd79bc89cfefe986998f115e3052e76b Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Sun, 21 May 2006 17:27:19 +0900 Subject: [PATCH] advapi32: Implement and test SystemFunction009. --- dlls/advapi32/advapi32.spec | 2 +- dlls/advapi32/crypt_lmhash.c | 10 ++++++++++ dlls/advapi32/tests/crypt_lmhash.c | 26 ++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index 11876969ec3..86a1b8df69f 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -603,7 +603,7 @@ @ stdcall SystemFunction006(ptr ptr) @ stdcall SystemFunction007(ptr ptr) @ stdcall SystemFunction008(ptr ptr ptr) -@ stub SystemFunction009 +@ stdcall SystemFunction009(ptr ptr ptr) @ stub SystemFunction010 @ stub SystemFunction011 @ stub SystemFunction012 diff --git a/dlls/advapi32/crypt_lmhash.c b/dlls/advapi32/crypt_lmhash.c index 4760e97d493..8200abcb20a 100644 --- a/dlls/advapi32/crypt_lmhash.c +++ b/dlls/advapi32/crypt_lmhash.c @@ -90,6 +90,16 @@ NTSTATUS WINAPI SystemFunction008(const LPBYTE challenge, const LPBYTE hash, LPB return STATUS_SUCCESS; } +/****************************************************************************** + * SystemFunction009 [ADVAPI32.@] + * + * Seems to do the same as SystemFunction008 ... + */ +NTSTATUS WINAPI SystemFunction009(const LPBYTE challenge, const LPBYTE hash, LPBYTE response) +{ + return SystemFunction008(challenge, hash, response); +} + /****************************************************************************** * SystemFunction001 [ADVAPI32.@] * diff --git a/dlls/advapi32/tests/crypt_lmhash.c b/dlls/advapi32/tests/crypt_lmhash.c index 866bbdece45..46f6ea466e9 100644 --- a/dlls/advapi32/tests/crypt_lmhash.c +++ b/dlls/advapi32/tests/crypt_lmhash.c @@ -41,6 +41,7 @@ typedef NTSTATUS (WINAPI *fnSystemFunction004)(const struct ustring *, const str typedef NTSTATUS (WINAPI *fnSystemFunction005)(const struct ustring *, const struct ustring *, struct ustring *); typedef VOID (WINAPI *fnSystemFunction006)( PCSTR passwd, PSTR lmhash ); typedef NTSTATUS (WINAPI *fnSystemFunction008)(const LPBYTE, const LPBYTE, LPBYTE); +typedef NTSTATUS (WINAPI *fnSystemFunction009)(const LPBYTE, const LPBYTE, LPBYTE); typedef NTSTATUS (WINAPI *fnSystemFunction032)(struct ustring *, struct ustring *); fnSystemFunction001 pSystemFunction001; @@ -50,6 +51,7 @@ fnSystemFunction004 pSystemFunction004; fnSystemFunction004 pSystemFunction005; fnSystemFunction006 pSystemFunction006; fnSystemFunction008 pSystemFunction008; +fnSystemFunction008 pSystemFunction009; fnSystemFunction032 pSystemFunction032; static void test_SystemFunction006(void) @@ -333,6 +335,26 @@ static void test_SystemFunction005(void) ok(r == STATUS_INVALID_PARAMETER_2, "function failed\n"); } +static void test_SystemFunction009(void) +{ + unsigned char hash[0x10] = { + 0xff, 0x37, 0x50, 0xbc, 0xc2, 0xb2, 0x24, 0x12, + 0xc2, 0x26, 0x5b, 0x23, 0x73, 0x4e, 0x0d, 0xac }; + unsigned char challenge[8] = { + 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef }; + unsigned char expected[0x18] = { + 0xc3, 0x37, 0xcd, 0x5c, 0xbd, 0x44, 0xfc, 0x97, + 0x82, 0xa6, 0x67, 0xaf, 0x6d, 0x42, 0x7c, 0x6d, + 0xe6, 0x7c, 0x20, 0xc2, 0xd3, 0xe7, 0x7c, 0x56 }; + unsigned char output[0x18]; + int r; + + memset(output, 0, sizeof output); + r = pSystemFunction009(challenge, hash, output); + ok( r == STATUS_SUCCESS, "wrong error code\n"); + ok(!memcmp(output, expected, sizeof expected), "response wrong\n"); +} + START_TEST(crypt_lmhash) { HMODULE module; @@ -367,6 +389,10 @@ START_TEST(crypt_lmhash) if (pSystemFunction008) test_SystemFunction008(); + pSystemFunction009 = (fnSystemFunction009)GetProcAddress( module, "SystemFunction009" ); + if (pSystemFunction009) + test_SystemFunction009(); + pSystemFunction032 = (fnSystemFunction032)GetProcAddress( module, "SystemFunction032" ); if (pSystemFunction032) test_SystemFunction032();