r10598: Factor out common code, in preperation for a move elsewhere.
authorAndrew Bartlett <abartlet@samba.org>
Thu, 29 Sep 2005 00:28:46 +0000 (00:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:10 +0000 (13:39 -0500)
Andrew Bartlett
(This used to be commit 0d757b169a3d521a0d228bed51aa96cf199d5c42)

source4/libcli/smb_composite/sesssetup.c

index 2ca862fb2f0e8194cc6e9de82506f00da9427d39..700e4ef7449df88c87cec53e126f5d507bf02b01 100644 (file)
@@ -199,15 +199,10 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
                                return NT_STATUS_NO_MEMORY;
                        }
                        data_blob_free(&names_blob);
+                       data_blob_free(&lmv2_session_key);
                        state->setup.nt1.in.password1 = lmv2_response;
                        state->setup.nt1.in.password2 = ntlmv2_response;
                        
-                       smbcli_transport_simple_set_signing(session->transport, session_key, 
-                                                           state->setup.nt1.in.password2);
-                       set_user_session_key(session, &session_key);
-                       
-                       data_blob_free(&lmv2_session_key);
-                       data_blob_free(&session_key);
                } else {
 
                        state->setup.nt1.in.password2 = nt_blob(state, nt_hash,
@@ -222,13 +217,14 @@ static NTSTATUS session_setup_nt1(struct composite_context *c,
 
                        session_key = data_blob_talloc(session, NULL, 16);
                        SMBsesskeygen_ntv1(nt_hash->hash, session_key.data);
-                       smbcli_transport_simple_set_signing(session->transport, session_key, 
-                                                           state->setup.nt1.in.password2);
-                       set_user_session_key(session, &session_key);
-                       
-                       data_blob_free(&session_key);
                }
 
+               smbcli_transport_simple_set_signing(session->transport, session_key, 
+                                                   state->setup.nt1.in.password2);
+               set_user_session_key(session, &session_key);
+               
+               data_blob_free(&session_key);
+
        } else if (lp_client_plaintext_auth()) {
                state->setup.nt1.in.password1 = data_blob_talloc(state, password, strlen(password));
                state->setup.nt1.in.password2 = data_blob(NULL, 0);