From patchwork Sat Nov 16 05:52:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 3192231 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2F1E49F432 for ; Sat, 16 Nov 2013 05:52:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B05A208F4 for ; Sat, 16 Nov 2013 05:52:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74592208EF for ; Sat, 16 Nov 2013 05:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751195Ab3KPFwm (ORCPT ); Sat, 16 Nov 2013 00:52:42 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:61763 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172Ab3KPFwl (ORCPT ); Sat, 16 Nov 2013 00:52:41 -0500 Received: by mail-pd0-f175.google.com with SMTP id w10so2256194pde.20 for ; Fri, 15 Nov 2013 21:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=Yznb+E9LpzKJieovuzkLczox1EtJvjismV3wlTfY11k=; b=xAlHFeZcAOKGMDYC04Aq00AFUyvWWf4vx8jDlNK+7MTRMuQTvFxNU/rNw0QdtXHj+z K8nXQn6wr/Vkb70RXbtTX6QRMy7iXe0iH9fynbZrRIZs+C2jM7xFEDdFAYq5GXePl2Pj ++PYZbvL8cmQJr2fMRLHUDcgA8lkU0riPQKWWeRc7Bh7h1B/FFlBwHmWDwW/Y2wImr7R 9iZVXV502dovxxagnC4/SZ9ElAboAVryks4vD7kPwqA7D+n5/r0N9kQj16D9pMtQzfgd lF0XSNhtiO6fjmZOi7iIKQtSxl9DjWMOshLmbbs4632CRfJixrb9O1h1cPg6v7Pb+tvz XJDQ== MIME-Version: 1.0 X-Received: by 10.68.130.39 with SMTP id ob7mr2739838pbb.63.1384581160971; Fri, 15 Nov 2013 21:52:40 -0800 (PST) Received: by 10.68.143.10 with HTTP; Fri, 15 Nov 2013 21:52:40 -0800 (PST) Date: Fri, 15 Nov 2013 23:52:40 -0600 Message-ID: Subject: [CIFS][PATCH] Warn if per-share encryption requested From: Steve French To: "linux-cifs@vger.kernel.org" , David Disseldorp Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From 0cbaa53cdd33080c1e2d67ad9295b83c7954f2b3 Mon Sep 17 00:00:00 2001 From: Steve French Date: Fri, 15 Nov 2013 23:50:24 -0600 Subject: [PATCH] [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 --- fs/cifs/smb2pdu.c | 2 ++ fs/cifs/smb2pdu.h | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index ca7f307..d65270c 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -630,6 +630,8 @@ ssetup_ntlmssp_authenticate: goto ssetup_exit; ses->session_flags = le16_to_cpu(rsp->SessionFlags); + if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) + cifs_dbg(VFS, "SMB3 encryption not supported yet\n"); ssetup_exit: free_rsp_buf(resp_buftype, rsp); diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index b50a129..f88320b 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -122,6 +122,23 @@ struct smb2_pdu { __le16 StructureSize2; /* size of wct area (varies, request specific) */ } __packed; +struct smb2_transform_hdr { + __be32 smb2_buf_length; /* big endian on wire */ + /* length is only two or three bytes - with + one or two byte type preceding it that MBZ */ + __u8 ProtocolId[4]; /* 0xFD 'S' 'M' 'B' */ + __u8 Signature[16]; + __u8 Nonce[11]; + __u8 Reserved[5]; + __le32 OriginalMessageSize; + __u16 Reserved1; + __le16 EncryptionAlgorithm; + __u64 SessionId; +} __packed; + +/* Encryption Algorithms */ +#define SMB2_ENCRYPTION_AES128_CCM __constant_cpu_to_le16(0x0001) + /* * SMB2 flag definitions */ @@ -237,6 +254,7 @@ struct smb2_sess_setup_req { /* Currently defined SessionFlags */ #define SMB2_SESSION_FLAG_IS_GUEST 0x0001 #define SMB2_SESSION_FLAG_IS_NULL 0x0002 +#define SMB2_SESSION_FLAG_ENCRYPT_DATA 0x0004 struct smb2_sess_setup_rsp { struct smb2_hdr hdr; __le16 StructureSize; /* Must be 9 */