s4:ntlmssp: move doing_ntlm2 to ntlmssp_server_auth_state
authorStefan Metzmacher <metze@samba.org>
Wed, 6 Jan 2010 13:53:30 +0000 (14:53 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 24 Mar 2010 16:34:52 +0000 (17:34 +0100)
metze

Signed-off-by: Günther Deschner <gd@samba.org>
source4/auth/ntlmssp/ntlmssp.h
source4/auth/ntlmssp/ntlmssp_server.c

index a47a71b66ee22be02b186f72ef345a948059bb45..9e41d776646c868623d494f7dcc879c0f35c2f98 100644 (file)
@@ -127,8 +127,6 @@ struct ntlmssp_state
         */
        NTSTATUS (*check_password)(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key);
 
-       bool doing_ntlm2;
-
        union {
                /* NTLM */
                struct {
index 30077010bcc52bfd66820a374b4e9002e1684a0b..fc7d6d78038665b222fcd503a1fb433d4d457ded 100644 (file)
@@ -225,6 +225,7 @@ struct ntlmssp_server_auth_state {
        DATA_BLOB lm_session_key;
        /* internal variables used by KEY_EXCH (client-supplied user session key */
        DATA_BLOB encrypted_session_key;
+       bool doing_ntlm2;
        /* internal variables used by NTLM2 */
        uint8_t session_nonce[16];
 };
@@ -349,7 +350,7 @@ static NTSTATUS ntlmssp_server_preauth(struct ntlmssp_state *ntlmssp_state,
                        SMB_ASSERT(ntlmssp_state->internal_chal.data
                                   && ntlmssp_state->internal_chal.length == 8);
                        
-                       ntlmssp_state->doing_ntlm2 = true;
+                       state->doing_ntlm2 = true;
 
                        memcpy(state->session_nonce, ntlmssp_state->internal_chal.data, 8);
                        memcpy(&state->session_nonce[8], ntlmssp_state->lm_resp.data, 8);
@@ -410,7 +411,7 @@ static NTSTATUS ntlmssp_server_postauth(struct gensec_security *gensec_security,
                dump_data_pw("LM first-8:\n", lm_session_key->data, lm_session_key->length);
 
        /* Handle the different session key derivation for NTLM2 */
-       if (ntlmssp_state->doing_ntlm2) {
+       if (state->doing_ntlm2) {
                if (user_session_key && user_session_key->data && user_session_key->length == 16) {
                        session_key = data_blob_talloc(ntlmssp_state, NULL, 16);
                        hmac_md5(user_session_key->data, state->session_nonce,