Commit 8a224d489454b7457105848610cfebebdec5638d

Authored by Jeff Layton
1 parent 47c78b7f40

cifs: remove bogus first_time check in NTLMv2 session setup code

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>

Showing 1 changed file with 1 additions and 9 deletions Side-by-side Diff

... ... @@ -730,15 +730,7 @@
730 730  
731 731 /* calculate session key */
732 732 setup_ntlmv2_rsp(ses, v2_sess_key, nls_cp);
733   - if (first_time) /* should this be moved into common code
734   - with similar ntlmv2 path? */
735   - /* cifs_calculate_ntlmv2_mac_key(ses->server->mac_signing_key,
736   - response BB FIXME, v2_sess_key); */
737   -
738   - /* copy session key */
739   -
740   - /* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE);
741   - bcc_ptr += LM2_SESS_KEY_SIZE; */
  733 + /* FIXME: calculate MAC key */
742 734 memcpy(bcc_ptr, (char *)v2_sess_key,
743 735 sizeof(struct ntlmv2_resp));
744 736 bcc_ptr += sizeof(struct ntlmv2_resp);