[LSASRV][SECUR32] Fix the naming mess
authorEric Kohl <eric.kohl@reactos.org>
Sun, 28 Feb 2021 10:03:07 +0000 (11:03 +0100)
committerEric Kohl <eric.kohl@reactos.org>
Sun, 28 Feb 2021 10:03:33 +0000 (11:03 +0100)
Rename Untrusted to TrustredCaller in LSA_CONNECTION_INFO and LSAP_LOGON_CONTEXT in order to clarify the meaning of the variable.

dll/win32/lsasrv/authpackage.c
dll/win32/lsasrv/authport.c
dll/win32/lsasrv/lsasrv.h
dll/win32/secur32/lsalpc.c
sdk/include/reactos/subsys/lsass/lsass.h

index ef8f80a..8e509ed 100644 (file)
@@ -585,15 +585,7 @@ LsapCallAuthenticationPackage(PLSA_API_MSG RequestMsg,
         }
     }
 
-    if (LogonContext->Untrusted)
-        Status = Package->LsaApCallPackageUntrusted((PLSA_CLIENT_REQUEST)LogonContext,
-                                                    LocalBuffer,
-                                                    RequestMsg->CallAuthenticationPackage.Request.ProtocolSubmitBuffer,
-                                                    RequestMsg->CallAuthenticationPackage.Request.SubmitBufferLength,
-                                                    &RequestMsg->CallAuthenticationPackage.Reply.ProtocolReturnBuffer,
-                                                    &RequestMsg->CallAuthenticationPackage.Reply.ReturnBufferLength,
-                                                    &RequestMsg->CallAuthenticationPackage.Reply.ProtocolStatus);
-    else
+    if (LogonContext->TrustedCaller)
         Status = Package->LsaApCallPackage((PLSA_CLIENT_REQUEST)LogonContext,
                                            LocalBuffer,
                                            RequestMsg->CallAuthenticationPackage.Request.ProtocolSubmitBuffer,
@@ -601,6 +593,14 @@ LsapCallAuthenticationPackage(PLSA_API_MSG RequestMsg,
                                            &RequestMsg->CallAuthenticationPackage.Reply.ProtocolReturnBuffer,
                                            &RequestMsg->CallAuthenticationPackage.Reply.ReturnBufferLength,
                                            &RequestMsg->CallAuthenticationPackage.Reply.ProtocolStatus);
+    else
+        Status = Package->LsaApCallPackageUntrusted((PLSA_CLIENT_REQUEST)LogonContext,
+                                                    LocalBuffer,
+                                                    RequestMsg->CallAuthenticationPackage.Request.ProtocolSubmitBuffer,
+                                                    RequestMsg->CallAuthenticationPackage.Request.SubmitBufferLength,
+                                                    &RequestMsg->CallAuthenticationPackage.Reply.ProtocolReturnBuffer,
+                                                    &RequestMsg->CallAuthenticationPackage.Reply.ReturnBufferLength,
+                                                    &RequestMsg->CallAuthenticationPackage.Reply.ProtocolStatus);
     if (!NT_SUCCESS(Status))
     {
         TRACE("Package->LsaApCallPackage() failed (Status 0x%08lx)\n", Status);
index aec05f2..e8140c0 100644 (file)
@@ -135,10 +135,10 @@ LsapCheckLogonProcess(PLSA_API_MSG RequestMsg,
     TRACE("New LogonContext: %p\n", Context);
 
     Context->ClientProcessHandle = ProcessHandle;
-    Context->Untrusted = RequestMsg->ConnectInfo.Untrusted;
+    Context->TrustedCaller = RequestMsg->ConnectInfo.TrustedCaller;
 
-    if (Context->Untrusted == FALSE)
-        Context->Untrusted = !LsapIsTrustedClient(ProcessHandle);
+    if (Context->TrustedCaller)
+        Context->TrustedCaller = LsapIsTrustedClient(ProcessHandle);
 
     *LogonContext = Context;
 
index 106a175..5e1725f 100644 (file)
@@ -79,7 +79,7 @@ typedef struct _LSAP_LOGON_CONTEXT
     LIST_ENTRY Entry;
     HANDLE ClientProcessHandle;
     HANDLE ConnectionHandle;
-    BOOL Untrusted;
+    BOOL TrustedCaller;
 } LSAP_LOGON_CONTEXT, *PLSAP_LOGON_CONTEXT;
 
 typedef struct _SAMPR_ULONG_ARRAY
index 6c21f5f..1315381 100644 (file)
@@ -74,6 +74,7 @@ LsapOpenLsaPort(VOID)
                   sizeof(ConnectInfo));
 
     ConnectInfo.CreateContext = FALSE;
+    ConnectInfo.TrustedCaller = TRUE;
 
     ConnectInfoLength = sizeof(LSA_CONNECTION_INFO);
     Status = NtConnectPort(&LsaPortHandle,
@@ -174,7 +175,7 @@ LsaConnectUntrusted(
                   ConnectInfoLength);
 
     ConnectInfo.CreateContext = TRUE;
-    ConnectInfo.Untrusted = TRUE;
+    ConnectInfo.TrustedCaller = FALSE;
 
     Status = NtConnectPort(LsaHandle,
                            &PortName,
index 612c60b..5522b0e 100644 (file)
@@ -35,7 +35,7 @@ typedef struct _LSA_CONNECTION_INFO
     ULONG Length;
     CHAR LogonProcessNameBuffer[LSASS_MAX_LOGON_PROCESS_NAME_LENGTH + 1];
     BOOL CreateContext;
-    BOOL Untrusted;
+    BOOL TrustedCaller;
 } LSA_CONNECTION_INFO, *PLSA_CONNECTION_INFO;