diff options
author | Shirish Pargaonkar <shirishpargaonkar@gmail.com> | 2010-10-04 20:56:13 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-10-06 12:13:19 -0400 |
commit | c9928f7040a6e5f39e028bea500e0fde910d4a96 (patch) | |
tree | 4a6b35fffc8b9b424e95073e8979e8ee406c9a4d /fs/cifs/sess.c | |
parent | 29e07c82a9e8acebbb38ecc22b0b5005a0a5d839 (diff) |
ntlm authentication and signing - Correct response length for ntlmv2 authentication without extended security
Fix incorrect calculation of case sensitive response length in the
ntlmv2 (without extended security) response.
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r-- | fs/cifs/sess.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index af18a500f7e0..c926e6c7c0c6 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
@@ -739,9 +739,6 @@ ssetup_ntlmssp_authenticate: | |||
739 | pSMB->req_no_secext.CaseInsensitivePasswordLength = 0; | 739 | pSMB->req_no_secext.CaseInsensitivePasswordLength = 0; |
740 | /* cpu_to_le16(LM2_SESS_KEY_SIZE); */ | 740 | /* cpu_to_le16(LM2_SESS_KEY_SIZE); */ |
741 | 741 | ||
742 | pSMB->req_no_secext.CaseSensitivePasswordLength = | ||
743 | cpu_to_le16(sizeof(struct ntlmv2_resp)); | ||
744 | |||
745 | /* calculate session key */ | 742 | /* calculate session key */ |
746 | rc = setup_ntlmv2_rsp(ses, v2_sess_key, nls_cp); | 743 | rc = setup_ntlmv2_rsp(ses, v2_sess_key, nls_cp); |
747 | if (rc) { | 744 | if (rc) { |
@@ -753,6 +750,11 @@ ssetup_ntlmssp_authenticate: | |||
753 | sizeof(struct ntlmv2_resp)); | 750 | sizeof(struct ntlmv2_resp)); |
754 | bcc_ptr += sizeof(struct ntlmv2_resp); | 751 | bcc_ptr += sizeof(struct ntlmv2_resp); |
755 | kfree(v2_sess_key); | 752 | kfree(v2_sess_key); |
753 | /* set case sensitive password length after tilen may get | ||
754 | * assigned, tilen is 0 otherwise. | ||
755 | */ | ||
756 | pSMB->req_no_secext.CaseSensitivePasswordLength = | ||
757 | cpu_to_le16(sizeof(struct ntlmv2_resp) + ses->tilen); | ||
756 | if (ses->tilen > 0) { | 758 | if (ses->tilen > 0) { |
757 | memcpy(bcc_ptr, ses->tiblob, ses->tilen); | 759 | memcpy(bcc_ptr, ses->tiblob, ses->tilen); |
758 | bcc_ptr += ses->tilen; | 760 | bcc_ptr += ses->tilen; |
@@ -761,6 +763,7 @@ ssetup_ntlmssp_authenticate: | |||
761 | ses->tiblob = NULL; | 763 | ses->tiblob = NULL; |
762 | ses->tilen = 0; | 764 | ses->tilen = 0; |
763 | } | 765 | } |
766 | |||
764 | if (ses->capabilities & CAP_UNICODE) { | 767 | if (ses->capabilities & CAP_UNICODE) { |
765 | if (iov[0].iov_len % 2) { | 768 | if (iov[0].iov_len % 2) { |
766 | *bcc_ptr = 0; | 769 | *bcc_ptr = 0; |