From 1fbb295d4ae8883edeb21e969da1d9e7bb18eb8e Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 28 Feb 2021 11:03:07 +0100 Subject: [PATCH] [LSASRV][SECUR32] Fix the naming mess 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 | 18 +++++++++--------- dll/win32/lsasrv/authport.c | 6 +++--- dll/win32/lsasrv/lsasrv.h | 2 +- dll/win32/secur32/lsalpc.c | 3 ++- sdk/include/reactos/subsys/lsass/lsass.h | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/dll/win32/lsasrv/authpackage.c b/dll/win32/lsasrv/authpackage.c index ef8f80ae57e..8e509ed72e2 100644 --- a/dll/win32/lsasrv/authpackage.c +++ b/dll/win32/lsasrv/authpackage.c @@ -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); diff --git a/dll/win32/lsasrv/authport.c b/dll/win32/lsasrv/authport.c index aec05f287e2..e8140c0930f 100644 --- a/dll/win32/lsasrv/authport.c +++ b/dll/win32/lsasrv/authport.c @@ -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; diff --git a/dll/win32/lsasrv/lsasrv.h b/dll/win32/lsasrv/lsasrv.h index 106a175722b..5e1725f81b8 100644 --- a/dll/win32/lsasrv/lsasrv.h +++ b/dll/win32/lsasrv/lsasrv.h @@ -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 diff --git a/dll/win32/secur32/lsalpc.c b/dll/win32/secur32/lsalpc.c index 6c21f5f1b97..131538103c3 100644 --- a/dll/win32/secur32/lsalpc.c +++ b/dll/win32/secur32/lsalpc.c @@ -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, diff --git a/sdk/include/reactos/subsys/lsass/lsass.h b/sdk/include/reactos/subsys/lsass/lsass.h index 612c60b4ff3..5522b0ef85f 100644 --- a/sdk/include/reactos/subsys/lsass/lsass.h +++ b/sdk/include/reactos/subsys/lsass/lsass.h @@ -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;