Skip to content

Commit 1982655

Browse files
committed
smb3: do not set NTLMSSP_VERSION flag for negotiate not auth request
The NTLMSSP_NEGOTIATE_VERSION flag only needs to be sent during the NTLMSSP NEGOTIATE (not the AUTH) request, so filter it out for NTLMSSP AUTH requests. See MS-NLMP 2.2.1.3 This fixes a problem found by the gssntlmssp server. Link: gssapi/gss-ntlmssp#95 Fixes: 52d0053 ("smb3: send NTLMSSP version information") Acked-by: Roy Shterman <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent a43f95f commit 1982655

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/smb/client/sess.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@ int build_ntlmssp_smb3_negotiate_blob(unsigned char **pbuffer,
10131013
}
10141014

10151015

1016+
/* See MS-NLMP 2.2.1.3 */
10161017
int build_ntlmssp_auth_blob(unsigned char **pbuffer,
10171018
u16 *buflen,
10181019
struct cifs_ses *ses,
@@ -1047,7 +1048,8 @@ int build_ntlmssp_auth_blob(unsigned char **pbuffer,
10471048

10481049
flags = ses->ntlmssp->server_flags | NTLMSSP_REQUEST_TARGET |
10491050
NTLMSSP_NEGOTIATE_TARGET_INFO | NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED;
1050-
1051+
/* we only send version information in ntlmssp negotiate, so do not set this flag */
1052+
flags = flags & ~NTLMSSP_NEGOTIATE_VERSION;
10511053
tmp = *pbuffer + sizeof(AUTHENTICATE_MESSAGE);
10521054
sec_blob->NegotiateFlags = cpu_to_le32(flags);
10531055

0 commit comments

Comments
 (0)