auth: Rename some elements of auth4_context
authorAndrew Bartlett <abartlet@samba.org>
Fri, 3 Feb 2012 05:33:44 +0000 (16:33 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 24 Feb 2012 00:23:18 +0000 (11:23 +1100)
These operate on NTLM authentication, so make that clear.

Andrew Bartlett

auth/common_auth.h
auth/ntlmssp/gensec_ntlmssp_server.c
source3/auth/auth_generic.c
source4/auth/ntlm/auth.c

index c0fd6b6..cf21543 100644 (file)
@@ -105,17 +105,17 @@ struct auth4_context {
        /* Private data for the callbacks on this auth context */
        void *private_data;
 
-       NTSTATUS (*check_password)(struct auth4_context *auth_ctx,
-                                  TALLOC_CTX *mem_ctx,
-                                  const struct auth_usersupplied_info *user_info,
-                                  void **server_returned_info,
-                                  DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key);
+       NTSTATUS (*check_ntlm_password)(struct auth4_context *auth_ctx,
+                                       TALLOC_CTX *mem_ctx,
+                                       const struct auth_usersupplied_info *user_info,
+                                       void **server_returned_info,
+                                       DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key);
 
-       NTSTATUS (*get_challenge)(struct auth4_context *auth_ctx, uint8_t chal[8]);
+       NTSTATUS (*get_ntlm_challenge)(struct auth4_context *auth_ctx, uint8_t chal[8]);
 
        bool (*challenge_may_be_modified)(struct auth4_context *auth_ctx);
 
-       NTSTATUS (*set_challenge)(struct auth4_context *auth_ctx, const uint8_t chal[8], const char *set_by);
+       NTSTATUS (*set_ntlm_challenge)(struct auth4_context *auth_ctx, const uint8_t chal[8], const char *set_by);
 
        NTSTATUS (*generate_session_info)(struct auth4_context *auth_context,
                                          TALLOC_CTX *mem_ctx,
index a1d43e6..ba32a2b 100644 (file)
@@ -90,8 +90,8 @@ static NTSTATUS auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_s
        struct auth4_context *auth_context = gensec_ntlmssp->gensec_security->auth_context;
        NTSTATUS status = NT_STATUS_NOT_IMPLEMENTED;
 
-       if (auth_context->get_challenge) {
-               status = auth_context->get_challenge(auth_context, chal);
+       if (auth_context->get_ntlm_challenge) {
+               status = auth_context->get_ntlm_challenge(auth_context, chal);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1, ("auth_ntlmssp_get_challenge: failed to get challenge: %s\n",
                                  nt_errstr(status)));
@@ -139,8 +139,8 @@ static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state,
 
        chal = challenge->data;
 
-       if (auth_context->set_challenge) {
-               nt_status = auth_context->set_challenge(auth_context,
+       if (auth_context->set_ntlm_challenge) {
+               nt_status = auth_context->set_ntlm_challenge(auth_context,
                                                        chal,
                                                        "NTLMSSP callback (NTLM2)");
        }
@@ -183,12 +183,12 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state,
        user_info->password.response.nt = ntlmssp_state->nt_resp;
        user_info->password.response.nt.data = talloc_steal(user_info, ntlmssp_state->nt_resp.data);
 
-       if (auth_context->check_password) {
-               nt_status = auth_context->check_password(auth_context,
-                                                        gensec_ntlmssp,
-                                                        user_info,
-                                                        &gensec_ntlmssp->server_returned_info,
-                                                        user_session_key, lm_session_key);
+       if (auth_context->check_ntlm_password) {
+               nt_status = auth_context->check_ntlm_password(auth_context,
+                                                             gensec_ntlmssp,
+                                                             user_info,
+                                                             &gensec_ntlmssp->server_returned_info,
+                                                             user_session_key, lm_session_key);
        }
        talloc_free(user_info);
 
index 681989e..cf6866c 100644 (file)
@@ -163,10 +163,10 @@ static struct auth4_context *make_auth4_context_s3(TALLOC_CTX *mem_ctx, struct a
        }
        auth4_context->generate_session_info_pac = auth3_generate_session_info_pac;
        auth4_context->generate_session_info = auth3_generate_session_info;
-       auth4_context->get_challenge = auth3_get_challenge;
-       auth4_context->set_challenge = auth3_set_challenge;
+       auth4_context->get_ntlm_challenge = auth3_get_challenge;
+       auth4_context->set_ntlm_challenge = auth3_set_challenge;
        auth4_context->challenge_may_be_modified = auth3_may_set_challenge;
-       auth4_context->check_password = auth3_check_password;
+       auth4_context->check_ntlm_password = auth3_check_password;
        auth4_context->private_data = talloc_steal(auth4_context, auth_context);
        return auth4_context;
 }
index 5c65da9..58a12fb 100644 (file)
@@ -605,9 +605,9 @@ _PUBLIC_ NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **
                DLIST_ADD_END(ctx->methods, method, struct auth_method_context *);
        }
 
-       ctx->check_password = auth_check_password_wrapper;
-       ctx->get_challenge = auth_get_challenge;
-       ctx->set_challenge = auth_context_set_challenge;
+       ctx->check_ntlm_password = auth_check_password_wrapper;
+       ctx->get_ntlm_challenge = auth_get_challenge;
+       ctx->set_ntlm_challenge = auth_context_set_challenge;
        ctx->challenge_may_be_modified = auth_challenge_may_be_modified;
        ctx->generate_session_info = auth_generate_session_info_wrapper;
        ctx->generate_session_info_pac = auth_generate_session_info_pac;