smbd: Make SMB3 clients use encryption with "smb encrypt = auto"
authorVolker Lendecke <vl@samba.org>
Wed, 25 Feb 2015 15:59:26 +0000 (16:59 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 3 Mar 2015 09:40:42 +0000 (10:40 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar  3 10:40:42 CET 2015 on sn-devel-104

source3/smbd/smb2_sesssetup.c
source3/smbd/smb2_tcon.c

index 2f58e44f55a0a86b8c9da2269a8525dc250f3e5c..fb7edce38ce2fde9e16ae4a12a227c70762b02b6 100644 (file)
@@ -190,6 +190,11 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
                x->global->signing_required = true;
        }
 
+       if ((lp_smb_encrypt(-1) > SMB_SIGNING_OFF) &&
+           (xconn->smb2.client.capabilities & SMB2_CAP_ENCRYPTION)) {
+               x->global->encryption_required = true;
+       }
+
        if (lp_smb_encrypt(-1) == SMB_SIGNING_REQUIRED) {
                x->global->encryption_required = true;
        }
index bf33fcbf723a526765b7d39e77e667744c4ad613..cf085a52587c051bb09a7b1f59da3be70d7a34cc 100644 (file)
@@ -235,6 +235,11 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
                return NT_STATUS_BAD_NETWORK_NAME;
        }
 
+       if ((lp_smb_encrypt(snum) > SMB_SIGNING_OFF) &&
+           (conn->smb2.client.capabilities & SMB2_CAP_ENCRYPTION)) {
+               encryption_required = true;
+       }
+
        if (lp_smb_encrypt(snum) == SMB_SIGNING_REQUIRED) {
                encryption_required = true;
        }