s3:ntlmssp Don't use the lm key if the user didn't supply one.
authorAndrew Bartlett <abartlet@samba.org>
Fri, 6 Aug 2010 09:01:34 +0000 (19:01 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 9 Aug 2010 06:30:42 +0000 (16:30 +1000)
This may help to avoid a number of possible MITM attacks where LM_KEY is
spoofed into the session.  If the login wasn't with lanman
(and so the user chose to disclose their lanman response),
don't disclose back anything based on their lanman password.

Andrew Bartlett

source3/libsmb/ntlmssp.c

index 601e7c1c86b0877920b26162ae8526c2d6e21938..440511a6446f89aff9498a986b03781532dbc419 100644 (file)
@@ -635,9 +635,9 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
                                if (session_key.data == NULL) {
                                        return NT_STATUS_NO_MEMORY;
                                }
-                               SMBsesskeygen_lm_sess_key(
-                                       lm_session_key.data, zeros,
-                                       session_key.data);
+                               SMBsesskeygen_lm_sess_key(zeros, zeros, 
+                                                         session_key.data);
+                               DEBUG(10,("ntlmssp_server_auth: Created NTLM session key.\n"));
                        }
                        dump_data_pw("LM session key:\n", session_key.data,
                                     session_key.length);