mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s4:auth/ntlm: move auth_check_password_wrapper() further down
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
60bee9d118
commit
ee4ea4b99c
@ -186,43 +186,6 @@ _PUBLIC_ NTSTATUS auth_check_password(struct auth4_context *auth_ctx,
|
||||
return status;
|
||||
}
|
||||
|
||||
static NTSTATUS auth_check_password_wrapper(struct auth4_context *auth_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
const struct auth_usersupplied_info *user_info,
|
||||
uint8_t *pauthoritative,
|
||||
void **server_returned_info,
|
||||
DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key)
|
||||
{
|
||||
struct auth_user_info_dc *user_info_dc;
|
||||
NTSTATUS status;
|
||||
|
||||
status = auth_check_password(auth_ctx, mem_ctx, user_info,
|
||||
&user_info_dc, pauthoritative);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
*server_returned_info = user_info_dc;
|
||||
|
||||
if (user_session_key) {
|
||||
DEBUG(10, ("Got NT session key of length %u\n",
|
||||
(unsigned)user_info_dc->user_session_key.length));
|
||||
*user_session_key = user_info_dc->user_session_key;
|
||||
talloc_steal(mem_ctx, user_session_key->data);
|
||||
user_info_dc->user_session_key = data_blob_null;
|
||||
}
|
||||
|
||||
if (lm_session_key) {
|
||||
DEBUG(10, ("Got LM session key of length %u\n",
|
||||
(unsigned)user_info_dc->lm_session_key.length));
|
||||
*lm_session_key = user_info_dc->lm_session_key;
|
||||
talloc_steal(mem_ctx, lm_session_key->data);
|
||||
user_info_dc->lm_session_key = data_blob_null;
|
||||
}
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
struct auth_check_password_state {
|
||||
struct auth4_context *auth_ctx;
|
||||
const struct auth_usersupplied_info *user_info;
|
||||
@ -497,6 +460,43 @@ _PUBLIC_ NTSTATUS auth_check_password_recv(struct tevent_req *req,
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
static NTSTATUS auth_check_password_wrapper(struct auth4_context *auth_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
const struct auth_usersupplied_info *user_info,
|
||||
uint8_t *pauthoritative,
|
||||
void **server_returned_info,
|
||||
DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key)
|
||||
{
|
||||
struct auth_user_info_dc *user_info_dc;
|
||||
NTSTATUS status;
|
||||
|
||||
status = auth_check_password(auth_ctx, mem_ctx, user_info,
|
||||
&user_info_dc, pauthoritative);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
*server_returned_info = user_info_dc;
|
||||
|
||||
if (user_session_key) {
|
||||
DEBUG(10, ("Got NT session key of length %u\n",
|
||||
(unsigned)user_info_dc->user_session_key.length));
|
||||
*user_session_key = user_info_dc->user_session_key;
|
||||
talloc_steal(mem_ctx, user_session_key->data);
|
||||
user_info_dc->user_session_key = data_blob_null;
|
||||
}
|
||||
|
||||
if (lm_session_key) {
|
||||
DEBUG(10, ("Got LM session key of length %u\n",
|
||||
(unsigned)user_info_dc->lm_session_key.length));
|
||||
*lm_session_key = user_info_dc->lm_session_key;
|
||||
talloc_steal(mem_ctx, lm_session_key->data);
|
||||
user_info_dc->lm_session_key = data_blob_null;
|
||||
}
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
/* Wrapper because we don't want to expose all callers to needing to
|
||||
* know that session_info is generated from the main ldb, and because
|
||||
* we need to break a depenency loop between the DCE/RPC layer and the
|
||||
|
Loading…
Reference in New Issue
Block a user