summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2015-07-01 18:07:26 +0200
committerKarolin Seeger <kseeger@samba.org>2015-07-19 20:13:10 +0200
commit2cad86cbece6a7a09755dee1e9008d0c89b342ba (patch)
tree000571e3734ef913af4443086813d97544ae4fc7
parent3ed2fbe74351ff13da935af355e87c28f4992415 (diff)
downloadsamba-2cad86cbece6a7a09755dee1e9008d0c89b342ba.tar.gz
smbd:smb2: only enable encryption in session if desired
Don't enforce it but only announce ENCRYPT_DATA, using the encryption_desired flag in session setup. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11372 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit fc228025d78f165815d3fa1670d51f0c27ed2091)
-rw-r--r--source3/smbd/smb2_sesssetup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index e7fc403c9be..bf40ab49157 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -190,12 +190,13 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
x->global->signing_required = true;
}
- if ((lp_smb_encrypt(-1) > SMB_SIGNING_OFF) &&
+ if ((lp_smb_encrypt(-1) >= SMB_SIGNING_DESIRED) &&
(conn->smb2.client.capabilities & SMB2_CAP_ENCRYPTION)) {
- x->global->encryption_required = true;
+ x->encryption_desired = true;
}
if (lp_smb_encrypt(-1) == SMB_SIGNING_REQUIRED) {
+ x->encryption_desired = true;
x->global->encryption_required = true;
}
@@ -222,7 +223,7 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
}
}
- if (x->global->encryption_required) {
+ if (x->encryption_desired) {
*out_session_flags |= SMB2_SESSION_FLAG_ENCRYPT_DATA;
}