mirror of
https://github.com/reactos/reactos.git
synced 2025-05-22 10:35:54 +00:00
[SAMLIB]
SamSetInformationUser: Build the LM password and calculate the LM password hash in the UserSetPasswordInformation case. svn path=/trunk/; revision=58259
This commit is contained in:
parent
cdb9b56484
commit
627a195996
1 changed files with 25 additions and 1 deletions
|
@ -31,6 +31,10 @@
|
|||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(samlib);
|
||||
|
||||
NTSTATUS
|
||||
WINAPI
|
||||
SystemFunction006(LPCSTR password,
|
||||
LPSTR hash);
|
||||
|
||||
NTSTATUS
|
||||
WINAPI
|
||||
|
@ -1602,7 +1606,8 @@ SamSetInformationUser(IN SAM_HANDLE UserHandle,
|
|||
{
|
||||
PSAMPR_USER_SET_PASSWORD_INFORMATION PasswordBuffer;
|
||||
SAMPR_USER_INTERNAL1_INFORMATION Internal1Buffer;
|
||||
|
||||
OEM_STRING LmPwdString;
|
||||
CHAR LmPwdBuffer[15];
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE("SamSetInformationUser(%p %lu %p)\n",
|
||||
|
@ -1623,6 +1628,25 @@ SamSetInformationUser(IN SAM_HANDLE UserHandle,
|
|||
|
||||
Internal1Buffer.NtPasswordPresent = TRUE;
|
||||
Internal1Buffer.LmPasswordPresent = FALSE;
|
||||
|
||||
/* Build the LM password */
|
||||
LmPwdString.Length = 15;
|
||||
LmPwdString.MaximumLength = 15;
|
||||
LmPwdString.Buffer = LmPwdBuffer;
|
||||
ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength);
|
||||
|
||||
Status = RtlUpcaseUnicodeStringToOemString(&LmPwdString,
|
||||
(PUNICODE_STRING)&PasswordBuffer->Password,
|
||||
FALSE);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
/* Calculate the LM hash value of the password */
|
||||
Status = SystemFunction006(LmPwdString.Buffer,
|
||||
(LPSTR)&Internal1Buffer.EncryptedLmOwfPassword);
|
||||
if (NT_SUCCESS(Status))
|
||||
Internal1Buffer.LmPasswordPresent = TRUE;
|
||||
}
|
||||
|
||||
Internal1Buffer.PasswordExpired = PasswordBuffer->PasswordExpired;
|
||||
|
||||
RpcTryExcept
|
||||
|
|
Loading…
Reference in a new issue