2004-12-11 00:21:33 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2004 Hans Leidekker
|
|
|
|
*
|
|
|
|
* Based on LMHash.c from libcifs
|
|
|
|
*
|
|
|
|
* Copyright (C) 2004 by Christopher R. Hertel
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
Sync aclui, advapi32, atl, authz, kernel32, msi, oledlg, powrprof, qmgr, riched20, samlib to Wine 1.2rc5
Update some psdk Headers to get some more synched winetests build
svn path=/trunk/; revision=47930
2010-07-03 12:42:55 +00:00
|
|
|
*
|
2004-12-11 00:21:33 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
Sync aclui, advapi32, atl, authz, kernel32, msi, oledlg, powrprof, qmgr, riched20, samlib to Wine 1.2rc5
Update some psdk Headers to get some more synched winetests build
svn path=/trunk/; revision=47930
2010-07-03 12:42:55 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-12-11 00:21:33 +00:00
|
|
|
*/
|
|
|
|
|
2005-08-05 10:31:28 +00:00
|
|
|
#include <advapi32.h>
|
2004-12-12 15:17:38 +00:00
|
|
|
|
2004-12-11 00:21:33 +00:00
|
|
|
static const unsigned char CRYPT_LMhash_Magic[8] =
|
|
|
|
{ 'K', 'G', 'S', '!', '@', '#', '$', '%' };
|
|
|
|
|
Sync aclui, advapi32, atl, authz, kernel32, msi, oledlg, powrprof, qmgr, riched20, samlib to Wine 1.2rc5
Update some psdk Headers to get some more synched winetests build
svn path=/trunk/; revision=47930
2010-07-03 12:42:55 +00:00
|
|
|
static void CRYPT_LMhash( unsigned char *dst, const unsigned char *pwd, const int len )
|
2004-12-11 00:21:33 +00:00
|
|
|
{
|
|
|
|
int i, max = 14;
|
Sync aclui, advapi32, atl, authz, kernel32, msi, oledlg, powrprof, qmgr, riched20, samlib to Wine 1.2rc5
Update some psdk Headers to get some more synched winetests build
svn path=/trunk/; revision=47930
2010-07-03 12:42:55 +00:00
|
|
|
unsigned char tmp_pwd[14] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
|
2004-12-11 00:21:33 +00:00
|
|
|
|
|
|
|
max = len > max ? max : len;
|
|
|
|
|
|
|
|
for (i = 0; i < max; i++)
|
|
|
|
tmp_pwd[i] = pwd[i];
|
|
|
|
|
Sync aclui, advapi32, atl, authz, kernel32, msi, oledlg, powrprof, qmgr, riched20, samlib to Wine 1.2rc5
Update some psdk Headers to get some more synched winetests build
svn path=/trunk/; revision=47930
2010-07-03 12:42:55 +00:00
|
|
|
CRYPT_DEShash( dst, tmp_pwd, CRYPT_LMhash_Magic );
|
|
|
|
CRYPT_DEShash( &dst[8], &tmp_pwd[7], CRYPT_LMhash_Magic );
|
2004-12-11 00:21:33 +00:00
|
|
|
}
|
|
|
|
|
Sync aclui, advapi32, atl, authz, kernel32, msi, oledlg, powrprof, qmgr, riched20, samlib to Wine 1.2rc5
Update some psdk Headers to get some more synched winetests build
svn path=/trunk/; revision=47930
2010-07-03 12:42:55 +00:00
|
|
|
NTSTATUS WINAPI SystemFunction006( LPCSTR password, LPSTR hash )
|
2004-12-11 00:21:33 +00:00
|
|
|
{
|
Sync aclui, advapi32, atl, authz, kernel32, msi, oledlg, powrprof, qmgr, riched20, samlib to Wine 1.2rc5
Update some psdk Headers to get some more synched winetests build
svn path=/trunk/; revision=47930
2010-07-03 12:42:55 +00:00
|
|
|
CRYPT_LMhash( (unsigned char*)hash, (const unsigned char*)password, strlen(password) );
|
2004-12-11 00:21:33 +00:00
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|