summaryrefslogtreecommitdiffstats
path: root/libcli
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* samba: pass down size_t instead of int to add_string_to_array().Günther Deschner2014-11-171-1/+1
| | | | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Mon Nov 17 19:53:22 CET 2014 on sn-devel-104
* libcli/nbt: use NDR_SCALAR_PTR_PROTO() and fix the prototype of ↵Stefan Metzmacher2014-11-142-2/+2
| | | | | | | | | ndr_pull_wrepl_nbt_name() This avoids compiler warnings in pidl generated code. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* 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: Make sure status is initialized.Andreas Schneider2014-10-311-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@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>
* Add a status code for VHD support gleaned from some Win8.1 stuff.Richard Sharpe2014-10-061-0/+1
| | | | | Signed-off-by: Richard Sharpe (rsharpe@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: Remove unreachable code in cldap.Andreas Schneider2014-09-281-6/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* libcli: Remove unreachable code in dns_hosts_file.Andreas Schneider2014-09-281-2/+0
| | | | | | | | The count is already checked for 0 above this line so it can never be 0 at this point. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s4: libcli: ldap message - Ensure all asn1_XX returns are checked.Jeremy Allison2014-09-262-391/+397
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Sep 26 03:15:00 CEST 2014 on sn-devel-104
* libcli: auth: Ensure all asn1_XX returns are checked.Jeremy Allison2014-09-261-102/+112
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
* 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: Fix samba-util dep in "errors" moduleVolker Lendecke2014-09-182-17/+9
| | | | | | | | | | | This piece of code pulls in talloc_stackframe and smb_panic into what should be a very simple mapping library. I'm trying to reduce our dependencies right now a bit, and I think the use cases that this fixes (unknown NTSTATUS together with double nt_errstr() calls in the same DEBUG) are rare enough that this is not justified. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* 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>