summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-07-25 12:34:20 +0200
committerStefan Metzmacher <metze@samba.org>2012-07-25 16:44:22 +0200
commit5c3a0cbae0eee6c2c35e2de037380546fc22dd9c (patch)
tree75cd1323d564d0083eb4163b93e426e9a3181650
parent0aac3c09f19875f670ac5f6438bb03f5a296cfab (diff)
downloadsamba-5c3a0cbae0eee6c2c35e2de037380546fc22dd9c.tar.gz
samba-5c3a0cbae0eee6c2c35e2de037380546fc22dd9c.tar.bz2
samba-5c3a0cbae0eee6c2c35e2de037380546fc22dd9c.zip
libcli/smb: setup tcon->smb2.should_encrypt in smb2cli_tcon_set_values()
metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jul 25 16:44:22 CEST 2012 on sn-devel-104
-rw-r--r--libcli/smb/smbXcli_base.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 9e00ba9cab..7a5a0b036b 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -167,6 +167,7 @@ struct smbXcli_tcon {
uint32_t flags;
uint32_t capabilities;
uint32_t maximal_access;
+ bool should_encrypt;
} smb2;
};
@@ -2467,7 +2468,9 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
if (tcon) {
tid = tcon->smb2.tcon_id;
- /* TODO: turn on encryption based on the tree connect. */
+ if (tcon->smb2.should_encrypt) {
+ state->smb2.should_encrypt = true;
+ }
}
if (state->smb2.should_encrypt) {
@@ -4636,4 +4639,16 @@ void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
tcon->smb2.flags = flags;
tcon->smb2.capabilities = capabilities;
tcon->smb2.maximal_access = maximal_access;
+
+ tcon->smb2.should_encrypt = false;
+
+ if (session == NULL) {
+ return;
+ }
+
+ tcon->smb2.should_encrypt = session->smb2.should_encrypt;
+
+ if (flags & SMB2_SHAREFLAG_ENCRYPT_DATA) {
+ tcon->smb2.should_encrypt = true;
+ }
}