1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

235 Commits

Author SHA1 Message Date
Jeremy Allison
1624d83fde Add new function smbXcli_session_copy(), to be used when creating compound SMB2 requests.
Copies the signing state needed to make client compound requests work
on signed connections.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
2013-01-30 17:15:59 -08:00
David Disseldorp
14bd6c8b09 smb2_ioctl: split ioctl handler code on device type
Add per device type ioctl handler source files for FSCTL_DFS,
FSCTL_FILESYSTEM, FSCTL_NAMED_PIPE and FSCTL_NETWORK_FILESYSTEM.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:06 +01:00
Andreas Schneider
3bf3ab4f64 libcli: Fix smb2cli_ioctl_send() if clause.
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-21 13:56:00 +01:00
Volker Lendecke
d5693d99b8 Fix Bug 9422 - large read requests cause server to issue malformed reply
Reviewed by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Nov 30 03:27:07 CET 2012 on sn-devel-104
2012-11-30 03:27:07 +01:00
Stefan Metzmacher
c5cd22b5bb libcli/smb: add smbXcli_session_set_disconnect_expired() (bug #9175)
This should be a short term hack until the upper layers have implemented
re-authentication.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-01 16:25:33 +01:00
Stefan Metzmacher
2b4672f2d3 libcli/smb: fix unitialized padding in smb2_create_blob_push_one() (bug #9209)
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Oct 27 10:05:22 CEST 2012 on sn-devel-104
2012-10-27 10:05:22 +02:00
Stefan Metzmacher
b186fdd185 libcli/smb: add smb1cli_echo*
metze
2012-09-29 10:10:30 +02:00
Stefan Metzmacher
a7fa02664a libcli/smb: add smb2cli_echo*
metze
2012-09-29 10:10:03 +02:00
Stefan Metzmacher
faa039ef46 libcli/smb: use an explicit TALLOC_FREE(subreq) in smb2cli_*
metze
2012-09-29 10:09:25 +02:00
Jeremy Allison
322e3d42f6 Fix bug #9209 - Parse of invalid SMB2 create blob can cause smbd crash.
Ensure we correctly protect against blobs with data_offset==0
and data_length != 0.

Jeremy.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 27 22:07:02 CEST 2012 on sn-devel-104
2012-09-27 22:07:02 +02:00
Michael Adam
50c10cbdce libcli: add a define for the APP_INSTANCE_ID smb2 create context 2012-09-19 21:21:37 +02:00
Stefan Metzmacher
aa5caf1fe9 libcli/smb: fix padding in smb2_create_blob*
metze
2012-09-19 21:21:36 +02:00
Stefan Metzmacher
28350aeaa1 libcli/smb: split out a smb_transport private library
metze
2012-08-25 01:39:41 +02:00
Stefan Metzmacher
5eec19bc83 libcli/smb: wscript_build => wscript
We'll need some configure checks in future.

metze
2012-08-25 01:39:41 +02:00
Stefan Metzmacher
abf018e8b6 libcli/smb: make sure the SMB2_TRANSFORM pdu is complete
metze
2012-08-17 14:51:57 +02:00
Stefan Metzmacher
56fc7bc661 libcli/smb: support broken OS/2 error responses bug #9096
OS/2 skips the DATA Block in SMB1 responses.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Aug 16 13:16:49 CEST 2012 on sn-devel-104
2012-08-16 13:16:48 +02:00
Stefan Metzmacher
d2d5fb1abf libcli/smb: verify decrypted SMB2 pdus correctly
We need to make sure we got a encrypted response if we asked
for it.

If we don't get a encrypted response, we use a similar logic
as with signing to propagated wellknown errors to the higher
layer and set state->smb2.signing_skipped = true.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Aug 15 16:26:26 CEST 2012 on sn-devel-104
2012-08-15 16:26:26 +02:00
Stefan Metzmacher
7a7e9b1c76 libcli/smb: fix parsing of compounded messages within a SMB2_TRANSFORM pdu
One SMB2_TRANSFORM pdu wraps multiple SMB2 pdus.

We inject the SMB2_TRANSFORM header to each response which was wrapped
inside. This allows the next layer to verify if the SMB2 pdu was encrypted.

metze
2012-08-15 14:45:21 +02:00
Stefan Metzmacher
84f6b0f962 libcli/smb: fix smb2cli_req_compound_submit for multiple encrypted messages
There should be only one SMB2_TRANSFORM header for all compound requests.

metze
2012-08-15 14:45:05 +02:00
Stefan Metzmacher
7ffee47bc6 libcli/smb: all flags except SMB2_HDR_FLAG_ASYNC should be cleared in a cancel request.
metze
2012-08-15 14:45:04 +02:00
Stefan Metzmacher
528d3fe2ae libcli/smb: do not set SMB2_TF_MSG_SIZE in the caller
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Aug  8 07:32:55 CEST 2012 on sn-devel-104
2012-08-08 07:32:55 +02:00
Stefan Metzmacher
143fb8403a libcli/smb: smb2_signing_[en|de]crypt_pdu() check and set SMB2_TF_MSG_SIZE
metze
2012-08-08 05:37:56 +02:00
Stefan Metzmacher
145335878b libcli/smb: use forward declaration instead of includes
metze
2012-08-07 11:16:36 +02:00
Christian Ambach
4e91ccf16d smbXcli: add some includes to fix compiler warnings
if smbXcli_base.h is included on its own, there are various compiler warnings
about implicitly declared struct iovec and smb2_create_blobs
2012-08-06 18:07:52 +02:00
Stefan Metzmacher
97be49c4d4 libcli/smb: add smb1cli_session_protect_session_key()
metze
2012-08-04 09:10:21 +02:00
Stefan Metzmacher
dbefd7d194 libcli/smb: add smb_key_derivation() for TREE_CONNECT_ANDX_EXTENDED_SIGNATURES support
metze
2012-08-04 09:10:21 +02:00
Stefan Metzmacher
b1a0fda73d libcli/smb: pass hdr/len to smb_signing_check/sign_pdu() and skip the nbt header
metze
2012-08-04 09:10:21 +02:00
Stefan Metzmacher
d88a6c1dc3 libcli/smb: change smb_signing to skip the NBT_HEADER_SIZE internally
metze
2012-08-04 09:10:20 +02:00
Stefan Metzmacher
d3aaa1ebc8 libcli/smb: move some TCON related defines to smb_constants.h
metze
2012-08-01 14:17:16 +02:00
Stefan Metzmacher
2f4f2144f4 libcli/smb: remove unused smb2cli_session_application_key()
metze
2012-08-01 14:17:13 +02:00
Stefan Metzmacher
5f25567c2e libcli/smb: add smbXcli_session_application_key()
metze
2012-08-01 14:17:12 +02:00
Stefan Metzmacher
7af537e66f libcli/smb: allow resetting of the smb1 application_key
We need this untill we have fixed all callers...

metze
2012-08-01 14:16:01 +02:00
Stefan Metzmacher
68c1eec11d libcli/smb: let smb1cli_session_set_id() reset the application_key
We have some callers which reuse smbXcli_session,
e.g. cli_state_set_uid()

metze
2012-08-01 13:35:21 +02:00
Stefan Metzmacher
c3cb672d38 libcli/smb: add smb1cli_session_set_session_key()
metze
2012-08-01 12:30:26 +02:00
Stefan Metzmacher
8cb6557d22 libcli/smb: add basic session->smb2.channel_sequence handling
metze
2012-07-26 10:02:07 +02:00
Stefan Metzmacher
fdd98675ac libcli/smb: add SMB2_HDR_CHANNEL_SEQUENCE
metze
2012-07-26 10:02:07 +02:00
Stefan Metzmacher
ba14bc52da libcli/smb: introduce a smb2cli_session
This maintains the shared state between multiple session
channels.

metze
2012-07-26 10:02:07 +02:00
Stefan Metzmacher
46e08eb75f s3:libcli/smb: add SMB2_SESSION_FLAG_BINDING
metze
2012-07-26 00:12:17 +02:00
Stefan Metzmacher
5c3a0cbae0 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
2012-07-25 16:44:22 +02:00
Stefan Metzmacher
0aac3c09f1 libcli/smb: pass smbXcli_session to smb2cli_tcon_set_values()
metze
2012-07-25 14:48:50 +02:00
Stefan Metzmacher
56aa419d87 libcli/smb: there's no PID field in the SMB2/3 header anymore
It's a reserved field...

metze
2012-07-25 12:15:05 +02:00
Stefan Metzmacher
7de4ae7f9f libcli/smb: pass smbXcli_tcon to smb2cli_req_create/send()
metze
2012-07-25 12:15:04 +02:00
Stefan Metzmacher
a10fe7b252 libcli/smb: add smb2cli_tcon_capabilities()
metze
2012-07-25 12:15:03 +02:00
Stefan Metzmacher
20d43a1d30 libcli/smb: pass smbXcli_tcon to smb2cli_ioctl*()
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
51af8b9600 libcli/smb: pass smbXcli_tcon to smb2cli_query_directory*()
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
370e7140bb libcli/smb: pass smbXcli_tcon to smb2cli_query_info*()
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
6dc701c958 libcli/smb: pass smbXcli_tcon to smb2cli_set_info*()
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
6612c831a3 libcli/smb: pass smbXcli_tcon to smb2cli_flush*()
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
86a5ab731b libcli/smb: pass smbXcli_tcon to smb2cli_write*()
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
697b82a619 libcli/smb: pass smbXcli_tcon to smb2cli_read*()
metze
2012-07-24 22:20:06 +02:00