diff options
author | Ralph Boehme <slow@samba.org> | 2018-11-10 21:56:28 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-11-23 09:01:26 +0100 |
commit | 4ba496bf3c13c567b7a2617133e0bc7f5a2c8f1f (patch) | |
tree | 51360e099d35eda9f71da905ba4ee146ff6c213c | |
parent | 2b73c8a0df41d0e3e303bd0de7d45141580c4eff (diff) | |
download | samba-4ba496bf3c13c567b7a2617133e0bc7f5a2c8f1f.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>
(cherry picked from commit 7abf3900218e3d27c075b405735b2c38ec0fc4ca)
-rw-r--r-- | libcli/smb/smbXcli_base.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 51702efdb3f..07de4297707 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -3752,12 +3752,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); @@ -3806,6 +3800,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); |