summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_netlogond.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/source3/auth/auth_netlogond.c b/source3/auth/auth_netlogond.c
index 5f4d2f16e3..8c930a552a 100644
--- a/source3/auth/auth_netlogond.c
+++ b/source3/auth/auth_netlogond.c
@@ -46,9 +46,21 @@ static NTSTATUS netlogond_validate(TALLOC_CTX *mem_ctx,
return status;
}
+ /*
+ * We have to fake a struct dcinfo, so that
+ * rpccli_netlogon_sam_network_logon_ex can decrypt the session keys.
+ */
+
+ p->dc = netlogon_creds_client_init_session_key(p, schannel_key);
+ if (p->dc == NULL) {
+ DEBUG(0, ("talloc failed\n"));
+ TALLOC_FREE(p);
+ return NT_STATUS_NO_MEMORY;
+ }
+
status = rpccli_schannel_bind_data(p, lp_workgroup(),
DCERPC_AUTH_LEVEL_PRIVACY,
- schannel_key, &auth);
+ p->dc, &auth);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("rpccli_schannel_bind_data failed: %s\n",
nt_errstr(status)));
@@ -64,18 +76,6 @@ static NTSTATUS netlogond_validate(TALLOC_CTX *mem_ctx,
return status;
}
- /*
- * We have to fake a struct dcinfo, so that
- * rpccli_netlogon_sam_network_logon_ex can decrypt the session keys.
- */
-
- p->dc = netlogon_creds_client_init_session_key(p, schannel_key);
- if (p->dc == NULL) {
- DEBUG(0, ("talloc failed\n"));
- TALLOC_FREE(p);
- return NT_STATUS_NO_MEMORY;
- }
-
status = rpccli_netlogon_sam_network_logon_ex(
p, p,
user_info->logon_parameters,/* flags such as 'allow