Author: ekohl
Date: Sat May 21 13:12:53 2016
New Revision: 71364
URL:
http://svn.reactos.org/svn/reactos?rev=71364&view=rev
Log:
[SAMSRV]
Add LM_OWF_PASSWORD and NT_OWF_PASSWORD types and use them.
See MS-NRPC sections 2.2.1.1.1 to 2.2.1.1.4.
Modified:
trunk/reactos/dll/win32/samlib/samlib.c
trunk/reactos/dll/win32/samsrv/samrpc.c
trunk/reactos/sdk/include/reactos/idl/sam.idl
Modified: trunk/reactos/dll/win32/samlib/samlib.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samlib/samlib.c?…
==============================================================================
--- trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samlib/samlib.c [iso-8859-1] Sat May 21 13:12:53 2016
@@ -300,10 +300,10 @@
IN PUNICODE_STRING OldPassword,
IN PUNICODE_STRING NewPassword)
{
- ENCRYPTED_NT_OWF_PASSWORD OldNtPassword;
- ENCRYPTED_NT_OWF_PASSWORD NewNtPassword;
- ENCRYPTED_LM_OWF_PASSWORD OldLmPassword;
- ENCRYPTED_LM_OWF_PASSWORD NewLmPassword;
+ NT_OWF_PASSWORD OldNtPassword;
+ NT_OWF_PASSWORD NewNtPassword;
+ LM_OWF_PASSWORD OldLmPassword;
+ LM_OWF_PASSWORD NewLmPassword;
OEM_STRING LmPwdString;
CHAR LmPwdBuffer[15];
BOOLEAN OldLmPasswordPresent = FALSE;
@@ -312,8 +312,8 @@
ENCRYPTED_LM_OWF_PASSWORD OldLmEncryptedWithNewLm;
ENCRYPTED_LM_OWF_PASSWORD NewLmEncryptedWithOldLm;
- ENCRYPTED_LM_OWF_PASSWORD OldNtEncryptedWithNewNt;
- ENCRYPTED_LM_OWF_PASSWORD NewNtEncryptedWithOldNt;
+ ENCRYPTED_NT_OWF_PASSWORD OldNtEncryptedWithNewNt;
+ ENCRYPTED_NT_OWF_PASSWORD NewNtEncryptedWithOldNt;
PENCRYPTED_LM_OWF_PASSWORD pOldLmEncryptedWithNewLm = NULL;
PENCRYPTED_LM_OWF_PASSWORD pNewLmEncryptedWithOldLm = NULL;
@@ -377,6 +377,7 @@
if (OldLmPasswordPresent && NewLmPasswordPresent)
{
+ /* Encrypt the old LM hash with the new LM hash */
Status = SystemFunction012((const BYTE *)&OldLmPassword,
(const BYTE *)&NewLmPassword,
(LPBYTE)&OldLmEncryptedWithNewLm);
@@ -386,6 +387,7 @@
return Status;
}
+ /* Encrypt the new LM hash with the old LM hash */
Status = SystemFunction012((const BYTE *)&NewLmPassword,
(const BYTE *)&OldLmPassword,
(LPBYTE)&NewLmEncryptedWithOldLm);
@@ -399,6 +401,7 @@
pNewLmEncryptedWithOldLm = &NewLmEncryptedWithOldLm;
}
+ /* Encrypt the old NT hash with the new NT hash */
Status = SystemFunction012((const BYTE *)&OldNtPassword,
(const BYTE *)&NewNtPassword,
(LPBYTE)&OldNtEncryptedWithNewNt);
@@ -408,6 +411,7 @@
return Status;
}
+ /* Encrypt the new NT hash with the old NT hash */
Status = SystemFunction012((const BYTE *)&NewNtPassword,
(const BYTE *)&OldNtPassword,
(LPBYTE)&NewNtEncryptedWithOldNt);
Modified: trunk/reactos/dll/win32/samsrv/samrpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samrpc.c?…
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samrpc.c [iso-8859-1] Sat May 21 13:12:53 2016
@@ -8047,10 +8047,10 @@
{
ENCRYPTED_LM_OWF_PASSWORD StoredLmPassword;
ENCRYPTED_NT_OWF_PASSWORD StoredNtPassword;
- ENCRYPTED_LM_OWF_PASSWORD OldLmPassword;
- ENCRYPTED_LM_OWF_PASSWORD NewLmPassword;
- ENCRYPTED_NT_OWF_PASSWORD OldNtPassword;
- ENCRYPTED_NT_OWF_PASSWORD NewNtPassword;
+ LM_OWF_PASSWORD OldLmPassword;
+ LM_OWF_PASSWORD NewLmPassword;
+ NT_OWF_PASSWORD OldNtPassword;
+ NT_OWF_PASSWORD NewNtPassword;
BOOLEAN StoredLmPresent = FALSE;
BOOLEAN StoredNtPresent = FALSE;
BOOLEAN StoredLmEmpty = TRUE;
Modified: trunk/reactos/sdk/include/reactos/idl/sam.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/reactos/idl/sa…
==============================================================================
--- trunk/reactos/sdk/include/reactos/idl/sam.idl [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/reactos/idl/sam.idl [iso-8859-1] Sat May 21 13:12:53 2016
@@ -28,7 +28,10 @@
typedef struct _ENCRYPTED_LM_OWF_PASSWORD
{
char data[16];
-} ENCRYPTED_LM_OWF_PASSWORD, *PENCRYPTED_LM_OWF_PASSWORD, ENCRYPTED_NT_OWF_PASSWORD,
*PENCRYPTED_NT_OWF_PASSWORD;
+} LM_OWF_PASSWORD, *PLM_OWF_PASSWORD,
+ NT_OWF_PASSWORD, *PNT_OWF_PASSWORD,
+ ENCRYPTED_LM_OWF_PASSWORD, *PENCRYPTED_LM_OWF_PASSWORD,
+ ENCRYPTED_NT_OWF_PASSWORD, *PENCRYPTED_NT_OWF_PASSWORD;
typedef struct _SAMPR_ULONG_ARRAY
{