aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/sess.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-06-05 01:27:37 -0400
committerSteve French <sfrench@us.ibm.com>2006-06-05 01:27:37 -0400
commitf64b23ae4aef9f69d71ea41529a188acd5ab4930 (patch)
tree7c8c0b06a98523c4fee98e12e621591a3ab69042 /fs/cifs/sess.c
parent9312f6754d4b2d3ce27c21b16fb92923ce92a411 (diff)
[CIFS] NTLMv2 support part 2
Still need to fill in response structure and check that hash works Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r--fs/cifs/sess.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 1fe9461c6dca..9ce628df29b4 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -411,7 +411,11 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
411 else 411 else
412 ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); 412 ascii_ssetup_strings(&bcc_ptr, ses, nls_cp);
413 } else if (type == NTLMv2) { 413 } else if (type == NTLMv2) {
414 char * v2_sess_key = kmalloc(V2_SESS_KEY_SIZE, GFP_KERNEL); 414 char * v2_sess_key = kmalloc(sizeof(struct ntlmv2_resp),
415 GFP_KERNEL);
416
417 /* BB FIXME change all users of v2_sess_key to
418 struct ntlmv2_resp */
415 419
416 if(v2_sess_key == NULL) { 420 if(v2_sess_key == NULL) {
417 cifs_small_buf_release(smb_buf); 421 cifs_small_buf_release(smb_buf);
@@ -425,7 +429,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
425 /* cpu_to_le16(LM2_SESS_KEY_SIZE); */ 429 /* cpu_to_le16(LM2_SESS_KEY_SIZE); */
426 430
427 pSMB->req_no_secext.CaseSensitivePasswordLength = 431 pSMB->req_no_secext.CaseSensitivePasswordLength =
428 cpu_to_le16(V2_SESS_KEY_SIZE); 432 cpu_to_le16(sizeof(struct ntlmv2_resp));
429 433
430 /* calculate session key */ 434 /* calculate session key */
431 CalcNTLMv2_response(ses, v2_sess_key); 435 CalcNTLMv2_response(ses, v2_sess_key);
@@ -438,8 +442,9 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
438 442
439 /* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE); 443 /* memcpy(bcc_ptr, (char *)ntlm_session_key,LM2_SESS_KEY_SIZE);
440 bcc_ptr += LM2_SESS_KEY_SIZE; */ 444 bcc_ptr += LM2_SESS_KEY_SIZE; */
441 memcpy(bcc_ptr, (char *)v2_sess_key, V2_SESS_KEY_SIZE); 445 memcpy(bcc_ptr, (char *)v2_sess_key, sizeof(struct ntlmv2_resp));
442 bcc_ptr += V2_SESS_KEY_SIZE; 446 bcc_ptr += sizeof(struct ntlmv2_resp);
447 kfree(v2_sess_key);
443 if(ses->capabilities & CAP_UNICODE) 448 if(ses->capabilities & CAP_UNICODE)
444 unicode_ssetup_strings(&bcc_ptr, ses, nls_cp); 449 unicode_ssetup_strings(&bcc_ptr, ses, nls_cp);
445 else 450 else