]> git.hungrycats.org Git - linux/commitdiff
client MUST ignore EncryptionKeyLength if CAP_EXTENDED_SECURITY is set
authorNoel Power <noel.power@suse.com>
Wed, 27 May 2015 08:22:10 +0000 (09:22 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Thu, 3 Dec 2015 03:58:41 +0000 (22:58 -0500)
[ Upstream commit f291095f340db986271e951e3891bb95624a93ea ]

[MS-SMB] 2.2.4.5.2.1 states:

"ChallengeLength (1 byte): When the CAP_EXTENDED_SECURITY bit is set,
 the server MUST set this value to zero and clients MUST ignore this
 value."

Signed-off-by: Noel Power <noel.power@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
fs/cifs/cifssmb.c

index 61d00a6e398fe5ed30160e2eba02df49876281ed..4ae04561be88ee0dcea2b13cb8b4b8ad647a4abb 100644 (file)
@@ -625,9 +625,8 @@ CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
                server->negflavor = CIFS_NEGFLAVOR_UNENCAP;
                memcpy(ses->server->cryptkey, pSMBr->u.EncryptionKey,
                       CIFS_CRYPTO_KEY_SIZE);
-       } else if ((pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC ||
-                       server->capabilities & CAP_EXTENDED_SECURITY) &&
-                               (pSMBr->EncryptionKeyLength == 0)) {
+       } else if (pSMBr->hdr.Flags2 & SMBFLG2_EXT_SEC ||
+                       server->capabilities & CAP_EXTENDED_SECURITY) {
                server->negflavor = CIFS_NEGFLAVOR_EXTENDED;
                rc = decode_ext_sec_blob(ses, pSMBr);
        } else if (server->sec_mode & SECMODE_PW_ENCRYPT) {