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

368 Commits

Author SHA1 Message Date
Günther Deschner
77e3fffd09 s3-dcerpc: add dcerpc_pull_ncacn_packet_header().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-08 00:29:33 -04:00
Günther Deschner
eeb034e72a s3-dcerpc: use dcerpc_push_dcerpc_auth() for all authenticated binds.
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:51 -04:00
Günther Deschner
4b56e6e95b s3-dcerpc: add dcerpc_push_schannel_bind().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:51 -04:00
Günther Deschner
0f02dda915 s3-dcerpc: add dcerpc_push_dcerpc_auth().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:51 -04:00
Günther Deschner
5aabd9af8e s3-dcerpc: use dcerpc_push_ncacn_packet() for create_bind_or_alt_ctx_internal().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:51 -04:00
Günther Deschner
d6de820480 s3-dcerpc: use dcerpc_pull_ncacn_packet() for pulling a RPC fault pdu.
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:50 -04:00
Günther Deschner
cb9eddb312 s3-dcerpc: add dcerpc_pull_ncacn_packet().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:50 -04:00
Günther Deschner
3d9a12dca7 s3-dcerpc: add dcerpc_push_ncacn_packet().
Guenther

Signed-off-by: Simo Sorce <idra@samba.org>
2010-07-07 23:45:50 -04:00
Volker Lendecke
dee72d807f s3: Remove an unreachable line of code 2010-06-21 15:03:59 +02:00
Jeremy Allison
2e8c563961 Second part of fix converting prs_XX struct and functions to talloc. Remove unneeded prs_mem_free calls.
Jeremy.

Signed-off-by: Simo Sorce <idra@samba.org>
2010-06-18 07:42:05 -04:00
Jeremy Allison
f4e7d9d38e Convert the prs_XXX struct and functions to use talloc instead of malloc. Passes valgrind and make tests for client and server. Second version of this patch after splitting up at Simo's request. Patch to follow will delete extraneous prs_mem_free() calls.
Jeremy.

Signed-off-by: Simo Sorce <idra@samba.org>
2010-06-18 07:41:47 -04:00
Andrew Bartlett
d6fa371b92 s3:ntlmssp Use a TALLOC_CTX for ntlmssp_sign_packet() and ntlmssp_seal_packet()
This ensures the results can't be easily left to leak.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:11:27 +02:00
Andrew Bartlett
ebae21f023 ntlmssp: Make the ntlmssp.h from source3/ a common header
The code is not yet in common, but I hope to fix that soon.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:56 +02:00
Günther Deschner
5ed3654112 s3-rpc_client: move protos to cli_netlogon.h
Guenther
2010-05-18 21:42:37 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Stefan Metzmacher
3e70da3f47 s3:rpc_client: return at least 10 sec as old timeout in rpccli_set_timeout() instead of 0
metze
2010-03-29 18:11:17 +02:00
Stefan Metzmacher
99664ad154 s3:rpc_client: add set_timeout hook to rpc_cli_transport
metze
2010-03-29 18:11:17 +02:00
Stefan Metzmacher
4f41b53487 s3:rpc_client: add rpccli_is_connected()
metze
2010-03-29 18:11:16 +02:00
Stefan Metzmacher
dc09b12681 s3:rpc_client: don't mix layers and keep a reference to cli_state in the caller
We should not rely on the backend to have a reference to the cli_state.
This will make it possible for the backend to set its cli_state reference
to NULL, when the transport is dead.

metze
2010-03-29 18:11:16 +02:00
Stefan Metzmacher
7d977da925 s3:ntlmssp: pass names and use_ntlmv2 to ntlmssp_client_start() and store them
Inspired by the NTLMSSP merge work by Andrew Bartlett.

metze

Signed-off-by: Günther Deschner <gd@samba.org>
2010-03-24 17:34:55 +01:00
Jeremy Allison
7b4387f765 Fix bug #7146 - Samba miss-parses authenticated RPC packets.
Parts of the Samba RPC client and server code misinterpret authenticated
packets.

DCE authenticated packets actually look like this :

+--------------------------+
|header                    |
| ... frag_len (packet len)|
| ... auth_len             |
+--------------------------+
|                          |
| Data payload             |
...                     ....
|                          |
+--------------------------+
|                          |
| auth_pad_len bytes       |
+--------------------------+
|                          |
| Auth footer              |
| auth_pad_len value       |
+--------------------------+
|                          |
| Auth payload             |
| (auth_len bytes long)    |
+--------------------------+

That's right. The pad bytes come *before* the footer specifying how many pad
bytes there are. In order to read this you must seek to the end of the packet
and subtract the auth_len (in the packet header) and the auth footer length (a
known value).

The client and server code gets this right (mostly) in 3.0.x -> 3.4.x so long
as the pad alignment is on an 8 byte boundary (there are some special cases in
the code for this).

Tridge discovered there are some (DRS replication) cases where on 64-bit
machines where the pad alignment is on a 16-byte boundary. This breaks the
existing S3 hand-optimized rpc code.

This patch removes all the special cases in client and server code, and allows
the pad alignment for generated packets to be specified by changing a constant
in include/local.h (this doesn't affect received packets, the new code always
handles them correctly whatever pad alignment is used).

This patch also works correctly with rpcclient using sign+seal from
the 3.4.x and 3.3.x builds (testing with 3.0.x and 3.2.x to follow)
so even as a server it should still work with older libsmbclient and
winbindd code.

Jeremy
2010-02-17 15:27:59 -08:00
Bo Yang
36493bf2f6 s3: Fix infinite loop in NCACN_IP_TCP asa there is no timeout. Assume lsa_pipe_tcp is ok but network is down, then send request is ok, but select() on writeable fds loops forever since there is no response.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-01-06 19:19:35 +08:00
Andrew Bartlett
802e9328ed s3:ntlmssp: only include ntlmssp.h where actually needed
Andrew Bartlett
2009-12-22 21:07:53 +01:00
Andrew Bartlett
5b37cd23bf s3:ntlmssp: remove the typedef NTLMSSP_STATE
Andrew Bartlett
2009-12-22 21:07:53 +01:00
Günther Deschner
04f8c229de s3-kerberos: only use krb5 headers where required.
This seems to be the only way to deal with mixed heimdal/MIT setups during
merged build.

Guenther
2009-11-27 16:36:00 +01:00
Günther Deschner
5d706a2fd4 s3-rpc: running minimal_includes.pl on rpc_client and rpc_server.
Guenther
2009-11-26 20:17:07 +01:00
Jeremy Allison
0363713031 Remove erroneous 'presult = NULL' changes. Now presult only gets set
if NTSTATUS == OK.
Jeremy.
2009-11-12 13:59:25 -08:00
Jeremy Allison
496d147dc4 Revert "Ensure every return path initializes presult as NULL."
Vl is correct, this is the wrong way to fix this.

This reverts commit 83c2c177a5.
2009-11-12 13:57:13 -08:00
Jeremy Allison
5363d6e62c Ensure all callers to the rpc_client/cli_pipe functions correctly
initialize return variables.
Jeremy.
2009-11-12 13:56:33 -08:00
Jeremy Allison
83c2c177a5 Ensure every return path initializes presult as NULL.
Ensures no crashes in calling code that forgets to
init return as null.
Jeremy.
2009-11-12 11:49:54 -08:00
Günther Deschner
d241b9ae4c s3-rpc_client: make sure cli_rpc_pipe_open_schannel() does not always return NT_STATUS_OK.
Guenther
2009-11-10 13:10:12 +01:00
Volker Lendecke
bb283af16f Revert "s3: Do not directly reference the ndr_table_* in rpcclient"
This reverts commit 70c698fd54.
2009-11-08 19:43:47 +01:00
Volker Lendecke
70c698fd54 s3: Do not directly reference the ndr_table_* in rpcclient 2009-11-08 00:28:36 +01:00
Volker Lendecke
cd16e38e32 s3: Register the ndr_interfaces dynamically 2009-11-07 09:14:16 +01:00
Volker Lendecke
268df12ab6 s3: Get rid of a NULL terminator 2009-11-07 09:14:16 +01:00
Volker Lendecke
a32c425f91 s3: Get rid of explicit pipe names 2009-11-07 09:14:16 +01:00
Volker Lendecke
2aa0af9867 s3: get_pipe_name_from_iface -> get_pipe_name_from_syntax 2009-11-07 09:14:15 +01:00
Günther Deschner
60bf0eb607 s3-kerberos: modify cli_krb5_get_ticket to take a new impersonate_princ_s arg.
Guenther
2009-11-06 13:31:17 +01:00
Volker Lendecke
b067a5e4e8 s3: Remove debug_ctx()
smbd just crashed on me: In a debug message I called a routine preparing a
string that itself used debug_ctx. The outer routine also used it after the
inner routine had returned. It was still referencing the talloc context
that the outer debug_ctx() had given us, which the inner DEBUG had already
freed.
2009-11-03 11:30:00 +01:00
Günther Deschner
ebe0e64ba9 s3: use enum netr_SchannelType all over the place.
Guenther
2009-10-13 10:21:46 +02:00
Volker Lendecke
84de81b478 s3: Remove a scary error message -- talloc_move can not fail :-)
Signed-off-by: Günther Deschner <gd@samba.org>
2009-10-05 12:14:08 +02:00
Stefan Metzmacher
68b8149d1f s3:rpc_client: don't randomly fragment rpc pdu's in developer mode
This is really confusing and also breaks against windows,
as it doesn't accept fragmented bind requests.

metze
2009-09-25 05:20:16 +02:00
Günther Deschner
503d035814 spnego: share spnego_parse.
Guenther
2009-09-17 01:12:20 +02:00
Stefan Metzmacher
033ced60ac libcli/auth: rewrite schannel sign/seal code to be more generic
This prepares support for HMAC-SHA256/AES.

metze
2009-09-16 12:29:06 +02:00
Günther Deschner
37bc806453 s3-dcerpc: remove more obsolete or duplicate headers.
Guenther
2009-09-16 08:55:51 +02:00
Günther Deschner
c5c04fcf90 s3-schannel: add dump_NL_AUTH_SIGNATURE.
Guenther
2009-09-16 07:54:02 +02:00
Günther Deschner
799f8d7e13 schannel: fully share schannel sign/seal between s3 and 4.
Guenther
2009-09-16 01:55:06 +02:00
Günther Deschner
f8014d30e7 s3-schannel: fix blob length when pulling off a NL_AUTH_SIGNATURE in
cli_pipe_verify_schannel().

Guenther
2009-09-16 00:11:23 +02:00
Günther Deschner
c2d7c7a9dd s3-dcerpc: fix remaining old auth level constants.
Guenther
2009-09-15 18:30:44 +02:00