Dmitry Timoshkov : secur32: Implement AcceptSecurityContext in the SSP/ AP wrapper.

Alexandre Julliard julliard at winehq.org
Thu Feb 1 16:14:52 CST 2018


Module: wine
Branch: master
Commit: 904c8eb16ddb88b92085afb8d0988840eafe347d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=904c8eb16ddb88b92085afb8d0988840eafe347d

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Thu Feb  1 18:04:00 2018 +0800

secur32: Implement AcceptSecurityContext in the SSP/AP wrapper.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/secur32/lsa.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 42 insertions(+), 2 deletions(-)

diff --git a/dlls/secur32/lsa.c b/dlls/secur32/lsa.c
index 43b69a5..c4f408f 100644
--- a/dlls/secur32/lsa.c
+++ b/dlls/secur32/lsa.c
@@ -466,6 +466,46 @@ static SECURITY_STATUS WINAPI lsa_InitializeSecurityContextA(
     return status;
 }
 
+static SECURITY_STATUS WINAPI lsa_AcceptSecurityContext(
+    CredHandle *credential, CtxtHandle *context, SecBufferDesc *input,
+    ULONG context_req, ULONG target_data_rep, CtxtHandle *new_context,
+    SecBufferDesc *output, ULONG *context_attr, TimeStamp *ts_expiry)
+{
+    SECURITY_STATUS status;
+    struct lsa_package *lsa_package = NULL;
+    LSA_SEC_HANDLE lsa_credential = 0, lsa_context = 0, new_lsa_context;
+    BOOLEAN mapped_context;
+
+    TRACE("%p %p %p %#x %#x %p %p %p %p\n", credential, context, input,
+        context_req, target_data_rep, new_context, output, context_attr, ts_expiry);
+
+    if (context)
+    {
+        lsa_package = (struct lsa_package *)context->dwUpper;
+        lsa_context = (LSA_SEC_HANDLE)context->dwLower;
+    }
+    else if (credential)
+    {
+        lsa_package = (struct lsa_package *)credential->dwUpper;
+        lsa_credential = (LSA_SEC_HANDLE)credential->dwLower;
+    }
+
+    if (!lsa_package || !new_context) return SEC_E_INVALID_HANDLE;
+
+    if (!lsa_package->lsa_api || !lsa_package->lsa_api->AcceptLsaModeContext)
+        return SEC_E_UNSUPPORTED_FUNCTION;
+
+    status = lsa_package->lsa_api->AcceptLsaModeContext(lsa_credential, lsa_context,
+        input, context_req, target_data_rep, &new_lsa_context, output, context_attr,
+        ts_expiry, &mapped_context, NULL /* FIXME */);
+    if (status == SEC_E_OK || status == SEC_I_CONTINUE_NEEDED)
+    {
+        new_context->dwLower = (ULONG_PTR)new_lsa_context;
+        new_context->dwUpper = (ULONG_PTR)lsa_package;
+    }
+    return status;
+}
+
 static SECURITY_STATUS WINAPI lsa_DeleteSecurityContext(CtxtHandle *context)
 {
     struct lsa_package *lsa_package;
@@ -495,7 +535,7 @@ static const SecurityFunctionTableW lsa_sspi_tableW =
     lsa_FreeCredentialsHandle,
     NULL, /* Reserved2 */
     lsa_InitializeSecurityContextW,
-    NULL, /* AcceptSecurityContext */
+    lsa_AcceptSecurityContext,
     NULL, /* CompleteAuthToken */
     lsa_DeleteSecurityContext,
     NULL, /* ApplyControlToken */
@@ -527,7 +567,7 @@ static const SecurityFunctionTableA lsa_sspi_tableA =
     lsa_FreeCredentialsHandle,
     NULL, /* Reserved2 */
     lsa_InitializeSecurityContextA,
-    NULL, /* AcceptSecurityContext */
+    lsa_AcceptSecurityContext,
     NULL, /* CompleteAuthToken */
     lsa_DeleteSecurityContext,
     NULL, /* ApplyControlToken */




More information about the wine-cvs mailing list