s3:ntlmssp: rename void *auth_context; into void *callback_private;
authorStefan Metzmacher <metze@samba.org>
Wed, 30 Dec 2009 13:53:08 +0000 (14:53 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 24 Mar 2010 16:34:55 +0000 (17:34 +0100)
metze

Signed-off-by: Günther Deschner <gd@samba.org>
source3/auth/auth_ntlmssp.c
source3/include/ntlmssp.h
source3/utils/ntlm_auth.c

index 3431d79a3f9839969b0fd43f8bdd7637d57579af..1609c71fff9a9af66c973c4d87697efb77e8bde9 100644 (file)
@@ -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;
index 4e99340f8afc2ec607c9ceb77fc1cbe903079342..3c924dd19b505ad7ccc736e999b69c89202e6bc3 100644 (file)
@@ -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.
index 226772eba8fc7a6bbe306626c9bf85e05921ca2f..3eb34a7d9a0dec3b6981e06bba4ad7222a541687 100644 (file)
@@ -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)