uint32_t flags;
uint32_t capabilities;
uint32_t maximal_access;
+ bool should_encrypt;
} smb2;
};
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) {
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;
+ }
}