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

1443 Commits

Author SHA1 Message Date
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
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
cd82d4ba56 s3: add perfcount idl and generated files.
Guenther
2009-10-01 12:19:43 +02:00
Günther Deschner
afdea18fcf s3-rpc_parse: remove unused prs_string.
Guenther
2009-09-30 16:22:34 +02:00
Günther Deschner
76bb380839 s3-rpc_parse: remove unused UNISTR2 struct and init function.
Guenther
2009-09-30 00:33:47 +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
97d7a524ab s3-schannel: remove unused schannel_decode/schannel_encode.
Guenther
2009-09-16 01:55:13 +02:00
Günther Deschner
d3af0346c8 s3-dcerpc: use dcerpc_AuthLevel and remove duplicate set of flags.
Guenther
2009-09-15 17:49:34 +02:00
Günther Deschner
07031464c4 s3-schannel: fix Coverity #950 OVERRUN_STATIC.
Guenther
2009-09-13 21:21:54 +02:00
Günther Deschner
c4f6fb0b2d s3-schannel: remove last schannel hand-marshalling function.
Guenther
2009-09-11 03:00:43 +02:00
Günther Deschner
d258fb4d0d s3-schannel: use NL_AUTH_SIGNATURE for schannel sign & seal (client & server).
Guenther
2009-09-11 03:00:35 +02:00
Günther Deschner
a155f3f9a9 s3-schannel: remove unused code.
Guenther
2009-09-11 02:57:35 +02:00
Günther Deschner
a48f884f70 s3: remove unused RPC_AUTH_SCHANNEL_NEG struct and parsing functions.
Guenther
2009-09-08 17:07:03 +02:00
Günther Deschner
f982c912f4 s3-rpc_parse: remove more unused code.
Guenther
2009-07-16 03:05:45 +02:00
Volker Lendecke
e77e21e0f1 Add const to init_rpc_hdr_ba 2009-07-05 23:50:12 +02:00
Volker Lendecke
58fbf7420c Remove "typedef struct ndr_syntax_id RPC_IFACE;" 2009-07-05 23:50:12 +02:00
Andrew Bartlett
f28f113d8e Rework Samba3 to use new libcli/auth code (partial)
This commit is mostly to cope with the removal of SamOemHash (replaced
by arcfour_crypt()) and other collisions (such as changed function
arguments compared to Samba3).

We still provide creds_hash3 until Samba3 uses the credentials code in
netlogon server

Andrew Bartlett
2009-04-14 16:23:35 +10:00
Andrew Bartlett
3277b19800 s3:rpc_parse remove unused prs_unistr2()
Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-07 20:51:55 +02:00
Günther Deschner
fe340eb92f s3:rpc_parse: remove unused init_unistr().
Guenther
2009-03-26 10:42:13 +01:00
Günther Deschner
c86df62b4a s3-rpc_parse: remove unused smb_io_domsid().
Guenther
2009-03-25 23:09:52 +01:00
Günther Deschner
72636db8e5 s3: remove unused rpc_parse/parse_sec.c file.
Guenther
2009-03-25 22:50:40 +01:00
Günther Deschner
7d7b1a8dcc s3-rpc_parse: remove some unused parsing code.
Guenther
2009-03-18 22:02:23 +01:00
Günther Deschner
7a85a87edf s3-rpc_parse: remove unused BUFFER5 and UNISTR3.
Guenther
2009-03-18 20:17:01 +01:00
Günther Deschner
a502392541 s3-spoolss: remove rpc_parse/parse_spoolss.c alltogether.
Good-Bye, last hand-marshalled rpc functions, rest in peace.

Guenther
2009-03-18 17:09:26 +01:00
Günther Deschner
a4e999c7e3 s3-spoolss: remove old spoolss_EnumPrinterDataEx.
Guenther
2009-03-18 17:09:18 +01:00
Günther Deschner
9ab8953d74 s3-rpc_parse: move prs_uint64 to rpc_parse/parse_prs.c.
Guenther
2009-03-18 16:43:28 +01:00
Günther Deschner
9fdeb7f7b3 s3-spoolss: remove custom syntax_spoolss and use the syntax defined in IDL.
Guenther
2009-03-18 14:18:42 +01:00
Günther Deschner
f19faa0e76 s3-spoolss: remove unused DEVICEMODE parsing and header.
Guenther
2009-03-17 19:07:30 +01:00
Günther Deschner
d759f9961a s3-spoolss: move SYSTEMTIME parsing to a more generic place, as suggested.
Guenther
2009-03-17 18:39:23 +01:00
Günther Deschner
2d10548ab1 s3: remove rpc_parse/parse_buffer.c completely.
Guenther
2009-03-17 12:21:15 +01:00
Günther Deschner
338c61060b s3-spoolss: remove old spoolss_EnumPrinterKey.
Guenther
2009-03-17 12:19:03 +01:00
Günther Deschner
846b93f54f s3-spoolss: remove old rpccli_spoolss_enumprinterkey wrapper.
Guenther
2009-03-17 12:18:50 +01:00
Günther Deschner
ead6a49218 s3-spoolss: remove spoolss_EnumPrinterData.
Guenther
2009-03-17 12:08:06 +01:00
Günther Deschner
57077f43a7 s3-spoolss: remove rpccli_spoolss_enumprinterdata.
Guenther
2009-03-17 12:07:50 +01:00
Günther Deschner
628c12e53b s3-spoolss: remove old spoolss_SetPrinterData.
Guenther
2009-03-17 11:57:33 +01:00
Günther Deschner
4234969df7 s3-spoolss: remove old rpccli_spoolss_setprinterdata wrapper.
Guenther
2009-03-17 11:57:17 +01:00
Günther Deschner
6dca80518d s3-spoolss: remove old spoolss_GetPrinterData.
Guenther
2009-03-17 11:49:37 +01:00
Günther Deschner
d77cc43784 s3-spoolss: remove old rpccli_spoolss_getprinterdata.
Guenther
2009-03-17 11:49:23 +01:00
Günther Deschner
7a41f299fc s3-spoolss: remove more unused marshalling code.
Guenther
2009-03-13 09:25:26 +01:00
Günther Deschner
348c4b6baa s3-spoolss: remove old spoolss_GetPrinter.
Guenther
2009-03-13 09:25:26 +01:00
Günther Deschner
a1a02bfac2 s3-spoolss: remove old spoolss_EnumPrinters.
Guenther
2009-03-13 09:25:24 +01:00
Günther Deschner
16438e3a93 s3-spoolss: remove old enumprinters wrapper.
Guenther
2009-03-13 09:25:24 +01:00
Günther Deschner
1b3e068e83 s3-spoolss: remove old spoolss_GetPrinterDriver2.
Guenther
2009-03-13 09:25:23 +01:00
Günther Deschner
a540815b5f s3-spoolss: remove old spoolss_EnumPrinterDrivers.
Guenther
2009-03-13 09:25:23 +01:00
Günther Deschner
6928c5ce47 s3-spoolss: remove old rpccli_spoolss_enumprinterdrivers wrapper.
Guenther
2009-03-13 09:25:22 +01:00
Günther Deschner
e605e4503c s3-spoolss: remove old spoolss_GetJob and spoolss_EnumJob.
Guenther
2009-03-13 09:25:22 +01:00
Günther Deschner
3bd1aabcfe s3-spoolss: remove old rpccli_spoolss_enumjobs wrapper.
Guenther
2009-03-13 09:25:21 +01:00
Günther Deschner
c9496ba18a s3-spoolss: remove more leftovers from old enumports call.
Guenther
2009-03-07 01:12:18 +01:00
Günther Deschner
d8a05bd55d s3-spoolss: remove old spoolss_EnumMonitors.
Guenther
2009-03-07 00:55:38 +01:00
Günther Deschner
631f277d1c s3-spoolss: remove old spoolss_EnumPorts.
Guenther
2009-03-07 00:55:36 +01:00