auth/ntlmssp: Remove gensec_security element from gensec_ntlmssp_state
authorAndrew Bartlett <abartlet@samba.org>
Fri, 9 Mar 2012 03:28:46 +0000 (14:28 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 9 Mar 2012 03:31:24 +0000 (14:31 +1100)
This just means there is one less pointer to ensure we initialise.

Andrew Bartlett

auth/ntlmssp/gensec_ntlmssp.c
auth/ntlmssp/ntlmssp.c
auth/ntlmssp/ntlmssp_private.h
auth/ntlmssp/ntlmssp_server.c
source3/libsmb/ntlmssp_wrap.c

index 9cbd6e1..9e1d8a8 100644 (file)
@@ -114,8 +114,6 @@ NTSTATUS gensec_ntlmssp_start(struct gensec_security *gensec_security)
                return NT_STATUS_NO_MEMORY;
        }
 
-       gensec_ntlmssp->gensec_security = gensec_security;
-
        gensec_security->private_data = gensec_ntlmssp;
        return NT_STATUS_OK;
 }
index ad2a312..1a2d662 100644 (file)
@@ -62,10 +62,10 @@ static const struct ntlmssp_callbacks {
 };
 
 
-static NTSTATUS gensec_ntlmssp_update_find(struct gensec_ntlmssp_context *gensec_ntlmssp,
+static NTSTATUS gensec_ntlmssp_update_find(struct gensec_security *gensec_security,
+                                          struct gensec_ntlmssp_context *gensec_ntlmssp,
                                           const DATA_BLOB input, uint32_t *idx)
 {
-       struct gensec_security *gensec_security = gensec_ntlmssp->gensec_security;
        uint32_t ntlmssp_command;
        uint32_t i;
 
@@ -156,7 +156,7 @@ NTSTATUS gensec_ntlmssp_update(struct gensec_security *gensec_security,
                out_mem_ctx = ntlmssp_state;
        }
 
-       status = gensec_ntlmssp_update_find(gensec_ntlmssp, input, &i);
+       status = gensec_ntlmssp_update_find(gensec_security, gensec_ntlmssp, input, &i);
        NT_STATUS_NOT_OK_RETURN(status);
 
        status = ntlmssp_callbacks[i].sync_fn(gensec_security, out_mem_ctx, input, out);
index cd9f9db..778d638 100644 (file)
@@ -43,7 +43,6 @@ union ntlmssp_crypt_state {
 
 struct gensec_ntlmssp_context {
        /* For GENSEC users */
-       struct gensec_security *gensec_security;
        void *server_returned_info;
 
        /* used by both client and server implementation */
index 03e3703..ecbc258 100644 (file)
@@ -426,7 +426,7 @@ static NTSTATUS ntlmssp_server_check_password(struct gensec_security *gensec_sec
                                              DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key)
 {
        struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp->ntlmssp_state;
-       struct auth4_context *auth_context = gensec_ntlmssp->gensec_security->auth_context;
+       struct auth4_context *auth_context = gensec_security->auth_context;
        NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED;
        struct auth_usersupplied_info *user_info;
 
@@ -441,7 +441,7 @@ static NTSTATUS ntlmssp_server_check_password(struct gensec_security *gensec_sec
        user_info->client.account_name = ntlmssp_state->user;
        user_info->client.domain_name = ntlmssp_state->domain;
        user_info->workstation_name = ntlmssp_state->client.netbios_name;
-       user_info->remote_host = gensec_get_remote_address(gensec_ntlmssp->gensec_security);
+       user_info->remote_host = gensec_get_remote_address(gensec_security);
 
        user_info->password_state = AUTH_PASSWORD_RESPONSE;
        user_info->password.response.lanman = ntlmssp_state->lm_resp;
index c0b1307..9ce4b12 100644 (file)
@@ -93,13 +93,13 @@ static NTSTATUS gensec_ntlmssp3_client_start(struct gensec_security *gensec_secu
                return nt_status;
        }
 
-       if (gensec_ntlmssp->gensec_security->want_features & GENSEC_FEATURE_SESSION_KEY) {
+       if (gensec_security->want_features & GENSEC_FEATURE_SESSION_KEY) {
                gensec_ntlmssp->ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
        }
-       if (gensec_ntlmssp->gensec_security->want_features & GENSEC_FEATURE_SIGN) {
+       if (gensec_security->want_features & GENSEC_FEATURE_SIGN) {
                gensec_ntlmssp->ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
        }
-       if (gensec_ntlmssp->gensec_security->want_features & GENSEC_FEATURE_SEAL) {
+       if (gensec_security->want_features & GENSEC_FEATURE_SEAL) {
                gensec_ntlmssp->ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
                gensec_ntlmssp->ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_SEAL;
        }