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

470 Commits

Author SHA1 Message Date
Stefan Metzmacher
d021a2d90f libcli/smb: pass tcon flags to the server for SMB 3.10
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
2a4290fa00 libcli/smb: avoid validate info after tcon for SMB 3.10
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
c290ece1f6 libcli/smb: implement SMB 3.10 session setup
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
2f732db742 libcli/smb: implement SMB 3.10 negprot
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
a00fe90c3c libcli/smb: add smb2cli_req_get_send_iov()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
5c5a33cfcb libcli/smb: add smb2_negotiate_context.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
9d92074769 libcli/smb: add SMB 3.10 related defines
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
664ca0e3ee libcli/smb: negotiate SMB3_DIALECT_REVISION_310 if PROTOCOL_SMB3_10 is requested
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
d22fd000c9 libcli/smb: add PROTOCOL_SMB3_10
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
1fa8861f15 libcli/smb: add SMB3_DIALECT_REVISION_310 define
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Stefan Metzmacher
3eef853f74 libcli/smb: fix smb2cli_validate_negotiate_info with min=PROTOCOL_NT1 max=PROTOCOL_SMB2_02
If the connection starts with a SMB Negprot, the server only implies the
selected dialect, but not the clients security mode.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-10-07 22:47:04 +02:00
Jeremy Allison
6c05cd3e89 s3: smb2cli: query info return length check was reversed.
Make it identical to the check in libcli/smb/smb2cli_ioctl.c

https://bugzilla.samba.org/show_bug.cgi?id=10848

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct  2 04:42:26 CEST 2014 on sn-devel-104
2014-10-02 04:42:26 +02:00
Stefan Metzmacher
26ff9f3487 libcli/smb: call smb2cli_validate_negotiate_info*() after each authenticated tcon
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
7729ba5849 libcli/smb: add smb2cli_validate_negotiate_info*()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
6a82cb7b68 libcli/smb: list NT_STATUS_FILE_CLOSED as expected ioctl response.
Some IOCTL requests change the behavior with new protocol versions.
E.g. FSCTL_VALIDATE_NEGOTIATE_INFO resulted in NT_STATUS_FILE_CLOSED
for old servers.

As SMB2 signing might be skipped for responses with NT_STATUS_FILE_CLOSED
we need to list it explicitly in the expected return values.

This way we'll get NT_STATUS_ACCESS_DENIED, if the server doesn't
sign the response to a signed requests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
b77bb5a2e3 libcli/smb: move smb2cli_tcon.c to the toplevel
removing use of cli_state from the code.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
8c846f78ed libcli/smb: add smb2cli_tcon_{should_sign,is_signing_on}()
This can be used to force signing for individual requests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
e954f9290c libcli/smb: add smb2cli_tcon_should_encrypt()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
ca1081ef5e libcli/smb: add smbXcli_session_is_authenticated()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Stefan Metzmacher
aa4310b0af libcli/smb: support additional_flags = SMB2_HDR_FLAG_SIGNED
With SMB2_HDR_FLAG_SIGNED we make sure that we either use smb2 signing
or smb2 encryption for the request.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-30 23:35:08 +02:00
Andreas Schneider
f92086f4a3 libcli: Fix a segfault calling smbXcli_req_set_pending() on NULL.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10817

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 23 04:23:05 CEST 2014 on sn-devel-104
2014-09-23 04:23:05 +02:00
Anubhav Rakshit
4c64d41cfc libcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:10 +02:00
Anubhav Rakshit
2a8a6edfef libcli/smb: Add routine to reset the Channel Sequence number.
Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:10 +02:00
Stefan Metzmacher
dfcc683e38 libcli/smb: correctly report disconnect errors after getting STATUS_PENDING
smb2cli_req_recv() should not report STATUS_PENDING if the
request isn't pending anymore (e.g. the connection was disconnected)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:10 +02:00
Volker Lendecke
6a1c51ee80 lib: Reduce deps for "smb_transport"
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-09-18 20:36:11 +02:00
Volker Lendecke
9f3e894468 libcli: Make smb2cli_create return blobs
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-30 22:28:14 +02:00
Volker Lendecke
0a2209c161 libsmb: Make smb2cli_create cancellable
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-21 20:38:11 +02:00
Volker Lendecke
1dda098401 libsmb: Put the "smb2_lease" struct into idl
This will make it easier in the future to NDR_PRINT a lease and
a lease key

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jun 12 03:34:41 CEST 2014 on sn-devel-104
2014-06-12 03:34:41 +02:00
Björn Jacke
accb76b9a8 add FSCTL_SET_ZERO_ON_DEALLOCATION define
Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu May 15 15:16:34 CEST 2014 on sn-devel-104
2014-05-15 15:16:34 +02:00
Björn Jacke
fc49cc976b add FSCTL_SET_ZERO_DATA fsctl define
fallocalte with the FALLOC_FL_ZERO_RANGE flag introduced
with Linux 3.15 should be able to do this soon

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-15 12:51:21 +02:00
Jeremy Allison
2900dfa5b9 s3: client - rename 'struct smb2_create_returns' to 'struct smb_create_returns' so we can use this in SMB1 create returns as well.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-05-09 23:10:07 +02:00
Stefan Metzmacher
6d6bd9612c libcli/smb: add smb_signing_is_desired()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-16 07:50:05 +02:00
Stefan Metzmacher
d6794ec2aa libcli/smb: reuse tstream_smbXcli_np_disconnect_send/recv as helper
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Stefan Metzmacher
5b1d9f7a82 libcli/smb: add tstream_smbXcli_np_disconnect_cleanup() to handle talloc_free(req)
If the tevent_req of tstream_smbXcli_np_disconnect_* is explicitly or
implicitly free'ed, we need to make sure we still deliver the
close request to the server! Otherwise the SMB signing sequence gets out of
sync.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Stefan Metzmacher
6260de7221 libcli/smb: make TSTREAM_SMBXCLI_NP_MAX_BUF_SIZE public
This should be used to negotiate the may fragment size
of DCERPC connections.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Stefan Metzmacher
96e1bcde2b libcli/smb: keep references to smbXcli_{conn,session,tcon} in tstream_smbXcli_np
This fixes some valgrind errors when the smbXcli_tcon disappears before the
smbXcli_conn.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Stefan Metzmacher
900839e221 libcli/smb: add SMB_BUFFER_SIZE_MIN/MAX defines
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-03-05 10:06:24 -08:00
Stefan Metzmacher
f08c0b2ef1 libcli/smb: make use of tevent_req_set_cleanup_fn()
This is more better than a custom tevent_req destructor.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Stefan Metzmacher
0059929601 libcli/smb: s/tstream_cli_np/tstream_smbXcli_np
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:42 +01:00
Stefan Metzmacher
8ec4163848 libcli/smb: s/TSTREAM_CLI_NP/TSTREAM_SMBXCLI_NP
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:42 +01:00
Stefan Metzmacher
024fc73047 libcli/smb: move source3/libsmb/cli_np_tstream.c to tstream_smbXcli_np.c
This code is generic enough to have it in the top level now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:42 +01:00
Gregor Beck
3d90e9346b libcli/smb: add smb1cli_readx*
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:39 +01:00
Gregor Beck
cb295d708d libcli/smb: add smb1cli_writex*
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:39 +01:00
Gregor Beck
b9d19e876f libcli/smb: add smb1cli_close*
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:39 +01:00
Gregor Beck
50f910ff5d libcli/smb: add smb1cli_ntcreatex*
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:39 +01:00
Stefan Metzmacher
ef28ed685f libcli/smb: move some *TRANSACT_* flags to smb_constants.h
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:38 +01:00
Stefan Metzmacher
306cba4b8c libcli/smb: move some FILE_* flags to smb_constants.h
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07 08:37:38 +01:00
Stefan Metzmacher
127fc670a3 libcli/smb: fix smb2cli_ioctl*() against Windows 2008.
The subsections of [MS-SMB2] "3.2.5.14 Receiving an SMB2 IOCTL Response"
say the client should ignore the InputOffset/InputCount.

We do that only if we ask for max_input_length = 0.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10232

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 31 01:16:10 CET 2013 on sn-devel-104
2013-10-31 01:16:09 +01:00
Stefan Metzmacher
60f16bacdc libcli/smb: add SMB2_HDR_FLAG_DFS for SMB2 Create operations on dfs shares
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:10:35 +02:00
Stefan Metzmacher
b16b469f3f libcli/smb: add FLAG_CASELESS_PATHNAMES based on FILE_CASE_SENSITIVE_SEARCH to smb1 requests
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:09:10 +02:00
Stefan Metzmacher
e6eb6b9e94 libcli/smb: move Filesystem Attributes defines to smb_constants.h
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:08:29 +02:00
Stefan Metzmacher
44224cd40f libcli/smb: add FLAGS2_DFS_PATHNAMES for SMB1 operations against dfs shares
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:06:22 +02:00
Stefan Metzmacher
1c4e95cbd8 libcli/smb: add smbXcli_tcon_{set,get}_fs_attributes()
These are the attributes returned from the FileFsAttributeInformation
request.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:04:35 +02:00
Stefan Metzmacher
e0fe97c543 libcli/smb: add smbXcli_tcon_is_dfs_share()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:03:25 +02:00
Luk Claes
24e7be87d1 libcli/smb: Introduce smbXcli_conn_dfs_supported
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200

Signed-off-by: Luk Claes <luk@debian.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-17 16:01:39 +02:00
Michael Adam
f643961343 libcli/smb: add smb2cli_tcon_is_encryption_on()
https://bugzilla.samba.org/show_bug.cgi?id=10208

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-10-15 11:49:01 -07:00
Volker Lendecke
c944d2ea41 libcli: Correct smb2_lease_pull
We don't really use leases yet, so so far this went by unnoticed. It's
the V2 lease requests that hold the parent lease key, not the V1 ones.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06 13:55:50 +02:00
Volker Lendecke
eb5e817a73 libcli: Add const to smb2_lease_pull
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-10-06 13:55:12 +02:00
Stefan Metzmacher
4879d0810a libcli/smb: only check the SMB2 session setup signature if required and valid
This is an update to commit af290a03ce
that skips the scary debug messages.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10146

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Sep 18 04:46:00 CEST 2013 on sn-devel-104
2013-09-18 04:46:00 +02:00
Stefan Metzmacher
af290a03ce libcli/smb: fix non mendatory signing against some vendor SMB2 servers.
Windows and Samba always sign the final session setup response
even if signing is not mendatory, but it ensures that the signing
key is correctly in place.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10146

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep 17 09:40:10 CEST 2013 on sn-devel-104
2013-09-17 09:40:10 +02:00
Stefan Metzmacher
1d54d8c501 libcli/smb: use SMB1 MID=0 for the initial Negprot
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10144

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-17 07:52:29 +02:00
Stefan Metzmacher
f8b3c712f0 libcli/smb: negotiate SMB3_DIALECT_REVISION_302 if PROTOCOL_SMB3_02 is requested
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-17 04:00:33 +02:00
Stefan Metzmacher
80623b8593 libcli/smb: add PROTOCOL_SMB3_02
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-17 04:00:23 +02:00
Stefan Metzmacher
4a401d6fcc libcli/smb: add SMB3_DIALECT_REVISION_302
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-17 04:00:14 +02:00
Jeremy Allison
81e1058e20 As SMB3 has transport level encryption, allow smbclient -e to force encryted SMB3 transport.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-08-21 17:28:55 +02:00
Stefan Metzmacher
7efdc323d1 libcli/smb: add smb2cli_conn_req_possible()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:06 +02:00
Stefan Metzmacher
111f529a2a libcli/smb: add smb1cli_conn_req_possible()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:06 +02:00
Stefan Metzmacher
44b53937d5 libcli/smb: pass max_dyn_len to smb2cli_req_send()
This way we can calculate the correct credit charge
for requests with large output buffers.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:06 +02:00
Stefan Metzmacher
4a3352020d libcli/smb: pass max_dyn_len to smb2cli_req_create()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:06 +02:00
Stefan Metzmacher
318735fd5e libcli/smb: calculate the credit charge on the input and output dyn_len
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:06 +02:00
Jeremy Allison
1229881df6 libcli/smb: Change smb2cli_create() and smb2cli_create_recv() to return a parameter blob of the newly opened/created file.
Will use in the smb2 client code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-08-15 09:07:06 +02:00
Jeremy Allison
00f784ec91 libcli/smb: Fix smb2cli_write_recv() and smb2cli_write() to return the bytes written.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-08-15 09:07:05 +02:00
Stefan Metzmacher
97288b7f10 libcli/smb: fix the credit handling on a SMB1 => SMB2 negotiate
Our cur_credit value had 1 credit too many in the case of
an SMB1 => SMB2 upgrade. When we max out the credits the server
disconnected the connection.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-15 09:07:05 +02:00
Volker Lendecke
2e59d6c370 libsmb: Remove an unnecessary variable assignment
Signed-off-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 17:25:56 +12:00
Volker Lendecke
f584474d7d libsmb: Avoid an unnecessary "else"
Signed-off-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 17:25:55 +12:00
David Disseldorp
8fde65e199 lib: add FSCTL_[GET/SET]_COMPRESSION constants
Values taken from MS-FSCC.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-09 11:10:01 -07:00
Steve French
bbe09b3319 Add missing SMB2/SMB3 share capability flag define
SMB3.02 adds SHARE_CAP_ASYMMETRIC

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 21 22:57:16 CEST 2013 on sn-devel-104
2013-06-21 22:57:16 +02:00
Andrew Bartlett
fc13489c91 build: Build with system md5.h on OpenIndiana
This changes (again...) our system md5 detection to cope with how
OpenIndiana does md5.  I'm becoming increasingly convinced this isn't
worth our while (we should have just done samba_md5...), but for now
this change seems to work on FreeBSD, OpenIndiana and Linux with
libbsd.

This needs us to rename struct MD5Context -> MD5_CTX, but we provide a
config.h define to rename the type bad if MD5_CTX does not exist (it does
however exist in the md5.h from libbsd).

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jun 19 21:32:36 CEST 2013 on sn-devel-104
2013-06-19 21:32:36 +02:00
Volker Lendecke
a8edad3743 libcli: Add smb2_lease marshalling
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-30 14:14:18 +02:00
Volker Lendecke
96a8f6e0fb libsmb: Move "struct smb2_lease" to common
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-04-30 14:13:41 +02:00
Stefan Metzmacher
f367d07f52 libcli/smb: add SMB2_LEASE_FLAG_* defines
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-18 15:11:48 +02:00
Jeremy Allison
1111d46cc5 libcli/smb: smb1cli_inbuf_parse_chain() and smb1cli_conn_dispatch_incoming() should use smb_len_tcp.
They have to cope with large READX call replies that have
a length greater than smb_len_nbt() can handle.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-20 09:32:25 -07:00
Stefan Metzmacher
53d348dff0 libcli/smb: defer failing for missing NEGOTIATE_SECURITY_SIGNATURES_ENABLED
Windows servers take a look at the FLAGS2_SMB_SECURITY_SIGNATURES_REQUIRED
flag during a session setup and turn on signing if the client requires it.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-20 09:32:25 -07:00
Stefan Metzmacher
3d7a4db6bc libcli/smb: add SMB_CAP_LEGACY_CLIENT_MASK define
Older Samba releases (<= 3.6.x)
expect the client to send CAP_LARGE_READX
in order to let the client use large reads.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-20 09:32:25 -07:00
Stefan Metzmacher
4ea37dd521 libcli/smb: make use of samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:44 +01:00
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
Stefan Metzmacher
74f9b52e65 libcli/smb: pass smbXcli_tcon to smb2cli_close*()
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
32b33999db libcli/smb: pass smbXcli_tcon to smb2cli_create*()
metze
2012-07-24 22:20:06 +02:00
Stefan Metzmacher
b9100a7ac4 libcli/smb: pass down smbXcli_tcon to smb1cli_req_create/send() and smb1cli_trans*
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 24 21:22:44 CEST 2012 on sn-devel-104
2012-07-24 21:22:44 +02:00
Luk Claes
552dda970c libcli/smb: add smbXcli_tcon structure
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-07-24 18:44:04 +02:00
Stefan Metzmacher
43b070d8dd libcli/smb: pass down smbXcli_session to smb1cli_req_create/send() and smb1cli_trans*
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 24 00:08:58 CEST 2012 on sn-devel-104
2012-07-24 00:08:58 +02:00
Luk Claes
6bff589e33 libcli/smb: introduce smb1.session for uid use
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-07-23 22:13:29 +02:00
Stefan Metzmacher
4b64ec546f libcli/smb: set should_encrypt = true if we got SMB2_SESSION_FLAG_ENCRYPT_DATA
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jul 23 20:14:07 CEST 2012 on sn-devel-104
2012-07-23 20:14:07 +02:00
Stefan Metzmacher
6b9321071c libcli/smb: encrypt SMB2 traffic if nedded/desired.
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
6e651dfdc0 libcli/smb: increment nbt_len, when we have the fully created the SMB2 PDU
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
f08adbb4d6 libcli/smb: maintain smb2.should_sign on smbXcli_req_state
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
92811c6f5f libcli/smb: make use of SMB2_HDR_BODY as header size
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
be8e33ec54 libcli/smb: parse the SMB2_TRANSFORM header and decrypt the SMB2 pdu
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
c2b0a48513 libcli/smb: create 4 iovecs per request in smb2cli_inbuf_parse_compound()
The first one might hold the SMB2_TRANSFORM Header later.

metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
5863107cd3 libcli/smb: prepare [en|de]cryption_key for SMB3
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
d333edbe14 libcli/smb: copy the application_key in smb2cli_session_create_channel()
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
077eb578be libcli/smb: check the buffer length in smbXcli_negprot_dispatch_incoming()
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
1c144b07f6 libcli/smb: only pass the smb2 buffer to smb2cli_inbuf_parse_compound()
We should hide the transport as much as possible.

metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
fd736f7f18 libcli/smb: add smb2_signing_[en|e]crypt_pdu()
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
7e0982421b libcli/smb: construct the signing_key before forming the message
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
4628e2878f libcli/smb: add SMB2_SESSION_FLAG_ENCRYPT_DATA
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
d7285672b4 libcli/smb: add SMB2_TRANSFORM macros
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
cbf44e8d2f libcli/smb: add SMB2_CAP_DIRECTORY_LEASING to SMB2_CAP_ALL
metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-29 15:21:12 +02:00
Stefan Metzmacher
f61c24166e libcli/smb: add some more FSCTL_* defines
metze
2012-05-29 10:16:24 +02:00
Stefan Metzmacher
244cf059f0 s3:smb2cli_ioctl: fix requests without output_buffer.length > 0 against windows
This fixes DCERPC over SMB2 against windows servers.

metze
2012-05-29 10:16:23 +02:00
Björn Baumbach
5f494c424c libcli/smb: move smb2cli_ioctl.c from source3 to the toplevel
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue May 15 20:17:01 CEST 2012 on sn-devel-104
2012-05-15 20:17:01 +02:00
Björn Baumbach
c16e263d0e libcli/smb: move smb2cli_query_directory.c from source3 to the toplevel
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-15 18:26:00 +02:00
Björn Baumbach
b2d9c02665 libcli/smb: move smb2cli_query_info.c from source3 to the toplevel
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-15 18:26:00 +02:00
Björn Baumbach
22b76de2ff libcli/smb: move smb2cli_set_info.c from source3 to the toplevel
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-15 18:26:00 +02:00
Björn Baumbach
1d7c6bfd7a libcli/smb: move smb2cli_flush.c from source3 to the toplevel
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-15 18:26:00 +02:00
Björn Baumbach
f50fc00306 libcli/smb: move smb2cli_write.c from source3 to the toplevel
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-15 18:26:00 +02:00
Björn Baumbach
269000b1b3 libcli/smb: move smb2cli_read.c from source3 to the toplevel
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-15 18:26:00 +02:00
Stefan Metzmacher
4022edc906 libcli/smb: move smb2cli_close.c from source3 to the toplevel
metze
2012-05-15 18:25:59 +02:00
Stefan Metzmacher
2674d0c458 libcli/smb: move smb2cli_create.c from source3 to the toplevel
metze
2012-05-15 18:25:59 +02:00
Stefan Metzmacher
aca64f642d libcli/smb: move smb2cli_logoff_* from source3 to the top level
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon May 14 17:02:46 CEST 2012 on sn-devel-104
2012-05-14 17:02:46 +02:00
Stefan Metzmacher
ce0d6d89ee libcli/smb: git mv smb2_session.c smb2cli_session.c
metze
2012-05-14 15:12:35 +02:00
Stefan Metzmacher
7e7c4ba6f8 libcli/smb/smb_constants: add FSCTL_VALIDATE_NEGOTIATE_INFO*
metze
2012-05-11 18:19:51 +02:00
Stefan Metzmacher
43085e9b82 libcli/smb/smbXcli: add support for PROTOCOL_SMB3_00
metze
2012-05-06 14:50:39 +02:00
Stefan Metzmacher
abd801714c libcli/smb: add #define PROTOCOL_LATEST PROTOCOL_SMB3_00
metze
2012-05-06 14:50:39 +02:00
Stefan Metzmacher
7ae2c16f0f libcli/smb: add PROTOCOL_SMB3_00
metze
2012-05-06 14:50:39 +02:00
Stefan Metzmacher
44dcad7310 libcli/smb: add SMB3_DIALECT_REVISION_300
metze
2012-05-06 14:50:39 +02:00
Stefan Metzmacher
42b403c19f libcli/smb: move SMB2_IOCTL_FLAG_IS_FSCTL to smb2_constants.h
metze
2012-04-27 08:31:37 +02:00
Volker Lendecke
5a100a4b1b libcli: Use data_blob_null
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed Apr 25 18:54:51 CEST 2012 on sn-devel-104
2012-04-25 18:54:51 +02:00
Alexander Bokovoy
594e316181 lib/replace: split out GSSAPI from lib/replace/system/kerberos.h into lib/replace/system/gssapi.h
With waf build include directories are defined by dependencies specified to subsystems.
Without proper dependency <gssapi/gssapi.h> cannot be found for embedded Heimdal builds
when there are no system-wide gssapi/gssapi.h available.

Split out GSSAPI header includes in a separate replacement header and use that explicitly
where needed.

Autobuild-User: Alexander Bokovoy <ab@samba.org>
Autobuild-Date: Wed Apr 25 00:18:33 CEST 2012 on sn-devel-104
2012-04-25 00:18:32 +02:00
Simo Sorce
08c733d75f Make krb5 wrapper library common so they can be used all over 2012-04-23 19:20:38 -04:00
Stefan Metzmacher
b0939c5774 libcli/smb: move smb2cli_session_setup_*() prototypes to the code.
metze
2012-04-16 12:54:53 +02:00
Stefan Metzmacher
6054e9a48b libcli/smb: add smb2cli_session_get_flags()
metze
2012-04-16 12:54:52 +02:00
Stefan Metzmacher
c60c2c5d94 libcli/smb: we should not force a session key for anonymous connections
smb2cli_session_set_session_key() should not check for a valid session
key, if the connection is a guest or null session.

metze
2012-04-16 12:54:52 +02:00
Stefan Metzmacher
b23f5a9418 libcli/smb: make use of data_blob_string_const_null()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Apr 16 12:21:17 CEST 2012 on sn-devel-104
2012-04-16 12:21:17 +02:00
Jelmer Vernooij
a8c066b023 smb2: Move smb2cli session setup code to cli_smb_common. 2012-03-25 17:14:56 +02:00
Jelmer Vernooij
5283aa5356 libcli/smb: Stop generating unused proto file. 2012-03-25 17:14:14 +02:00
Michael Adam
4a8dfa48dd libcli:smb: define SMB2_HDR_FLAG_REPLAY_OPERATION
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sun Mar  4 15:10:38 CET 2012 on sn-devel-104
2012-03-04 15:10:38 +01:00
Michael Adam
ac43937ce4 smbXcli: add the possiblilty to negotiate client capabilites in smb >= 2.2
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-03-03 17:03:07 +01:00
Michael Adam
76e6733344 libcli:smb: define SMB2_DHANDLE_FLAG_PERSISTENT 2012-03-03 17:03:06 +01:00
Michael Adam
db632fdd2c libcli:smb: add new SMB2 share flags
* FORCE_LEVELII_OPLOCKS
* ENABLE_HASH_V1
* ENABLE_HASH_V2
* ENCRYPT_DATA
2012-03-03 17:03:06 +01:00
Michael Adam
6f860837e5 libcli:smb: upgrade SMB2_CAP_ALL to include the newly known caps 2012-03-03 17:03:06 +01:00
Michael Adam
8c5d288ecf libcli:smb: add defines for SMB2.2 share capabilities
* continuous avaliability
* cluster
* scaleout
2012-03-03 17:03:06 +01:00
Michael Adam
29eed6359a libcli:smb: add defines for SMB2.2 global capabilities
* multi channel
* persistent handles
* directory leasing
* encryption
2012-03-03 17:03:06 +01:00
Michael Adam
0bdd18efc9 libcli:smb: define DH2Q and DH2C tags for smb2 extra create blobs
These are the tags for the SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2
and SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2, the second version
of the SMB2_CREATE_DURABLE_HANDLE_REQUEST (DHnQ) and
SMB2_CREATE_DURABLE_HANDLE_RECONNECT (DHnC), which are only
available for SMB 2.2 (and newer).
2012-03-03 17:03:06 +01:00
Christian Ambach
dc24e229a5 smb2_constants: fix a typo
Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Sat Mar  3 09:04:40 CET 2012 on sn-devel-104
2012-03-03 09:04:40 +01:00
Christian Ambach
583a53835b smb2_constants: add SMB2_WATCH_TREE 2012-03-02 21:47:09 -08:00
Michael Adam
f981257240 libcli/smb/smb2_signing: rename smb2_key_deviration -> smb2_key_derivation
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Feb 29 09:01:54 CET 2012 on sn-devel-104
2012-02-29 09:01:54 +01:00
Stefan Metzmacher
c9219fe585 libcli/smb/smbXcli: use smb2_key_deviration() to setup SMB 2.24 keys
This uses the key diveration function from "NIST Special Publication 800-108"
in counter mode (section 5.1).

Thanks to Jeremy, Michael and Volker for the debugging!

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Feb 29 04:54:48 CET 2012 on sn-devel-104
2012-02-29 04:54:46 +01:00
Stefan Metzmacher
39ae4737e0 libcli/smb/smb2_signing: implement aes_cmac_128 based signing for SMB 2.24
metze
2012-02-29 03:16:23 +01:00
Stefan Metzmacher
7f5e56971f libcli/smb/smb2_signing: add smb2_key_deviration()
This implements a simplified version of "NIST Special Publication 800-108" section 5.1
using hmac-sha256.

Thanks to Jeremy, Michael and Volker for the debugging!

metze
2012-02-29 03:16:23 +01:00
Stefan Metzmacher
615c41ce12 libcli/smb/smb2_signing: pass down 'protocol' to smb2_signing_[sign|check]_pdu()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Feb 27 14:26:32 CET 2012 on sn-devel-104
2012-02-27 14:26:32 +01:00