diff options
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r-- | fs/cifs/sess.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index e0515a62715d..f74c5a88dd4c 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
@@ -399,7 +399,7 @@ static int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, | |||
399 | return -EINVAL; | 399 | return -EINVAL; |
400 | } | 400 | } |
401 | 401 | ||
402 | memcpy(ses->cryptKey, pblob->Challenge, CIFS_CRYPTO_KEY_SIZE); | 402 | memcpy(ses->cryptkey, pblob->Challenge, CIFS_CRYPTO_KEY_SIZE); |
403 | /* BB we could decode pblob->NegotiateFlags; some may be useful */ | 403 | /* BB we could decode pblob->NegotiateFlags; some may be useful */ |
404 | /* In particular we can examine sign flags */ | 404 | /* In particular we can examine sign flags */ |
405 | /* BB spec says that if AvId field of MsvAvTimestamp is populated then | 405 | /* BB spec says that if AvId field of MsvAvTimestamp is populated then |
@@ -667,10 +667,14 @@ ssetup_ntlmssp_authenticate: | |||
667 | /* no capabilities flags in old lanman negotiation */ | 667 | /* no capabilities flags in old lanman negotiation */ |
668 | 668 | ||
669 | pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE); | 669 | pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE); |
670 | /* BB calculate hash with password */ | ||
671 | /* and copy into bcc */ | ||
672 | 670 | ||
673 | calc_lanman_hash(ses->password, ses->cryptKey, | 671 | /* Calculate hash with password and copy into bcc_ptr. |
672 | * Encryption Key (stored as in cryptkey) gets used if the | ||
673 | * security mode bit in Negottiate Protocol response states | ||
674 | * to use challenge/response method (i.e. Password bit is 1). | ||
675 | */ | ||
676 | |||
677 | calc_lanman_hash(ses->password, ses->server->cryptkey, | ||
674 | ses->server->secMode & SECMODE_PW_ENCRYPT ? | 678 | ses->server->secMode & SECMODE_PW_ENCRYPT ? |
675 | true : false, lnm_session_key); | 679 | true : false, lnm_session_key); |
676 | 680 | ||