Skip to content

Commit

Permalink
cifs: Fix regression in LANMAN (LM) auth code
Browse files Browse the repository at this point in the history
LANMAN response length was changed to 16 bytes instead of 24 bytes.
Revert it back to 24 bytes.

Signed-off-by: Shirish Pargaonkar <[email protected]>
CC: [email protected]
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
shirishpargaonkar authored and Steve French committed Feb 21, 2011
1 parent 9616125 commit 5e64092
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/cifs/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,13 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses,

if (type == LANMAN) {
#ifdef CONFIG_CIFS_WEAK_PW_HASH
char lnm_session_key[CIFS_SESS_KEY_SIZE];
char lnm_session_key[CIFS_AUTH_RESP_SIZE];

pSMB->req.hdr.Flags2 &= ~SMBFLG2_UNICODE;

/* no capabilities flags in old lanman negotiation */

pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_SESS_KEY_SIZE);
pSMB->old_req.PasswordLength = cpu_to_le16(CIFS_AUTH_RESP_SIZE);

/* Calculate hash with password and copy into bcc_ptr.
* Encryption Key (stored as in cryptkey) gets used if the
Expand All @@ -675,8 +675,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses,
true : false, lnm_session_key);

ses->flags |= CIFS_SES_LANMAN;
memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_SESS_KEY_SIZE);
bcc_ptr += CIFS_SESS_KEY_SIZE;
memcpy(bcc_ptr, (char *)lnm_session_key, CIFS_AUTH_RESP_SIZE);
bcc_ptr += CIFS_AUTH_RESP_SIZE;

/* can not sign if LANMAN negotiated so no need
to calculate signing key? but what if server
Expand Down

0 comments on commit 5e64092

Please sign in to comment.