summaryrefslogtreecommitdiffstats
path: root/libcli/smb
Commit message (Collapse)AuthorAgeFilesLines
* libcli/smb: only force signing of smb2 session setups when binding a new sessionStefan Metzmacher2014-12-121-1/+6
| | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10958 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): Fri Dec 12 23:11:40 CET 2014 on sn-devel-104
* s3:smbd: add SMB2 AAPL create context definesRalph Boehme2014-12-042-0/+47
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Revert "libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1"Stefan Metzmacher2014-11-271-1/+0
| | | | | | | | | This reverts commit a6affb7bb3ff595165e708c56ede2181f0bb570f. This is not really needed. The caller should ignore this flag. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli: SMB2: Pure SMB2-only negprot fix to make us behave as a Windows ↵Jeremy Allison2014-11-262-0/+11
| | | | | | | | | | client does. Required as some servers return zero when asked for zero credits in an initial SMB2-only negprot. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <rb@sernet.de>
* libcli/smb: Add smb2_lease_equal() which compares client_guids and keys.Jeremy Allison2014-11-072-0/+13
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 7 22:41:47 CET 2014 on sn-devel-104
* libcli/smb: add smb2_lease_key_equal() helper functionVolker Lendecke2014-11-072-0/+8
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: mask off SMB2_LEASE_FLAG_PARENT_LEASE_KEY_SET for version 1Volker Lendecke2014-11-071-0/+1
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: remember the lease_version in struct smb2_leaseVolker Lendecke2014-11-071-0/+1
| | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: try to negotiate SMB2_ENCRYPTION_AES128_GCMStefan Metzmacher2014-10-161-4/+8
| | | | | | | | 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 16 21:53:32 CEST 2014 on sn-devel-104
* libcli/smb: support SMB2_ENCRYPTION_AES128_GCM in ↵Stefan Metzmacher2014-10-161-0/+32
| | | | | | | smb2_signing_[de|en]crypt_pdu() Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: prepare smb2_signing_[de|en]crypt_pdu() to support multiple ciphersStefan Metzmacher2014-10-161-30/+52
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: pass the negotiated cipher to smb2_signing_[de|en]ncrypt_pdu()Stefan Metzmacher2014-10-161-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: pass 'uint16_t cipher_id' to smb2_signing_[de|en]crypt_pdu()Stefan Metzmacher2014-10-162-4/+4
| | | | | | | | enum protocol_types protocol was unused before and cipher_id is unused as well for now. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: use conn->smb2.server.cipher != 0 instead of ↵Stefan Metzmacher2014-10-161-23/+8
| | | | | | | | | | | conn->smb2.server.capabilities & SMB2_CAP_ENCRYPTION SMB 3.10 servers don't report SMB2_CAP_ENCRYPTION anymore. So using conn->smb2.server.cipher != 0 is a more consistent way to decide if encryption is supported on the connection. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: use lib/crypto SHA512 functions, do not depend on heimdal.Günther Deschner2014-10-141-13/+13
| | | | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Oct 14 13:13:08 CEST 2014 on sn-devel-104
* s3-winbindd: Allow winbindd to connect over SMB2 to serversAndrew Bartlett2014-10-081-1/+2
| | | | | | | | | | | This allows SMB signing to work against many more DCs, and so improves network security. The default for "client max protocol" remains NT1 in the rest of the code. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: remove unused SMB2_TF_ALGORITHM defineStefan Metzmacher2014-10-081-1/+0
| | | | | | | | 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): Wed Oct 8 01:08:40 CEST 2014 on sn-devel-104
* libcli/smb: use SMB 3.10 flags for the transform headerStefan Metzmacher2014-10-071-6/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: pass tcon flags to the server for SMB 3.10Stefan Metzmacher2014-10-071-0/+5
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: avoid validate info after tcon for SMB 3.10Stefan Metzmacher2014-10-071-0/+5
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* libcli/smb: implement SMB 3.10 session setupStefan Metzmacher2014-10-073-21/+155
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: implement SMB 3.10 negprotStefan Metzmacher2014-10-071-6/+251
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: add smb2cli_req_get_send_iov()Stefan Metzmacher2014-10-072-0/+38
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: add smb2_negotiate_context.cStefan Metzmacher2014-10-073-0/+248
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: add SMB 3.10 related definesStefan Metzmacher2014-10-071-2/+17
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: negotiate SMB3_DIALECT_REVISION_310 if PROTOCOL_SMB3_10 is requestedStefan Metzmacher2014-10-071-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: add PROTOCOL_SMB3_10Stefan Metzmacher2014-10-071-2/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: add SMB3_DIALECT_REVISION_310 defineStefan Metzmacher2014-10-071-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libcli/smb: fix smb2cli_validate_negotiate_info with min=PROTOCOL_NT1 ↵Stefan Metzmacher2014-10-071-1/+5
| | | | | | | | | | 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>
* s3: smb2cli: query info return length check was reversed.Jeremy Allison2014-10-021-1/+1
| | | | | | | | | | | | | 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
* libcli/smb: call smb2cli_validate_negotiate_info*() after each authenticated ↵Stefan Metzmacher2014-09-301-0/+40
| | | | | | | tcon Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: add smb2cli_validate_negotiate_info*()Stefan Metzmacher2014-09-302-17/+243
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: list NT_STATUS_FILE_CLOSED as expected ioctl response.Stefan Metzmacher2014-09-301-1/+11
| | | | | | | | | | | | | | | 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>
* libcli/smb: move smb2cli_tcon.c to the toplevelStefan Metzmacher2014-09-303-0/+327
| | | | | | | removing use of cli_state from the code. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: add smb2cli_tcon_{should_sign,is_signing_on}()Stefan Metzmacher2014-09-302-0/+24
| | | | | | | 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>
* libcli/smb: add smb2cli_tcon_should_encrypt()Stefan Metzmacher2014-09-302-0/+8
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: add smbXcli_session_is_authenticated()Stefan Metzmacher2014-09-302-0/+25
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: support additional_flags = SMB2_HDR_FLAG_SIGNEDStefan Metzmacher2014-09-301-0/+10
| | | | | | | | 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>
* libcli: Fix a segfault calling smbXcli_req_set_pending() on NULL.Andreas Schneider2014-09-231-1/+0
| | | | | | | | | | 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
* libcli/smb: Add routines to enable/disable SMB2_HDR_FLAG_REPLAY_OPERATION flag.Anubhav Rakshit2014-09-192-0/+22
| | | | | | Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: Add routine to reset the Channel Sequence number.Anubhav Rakshit2014-09-192-0/+13
| | | | | | Signed-off-by: Anubhav Rakshit <anubhav.rakshit@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli/smb: correctly report disconnect errors after getting STATUS_PENDINGStefan Metzmacher2014-09-191-4/+7
| | | | | | | | 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>
* lib: Reduce deps for "smb_transport"Volker Lendecke2014-09-181-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* libcli: Make smb2cli_create return blobsVolker Lendecke2014-06-303-6/+19
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Make smb2cli_create cancellableVolker Lendecke2014-06-211-0/+13
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Put the "smb2_lease" struct into idlVolker Lendecke2014-06-123-20/+5
| | | | | | | | | | | | 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
* add FSCTL_SET_ZERO_ON_DEALLOCATION defineBjörn Jacke2014-05-151-0/+1
| | | | | | | | 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
* add FSCTL_SET_ZERO_DATA fsctl defineBjörn Jacke2014-05-151-0/+1
| | | | | | | | 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>
* s3: client - rename 'struct smb2_create_returns' to 'struct ↵Jeremy Allison2014-05-093-7/+7
| | | | | | | 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>
* libcli/smb: add smb_signing_is_desired()Stefan Metzmacher2014-04-162-0/+6
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>