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

181 Commits

Author SHA1 Message Date
Stefan Metzmacher
b119ebeab0 r1419: spnego inside of dcerpc using alter_context/alter_context_resp
instead of auth3

metze
(This used to be commit 19b0567ee5)
2007-10-10 12:56:54 -05:00
Andrew Bartlett
dc9f55dbec r1294: A nice, large, commit...
This implements gensec for Samba's server side, and brings gensec up
to the standards of a full subsystem.

This means that use of the subsystem is by gensec_* functions, not
function pointers in structures (this is internal).  This causes
changes in all the existing gensec users.

Our RPC server no longer contains it's own generalised security
scheme, and now calls gensec directly.

Gensec has also taken over the role of auth/auth_ntlmssp.c

An important part of gensec, is the output of the 'session_info'
struct.  This is now reference counted, so that we can correctly free
it when a pipe is closed, no matter if it was inherited, or created by
per-pipe authentication.

The schannel code is reworked, to be in the same file for client and
server.

ntlm_auth is reworked to use gensec.

The major problem with this code is the way it relies on subsystem
auto-initialisation.  The primary reason for this commit now.is to
allow these problems to be looked at, and fixed.

There are problems with the new code:
- I've tested it with smbtorture, but currently don't have VMware and
  valgrind working (this I'll fix soon).
- The SPNEGO code is client-only at this point.
- We still do not do kerberos.

Andrew Bartlett
(This used to be commit 07fd885fd4)
2007-10-10 12:56:49 -05:00
Andrew Bartlett
be081037e0 r1200: Add 'gensec', our generic security layer.
This layer is used for DCERPC security, as well as ntlm_auth at this
time.  It expect things like SASL and the CIFS layer to use it as
well.

The particular purpose of this layer is to introduce SPENGO, which
needs generic access to the actual implementation mechanisms.

Schannel, due to it's 'interesting' setup properties is in GENSEC, but
is only in the RPC code.

Andrew Bartlett
(This used to be commit 902af49006)
2007-10-10 12:56:44 -05:00
Stefan Metzmacher
c0871cb0c1 r1068: make the dcerpc client side auth/crypto code much more generic
metze
(This used to be commit 1706ff88a7)
2007-10-10 12:56:36 -05:00
Andrew Tridgell
8a3d1a5fb7 r1042: added testing of 128 bit schannel session keys
(This used to be commit 96fc2b6f1e)
2007-10-10 12:56:33 -05:00
Andrew Tridgell
a1318baa55 r1041: - pulled the domain join code out of the netlogon test and made it a separate utility function, to allow
multiple torture tests to temporarily join a domain

- fixed a session key size problem

- added a schannel test suite

- allow schannel to work with ncacn_ip_tcp
(This used to be commit 36f05e4d57)
2007-10-10 12:56:33 -05:00
Stefan Metzmacher
770e3307ce r962: convert 'unsigned' and 'unsigned int' to uint_t
metze
(This used to be commit 57151e80eb)
2007-10-10 12:56:23 -05:00
Stefan Metzmacher
98d291423f r961: convert 'uchar' to 'uint8_t'
metze
(This used to be commit 9f914e4af9)
2007-10-10 12:56:23 -05:00
Stefan Metzmacher
f9d8f8843d r884: convert samba4 to use [u]int32_t instead of [u]int32
metze
(This used to be commit 0e5517d937)
2007-10-10 12:56:15 -05:00
Andrew Bartlett
5b0ab386cb r874: This patch is a pile of work on NTLMSSP:
Samba's NTLMSSP code is now fully talloc based, which should go a long
way to cleaning up the memory leaks in this code.  This also avoids a
lot of extra copies of data, as we now allocate the 'return' blobs on
a caller-supplied context.

I have also been doing a lot of work towards NTLM2 signing and
sealing.  I have this working for sealing, but not for the verifier
(MD5 integrity check on the stream) which is still incorrect.

(I can aim a rpcecho sinkdata from a Win2k3 box to my server, and the
data arrives intact, but the signature check fails.  It does however
match the test values I have...).

The new torture test is cludged in - when we get a unit test suite
back, I'll happliy put it in the 'right' place....

Andrew Bartlett
(This used to be commit 399e2e2b11)
2007-10-10 12:56:14 -05:00
Andrew Bartlett
dce84ffd37 r610: - Merge the Samba3 'ntlm_auth --diagnostics' testsuite to Samba4.
- This required using NETLOGON_NEG_AUTH2_FLAGS for the
    SetupCredentials2 negotiation flags, which is what Samba3 does,
    because otherwise the server uses different crypto.
  - This tests the returned session keys, which we decrypt.

 - Update the Samba4 notion of a 'session key' to be a DATA_BLOB in
   most places.

 - Fix session key code to return NT_STATUS_NO_SESSION_KEY if none is
   available.

 - Remove a useless argument to SMBsesskeygen_ntv1

 - move netr_CredentialState from the .idl to the new credentials.h

Andrew Bartlett
(This used to be commit 44f8b5b53e)
2007-10-10 12:51:51 -05:00
Andrew Tridgell
3fe884c26c r390: added my best guess for how session keys are supposed to work when you
use NTLMSSP sign or seal at the RPC layer

It doesn't work yet, but then again neither does the old code (which
just assumed the SMB session key was used, which of course makes no
sense on a ncacn_ip_tcp connection)
(This used to be commit e878232926)
2007-10-10 12:51:37 -05:00
Andrew Tridgell
078cced5ec - modified the dcerpc client security code to be generic, so ntlmssp
and schannel are both instances of possible security modules

- added schannel sign and sign/seal support to the dcerpc client
  code. You select it with binding options of "schannel,sign" or
  "schannel,seal".
(This used to be commit 05db0b9d94)
2004-02-10 10:22:12 +00:00
Andrew Tridgell
fb15b95bc5 added a little bit of const magic to get rid of the data in librpc/gen_ndr/*.o
(This used to be commit 866ef2edab)
2004-01-22 01:12:43 +00:00
Andrew Tridgell
8ae5b50a6e added code to the RPC-SPOOLSS test that demonstrates that policy
handles are not shared between open dcerpc connections, even when
those connections are on the same SMB socket. I have tested this with
w2k3, w2k and NT4. It seems that policy handles have a strict scope of
the dcerpc connection on which they were opened.

I realise that this goes against existing folk-law in the team, but it
seems that the previous testing (I'm not sure who did this?) was
wrong. Perhaps clients do send us policy handles from other
connections, but if they do then the correct thing to do is to fail
the operation with a dcerpc fault. I suspect that failing it with
exactly the right dcerpc fault code is important.
(This used to be commit 2ed24d29ba)
2004-01-20 06:07:09 +00:00
Andrew Tridgell
24c22aef90 a fairly large commit!
This adds support for bigendian rpc in the client. I have installed
SUN pcnetlink locally and am using it to test the samba4 rpc
code. This allows us to easily find places where we have stuffed up
the types (such as 2 uint16 versus a uint32), as testing both
big-endian and little-endian easily shows which is correct. I have now
used this to fix several bugs like that in the samba4 IDL.

In order to make this work I also had to redefine a GUID as a true
structure, not a blob. From the pcnetlink wire it is clear that it is
indeed defined as a structure (the byte order changes). This required
changing lots of Samba code to use a GUID as a structure.

I also had to fix the if_version code in dcerpc syntax IDs, as it
turns out they are a single uint32 not two uint16s.

The big-endian support is a bit ugly at the moment, and breaks the
layering in some places. More work is needed, especially on the server
side.
(This used to be commit bb1af644a5)
2003-12-16 09:02:58 +00:00
Andrew Tridgell
71f81d1d3e allow the specification of full dcerpc endpoint binding strings on the
command line. This allows you to (for example) control signing/sealing
of smbtorture RPC sessions
(This used to be commit a73825eb49)
2003-12-15 03:29:55 +00:00
Andrew Tridgell
e5ed18db65 more portable array of endpoints code from pidl
(This used to be commit c598590a11)
2003-12-10 23:49:55 +00:00
Andrew Tridgell
ba33beec05 * added a bunch of placeholder IDL files
* allow for an interface to list its endpoints in the IDL file, so we
   can automatically make the server listen on the right pipes, and
   can scan pipes more easily (I don't take advantage of this yet,
   just putting the infrastructure in place)
(This used to be commit c8b8480244)
2003-11-28 05:20:11 +00:00
Andrew Tridgell
ab3d728b7e added an rpc scanner. This prints messages like this:
uuid 82273fdc-e32a-18c3-3f78-827929dc23ea  version 0x0000:0x0000  'eventlog'
        24 calls available
        WARNING: local IDL defines 4 calls

when all the WARNINGs are gone then we know we have all the calls :)
(This used to be commit f5821b2468)
2003-11-27 05:34:28 +00:00
Andrew Tridgell
a9203bf02b a couple of tidyups
* don't try to map the epmapper uuid !

 * some preliminary support for alter context pdus
(This used to be commit f9857e5685)
2003-11-27 04:02:15 +00:00
Andrew Tridgell
1ca1b85c4c by default sign RPC over TCP but not RPC over SMB. I will add command line control soon
(This used to be commit 215852116c)
2003-11-26 12:29:08 +00:00
Andrew Tridgell
e0ac659917 signed DCERPC over TCP now works !
* moved ntlmssp code into libcli/auth/, and updated to latest ntlmssp
   code from samba3 (thanks Andrew! the new interface is great)

 * added signing/ntlmssp support in the dcerpc code

 * added a dcerpc_auth.c module for the various dcerpc auth mechanisms
(This used to be commit c18c9b5585)
2003-11-26 01:16:41 +00:00
Andrew Tridgell
bbb11d4a0d * prepared the dcerpc subsystem for adding the RPC over TCP transport
* fixed a uninitialised variable bug in pidl (found by valgrind)
(This used to be commit 8bce61b8af)
2003-11-24 11:45:33 +00:00
Andrew Tridgell
3d0e6b3835 added a tool called 'ndrdump' that allows you to dump NDR data
according to the current IDL taking the data from a file. In
combination with a little hack to ethereal to extract data this is a
quite powerful IDL development tool.
(This used to be commit 229a325c3c)
2003-11-23 13:44:19 +00:00
Andrew Tridgell
800d3e0134 ooh, this is fun!
I have recoded the core dcerpc packet structures (all the PDUs etc) in
terms of IDL, which means we now use pidl to generate all the code for
handling the most basic dcerpc packets. This is not normally possible
as it isn't completely valid NDR, but pidl has a number of extensions
that make it quite easy.

This also means we get the server side dcerpc
marshalling/unmarshalling code for free.
(This used to be commit 92bcad0258)
2003-11-23 06:28:12 +00:00
Andrew Tridgell
86a604429e a fairly major upgrade to the dcerpc system
* added a NDR validator. The way it works is that when the
   DCERPC_DEBUG_VALIDATE_* flags are set the dcerpc system will
   perform NDR buffer validation. On sending a request the packet is
   first marshalled, then unmarahslled, then marshalled again, and it is
   confirmed that the two marshalling results are idential. This
   ensures that our pull and push routines are absolutely in sync, so
   that we can be very confident that if a routine works in the client
   then the corresponding routine must work on the server side. A
   similar validation is performed on all replies.

 * a result of this change is that pidl is fussier about the [ref]
   tag. You can only use it on pointers (which is the only place it
   makes sense)

 * fixed a basic alignment bug in the push side of the NDR code

 * added server side pull/push support. Our dcerpc system is now fully
   ready to be used on the server side.

 * fixed the relative offset pointer list. It must be traversed in
   reverse order on push

 * added automatic value setting for the size parameter in outgoing
   SdBuf structures.

 * expanded the ndr debugging code to always give a message on any
   failure

 * fixed the subcontext push code

 * fixed some memory leaks in smbtorture RPC tests
(This used to be commit 8ecf720206)
2003-11-22 08:11:32 +00:00
Andrew Tridgell
13e10b47fb separate the reason and result codes in a bind_ack. This is needed for
interop with the opengroup dcerpc code
(This used to be commit 8d9061dcd0)
2003-11-19 03:01:57 +00:00
Andrew Tridgell
9b7b5e5c51 use the auto-generated UUID, version and name rather than listing them
in the dcerpc core code
(This used to be commit 16ffeb7c80)
2003-11-18 05:01:10 +00:00
Andrew Tridgell
2c0a7165ef * use the new auto-generated debug code method.
* add a couple more info levels to wkssvc
(This used to be commit c69161bdb1)
2003-11-18 01:18:24 +00:00
Andrew Tridgell
4fa0f615f2 another major bit of restructuring of rpc in Samba4. Mostly moving
files around, but also added the first bits of auto-generated code for
the lsa pipe.

I haven't updated the Makefile to call pidl yet, so for now the code
was cut-and-pasted into librpc/ndr/ndr_lsa.c manually
(This used to be commit 6b222d3b65)
2003-11-06 12:34:04 +00:00