summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-01-31 15:57:06 +1100
committerStefan Metzmacher <metze@samba.org>2012-02-17 10:48:09 +0100
commit8b8d1c3a63e336d3d872bb3ea10331e5496a82e9 (patch)
treec3a3fa0cf0b07207063b45e3a57561548bb83809
parent93fed62543ae6cee5ec26fda532c4ed8a650f74f (diff)
downloadsamba-8b8d1c3a63e336d3d872bb3ea10331e5496a82e9.tar.gz
samba-8b8d1c3a63e336d3d872bb3ea10331e5496a82e9.tar.bz2
samba-8b8d1c3a63e336d3d872bb3ea10331e5496a82e9.zip
auth: Rearrange ntlmssp code for clarity
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--auth/ntlmssp/gensec_ntlmssp_server.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/auth/ntlmssp/gensec_ntlmssp_server.c b/auth/ntlmssp/gensec_ntlmssp_server.c
index bb70826905..1f1f5b3f7b 100644
--- a/auth/ntlmssp/gensec_ntlmssp_server.c
+++ b/auth/ntlmssp/gensec_ntlmssp_server.c
@@ -279,26 +279,24 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
if (!ntlmssp_state) {
return NT_STATUS_NO_MEMORY;
}
-
- ntlmssp_state->callback_private = gensec_ntlmssp;
-
gensec_ntlmssp->ntlmssp_state = ntlmssp_state;
- ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
+ ntlmssp_state->callback_private = gensec_ntlmssp;
ntlmssp_state->role = NTLMSSP_SERVER;
ntlmssp_state->expected_state = NTLMSSP_NEGOTIATE;
- ntlmssp_state->allow_lm_key = (lpcfg_lanman_auth(gensec_security->settings->lp_ctx)
- && gensec_setting_bool(gensec_security->settings, "ntlmssp_server", "allow_lm_key", false));
+ if (lpcfg_lanman_auth(gensec_security->settings->lp_ctx) &&
+ gensec_setting_bool(gensec_security->settings,
+ "ntlmssp_server", "allow_lm_key", false))
+ {
+ ntlmssp_state->allow_lm_key = true;
+ }
ntlmssp_state->neg_flags =
NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_VERSION;
- ntlmssp_state->lm_resp = data_blob(NULL, 0);
- ntlmssp_state->nt_resp = data_blob(NULL, 0);
-
if (gensec_setting_bool(gensec_security->settings, "ntlmssp_server", "128bit", true)) {
ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_128;
}
@@ -334,6 +332,7 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
ntlmssp_state->check_password = auth_ntlmssp_check_password;
+
if (lpcfg_server_role(gensec_security->settings->lp_ctx) == ROLE_STANDALONE) {
ntlmssp_state->server.is_standalone = true;
} else {