On Thu, 2018-01-18 at 23:54 +0800, Dmitry Timoshkov wrote:
+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 (credential) + { + lsa_package = (struct lsa_package *)credential->dwUpper; + lsa_credential = (LSA_SEC_HANDLE)credential->dwLower; + } + else if (context) + { + lsa_package = (struct lsa_package *)context->dwUpper; + lsa_context = (LSA_SEC_HANDLE)context->dwLower; + }
Same issue as with InitializeSecurityContext.
+ 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) + { + new_context->dwLower = (ULONG_PTR)new_lsa_context; + new_context->dwUpper = (ULONG_PTR)lsa_package; + }
Here too.