diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-12-30 14:53:08 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-03-24 17:34:55 +0100 |
commit | ca2a5693bf85ccfe5abe540e3a725945b52e8039 (patch) | |
tree | 7d4838ec54d4595f9936634dfb41a32773811b7e | |
parent | 7c42c5d8ffe87885f3ba96f1e0ba6ba69f1bab46 (diff) | |
download | samba-ca2a5693bf85ccfe5abe540e3a725945b52e8039.tar.gz samba-ca2a5693bf85ccfe5abe540e3a725945b52e8039.tar.bz2 samba-ca2a5693bf85ccfe5abe540e3a725945b52e8039.zip |
s3:ntlmssp: rename void *auth_context; into void *callback_private;
metze
Signed-off-by: Günther Deschner <gd@samba.org>
-rw-r--r-- | source3/auth/auth_ntlmssp.c | 10 | ||||
-rw-r--r-- | source3/include/ntlmssp.h | 5 | ||||
-rw-r--r-- | source3/utils/ntlm_auth.c | 12 |
3 files changed, 15 insertions, 12 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index 3431d79a3f..1609c71fff 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -32,7 +32,7 @@ static NTSTATUS auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_s uint8_t chal[8]) { AUTH_NTLMSSP_STATE *auth_ntlmssp_state = - (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; + (AUTH_NTLMSSP_STATE *)ntlmssp_state->callback_private; auth_ntlmssp_state->auth_context->get_ntlm_challenge( auth_ntlmssp_state->auth_context, chal); return NT_STATUS_OK; @@ -46,7 +46,7 @@ static NTSTATUS auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_s static bool auth_ntlmssp_may_set_challenge(const struct ntlmssp_state *ntlmssp_state) { AUTH_NTLMSSP_STATE *auth_ntlmssp_state = - (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; + (AUTH_NTLMSSP_STATE *)ntlmssp_state->callback_private; struct auth_context *auth_context = auth_ntlmssp_state->auth_context; return auth_context->challenge_may_be_modified; @@ -59,7 +59,7 @@ static bool auth_ntlmssp_may_set_challenge(const struct ntlmssp_state *ntlmssp_s static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *challenge) { AUTH_NTLMSSP_STATE *auth_ntlmssp_state = - (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; + (AUTH_NTLMSSP_STATE *)ntlmssp_state->callback_private; struct auth_context *auth_context = auth_ntlmssp_state->auth_context; SMB_ASSERT(challenge->length == 8); @@ -84,7 +84,7 @@ static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state, static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key) { AUTH_NTLMSSP_STATE *auth_ntlmssp_state = - (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; + (AUTH_NTLMSSP_STATE *)ntlmssp_state->callback_private; struct auth_usersupplied_info *user_info = NULL; NTSTATUS nt_status; bool username_was_mapped; @@ -206,7 +206,7 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state) return nt_status; } - (*auth_ntlmssp_state)->ntlmssp_state->auth_context = (*auth_ntlmssp_state); + (*auth_ntlmssp_state)->ntlmssp_state->callback_private = (*auth_ntlmssp_state); (*auth_ntlmssp_state)->ntlmssp_state->get_challenge = auth_ntlmssp_get_challenge; (*auth_ntlmssp_state)->ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge; (*auth_ntlmssp_state)->ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge; diff --git a/source3/include/ntlmssp.h b/source3/include/ntlmssp.h index 4e99340f8a..3c924dd19b 100644 --- a/source3/include/ntlmssp.h +++ b/source3/include/ntlmssp.h @@ -78,7 +78,10 @@ struct ntlmssp_state uint32_t neg_flags; /* the current state of negotiation with the NTLMSSP partner */ - void *auth_context; + /** + * Private data for the callback functions + */ + void *callback_private; /** * Callback to get the 'challenge' used for NTLM authentication. diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c index 226772eba8..3eb34a7d9a 100644 --- a/source3/utils/ntlm_auth.c +++ b/source3/utils/ntlm_auth.c @@ -589,15 +589,15 @@ static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB if (memcmp(user_sess_key, zeros, 16) != 0) { *user_session_key = data_blob_talloc(ntlmssp_state, user_sess_key, 16); } - ntlmssp_state->auth_context = talloc_strdup(ntlmssp_state, - unix_name); + ntlmssp_state->callback_private = talloc_strdup(ntlmssp_state, + unix_name); } else { DEBUG(NT_STATUS_EQUAL(nt_status, NT_STATUS_ACCESS_DENIED) ? 0 : 3, ("Login for user [%s]\\[%s]@[%s] failed due to [%s]\n", ntlmssp_state->domain, ntlmssp_state->user, ntlmssp_state->workstation, error_string ? error_string : "unknown error (NULL)")); - ntlmssp_state->auth_context = NULL; + ntlmssp_state->callback_private = NULL; } SAFE_FREE(error_string); @@ -623,7 +623,7 @@ static NTSTATUS local_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *u &lm_pw, &nt_pw, user_session_key, lm_session_key); if (NT_STATUS_IS_OK(nt_status)) { - ntlmssp_state->auth_context = talloc_asprintf(ntlmssp_state, + ntlmssp_state->callback_private = talloc_asprintf(ntlmssp_state, "%s%c%s", ntlmssp_state->domain, *lp_winbind_separator(), ntlmssp_state->user); @@ -631,7 +631,7 @@ static NTSTATUS local_pw_check(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *u DEBUG(3, ("Login for user [%s]\\[%s]@[%s] failed due to [%s]\n", ntlmssp_state->domain, ntlmssp_state->user, ntlmssp_state->workstation, nt_errstr(nt_status))); - ntlmssp_state->auth_context = NULL; + ntlmssp_state->callback_private = NULL; } return nt_status; } @@ -920,7 +920,7 @@ static void manage_squid_ntlmssp_request(struct ntlm_auth_state *state, DEBUG(10, ("NTLMSSP %s\n", nt_errstr(nt_status))); } else { x_fprintf(x_stdout, "AF %s\n", - (char *)state->ntlmssp_state->auth_context); + (char *)state->ntlmssp_state->callback_private); DEBUG(10, ("NTLMSSP OK!\n")); if(state->have_session_key) |