diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-07-22 04:10:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:29:55 -0500 |
commit | b16362fab65d0700bd6a8cf6569a9e21c7e6b069 (patch) | |
tree | cd68807d497dac925038d03c3786308825b02e10 /source4/auth/ntlmssp | |
parent | 176c0d1b771d0e81167a12eb81eddb40732b074a (diff) | |
download | samba-b16362fab65d0700bd6a8cf6569a9e21c7e6b069.tar.gz samba-b16362fab65d0700bd6a8cf6569a9e21c7e6b069.tar.bz2 samba-b16362fab65d0700bd6a8cf6569a9e21c7e6b069.zip |
r8700: Propmted by tridge's need to do plaintext auth in ejs, rework the
user_info strcture in auth/
This moves it to a pattern much like that found in ntvfs, with
functions to migrate between PAIN, HASH and RESPONSE passwords.
Instead of make_user_info*() functions, we simply fill in the control
block in the callers, per recent dicussions on the lists. This
removed a lot of data copies as well as error paths, as we can grab
much of it with talloc.
Andrew Bartlett
(This used to be commit ecbd2235a3e2be937440fa1dc0aecc5a047eda88)
Diffstat (limited to 'source4/auth/ntlmssp')
-rw-r--r-- | source4/auth/ntlmssp/ntlmssp_server.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c index 5885db8dec..90f567be2b 100644 --- a/source4/auth/ntlmssp/ntlmssp_server.c +++ b/source4/auth/ntlmssp/ntlmssp_server.c @@ -686,18 +686,23 @@ static NTSTATUS auth_ntlmssp_set_challenge(struct gensec_ntlmssp_state *gensec_n static NTSTATUS auth_ntlmssp_check_password(struct gensec_ntlmssp_state *gensec_ntlmssp_state, DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key) { - struct auth_usersupplied_info *user_info = NULL; NTSTATUS nt_status; + struct auth_usersupplied_info *user_info = talloc(gensec_ntlmssp_state, struct auth_usersupplied_info); + if (!user_info) { + return NT_STATUS_NO_MEMORY; + } - nt_status = make_user_info_map(gensec_ntlmssp_state, - gensec_ntlmssp_state->user, - gensec_ntlmssp_state->domain, - gensec_ntlmssp_state->workstation, - gensec_ntlmssp_state->lm_resp.data ? &gensec_ntlmssp_state->lm_resp : NULL, - gensec_ntlmssp_state->nt_resp.data ? &gensec_ntlmssp_state->nt_resp : NULL, - NULL, NULL, NULL, True, - &user_info); - NT_STATUS_NOT_OK_RETURN(nt_status); + user_info->flags = 0; + user_info->mapped_state = False; + user_info->client.account_name = gensec_ntlmssp_state->user; + user_info->client.domain_name = gensec_ntlmssp_state->domain; + user_info->workstation_name = gensec_ntlmssp_state->workstation; + + user_info->password_state = AUTH_PASSWORD_RESPONSE; + user_info->password.response.lanman = gensec_ntlmssp_state->lm_resp; + user_info->password.response.lanman.data = talloc_steal(user_info, gensec_ntlmssp_state->lm_resp.data); + user_info->password.response.nt = gensec_ntlmssp_state->nt_resp; + user_info->password.response.nt.data = talloc_steal(user_info, gensec_ntlmssp_state->nt_resp.data); nt_status = auth_check_password(gensec_ntlmssp_state->auth_context, gensec_ntlmssp_state, user_info, &gensec_ntlmssp_state->server_info); |