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

104 Commits

Author SHA1 Message Date
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
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
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
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
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
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
97be49c4d4 libcli/smb: add smb1cli_session_protect_session_key()
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
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
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
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
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
7e0982421b libcli/smb: construct the signing_key before forming the message
metze
2012-07-23 18:19:36 +02:00
Stefan Metzmacher
43085e9b82 libcli/smb/smbXcli: add support for PROTOCOL_SMB3_00
metze
2012-05-06 14:50:39 +02:00