aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2013-11-16 00:50:24 -0500
committerSteve French <smfrench@gmail.com>2013-11-16 00:50:24 -0500
commit0cbaa53cdd33080c1e2d67ad9295b83c7954f2b3 (patch)
tree2980f4a149b80f384ed3de6defabcd2f4974a76e /fs/cifs
parentb1d93356427be6f050dc55c86eb019d173700af6 (diff)
[CIFS] Warn if SMB3 encryption required by server
We do not support SMB3 encryption yet, warn if server responds that SMB3 encryption is mandatory. Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/smb2pdu.c2
-rw-r--r--fs/cifs/smb2pdu.h18
2 files changed, 20 insertions, 0 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index ca7f307ad97a..d65270c290a1 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -630,6 +630,8 @@ ssetup_ntlmssp_authenticate:
630 goto ssetup_exit; 630 goto ssetup_exit;
631 631
632 ses->session_flags = le16_to_cpu(rsp->SessionFlags); 632 ses->session_flags = le16_to_cpu(rsp->SessionFlags);
633 if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA)
634 cifs_dbg(VFS, "SMB3 encryption not supported yet\n");
633ssetup_exit: 635ssetup_exit:
634 free_rsp_buf(resp_buftype, rsp); 636 free_rsp_buf(resp_buftype, rsp);
635 637
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index b50a129572cd..f88320bbb477 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -122,6 +122,23 @@ struct smb2_pdu {
122 __le16 StructureSize2; /* size of wct area (varies, request specific) */ 122 __le16 StructureSize2; /* size of wct area (varies, request specific) */
123} __packed; 123} __packed;
124 124
125struct smb2_transform_hdr {
126 __be32 smb2_buf_length; /* big endian on wire */
127 /* length is only two or three bytes - with
128 one or two byte type preceding it that MBZ */
129 __u8 ProtocolId[4]; /* 0xFD 'S' 'M' 'B' */
130 __u8 Signature[16];
131 __u8 Nonce[11];
132 __u8 Reserved[5];
133 __le32 OriginalMessageSize;
134 __u16 Reserved1;
135 __le16 EncryptionAlgorithm;
136 __u64 SessionId;
137} __packed;
138
139/* Encryption Algorithms */
140#define SMB2_ENCRYPTION_AES128_CCM __constant_cpu_to_le16(0x0001)
141
125/* 142/*
126 * SMB2 flag definitions 143 * SMB2 flag definitions
127 */ 144 */
@@ -237,6 +254,7 @@ struct smb2_sess_setup_req {
237/* Currently defined SessionFlags */ 254/* Currently defined SessionFlags */
238#define SMB2_SESSION_FLAG_IS_GUEST 0x0001 255#define SMB2_SESSION_FLAG_IS_GUEST 0x0001
239#define SMB2_SESSION_FLAG_IS_NULL 0x0002 256#define SMB2_SESSION_FLAG_IS_NULL 0x0002
257#define SMB2_SESSION_FLAG_ENCRYPT_DATA 0x0004
240struct smb2_sess_setup_rsp { 258struct smb2_sess_setup_rsp {
241 struct smb2_hdr hdr; 259 struct smb2_hdr hdr;
242 __le16 StructureSize; /* Must be 9 */ 260 __le16 StructureSize; /* Must be 9 */