Skip to content

Commit

Permalink
cifs: remove bogus first_time check in NTLMv2 session setup code
Browse files Browse the repository at this point in the history
This bug appears to be the result of a cut-and-paste mistake from the
NTLMv1 code. The function to generate the MAC key was commented out, but
not the conditional above it. The conditional then ended up causing the
session setup key not to be copied to the buffer unless this was the
first session on the socket, and that made all but the first NTLMv2
session setup fail.

Fix this by removing the conditional and all of the commented clutter
that made it difficult to see.

Cc: Stable <stable@kernel.org>
Reported-by: Gunther Deschner <gdeschne@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
  • Loading branch information
Jeff Layton committed Jun 16, 2010
1 parent 47c78b7 commit 8a224d4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions fs/cifs/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,15 +730,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses,

/* calculate session key */
setup_ntlmv2_rsp(ses, v2_sess_key, nls_cp);
if (first_time) /* should this be moved into common code
with similar ntlmv2 path? */
/* cifs_calculate_ntlmv2_mac_key(ses->server->mac_signing_key,
response BB FIXME, v2_sess_key); */

/* copy session key */

/* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE);
bcc_ptr += LM2_SESS_KEY_SIZE; */
/* FIXME: calculate MAC key */
memcpy(bcc_ptr, (char *)v2_sess_key,
sizeof(struct ntlmv2_resp));
bcc_ptr += sizeof(struct ntlmv2_resp);
Expand Down

0 comments on commit 8a224d4

Please sign in to comment.