summaryrefslogtreecommitdiff
path: root/libcli/smb
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-11-10 21:56:28 +0100
committerRalph Boehme <slow@samba.org>2018-11-13 11:13:03 +0100
commit7abf3900218e3d27c075b405735b2c38ec0fc4ca (patch)
tree678b55b2839df62c434e8b745b43198c9586229c /libcli/smb
parent67cfb01611869b7590ccd836dd13a80e53545714 (diff)
downloadsamba-7abf3900218e3d27c075b405735b2c38ec0fc4ca.tar.gz
libcli/smb: defer singing check a little bit
This allows adding an additional condition to the if check where the condition state may be modified in the "if (opcode == SMB2_OP_SESSSETUP)" case directly above. No change in behaviour. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'libcli/smb')
-rw-r--r--libcli/smb/smbXcli_base.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index a93f07c8ee6..ea7ca22f644 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -3753,12 +3753,6 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
}
last_session = session;
- if (state->smb2.should_sign) {
- if (!(flags & SMB2_HDR_FLAG_SIGNED)) {
- return NT_STATUS_ACCESS_DENIED;
- }
- }
-
if (flags & SMB2_HDR_FLAG_SIGNED) {
uint64_t uid = BVAL(inhdr, SMB2_HDR_SESSION_ID);
@@ -3807,6 +3801,12 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct smbXcli_conn *conn,
}
}
+ if (state->smb2.should_sign) {
+ if (!(flags & SMB2_HDR_FLAG_SIGNED)) {
+ return NT_STATUS_ACCESS_DENIED;
+ }
+ }
+
if (cur[0].iov_len == SMB2_TF_HDR_SIZE) {
const uint8_t *tf = (const uint8_t *)cur[0].iov_base;
uint64_t uid = BVAL(tf, SMB2_TF_SESSION_ID);