1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

92 Commits

Author SHA1 Message Date
Andrew Bartlett
3549adc7ce r18155: Add my work in progress, a module to link with Cyrus-SASL, for a
DIGEST-MD5 implemenation in particular.

However, I can't make this work:  Cyrus-SASL isn't loading the mech...

Andrew Bartlett
(This used to be commit 0b193d28c896c9d212a536da7d87634543d971a5)
2007-10-10 14:17:43 -05:00
Andrew Bartlett
c3b54cf75b r18068: This splits the handling of multiple SASL packets between the GENSEC
backend (if it chooses to implement it), or the GENSEC socket code.

This is to allow us to handle DIGEST-MD5 across to cyrus-sasl.

Andrew Bartlett
(This used to be commit 0a098006b431f4aa48632a27ca08e9adca8d9609)
2007-10-10 14:17:11 -05:00
Stefan Metzmacher
bdbc9b3908 r17344: move the gensec_update_request structure into the header file
and add a private_data for the backends.

metze
(This used to be commit 015a65e00187e684b3e4d1f4ca07edb9f022f61b)
2007-10-10 14:15:17 -05:00
Stefan Metzmacher
7a845bcb01 r17341: pass a messaging context to auth_context_create()
and gensec_server_start().

calling them with NULL for event context or messaging context
is no longer allowed!

metze
(This used to be commit 679ac74e71b111344f1097ab389c0b83a9247710)
2007-10-10 14:15:17 -05:00
Stefan Metzmacher
de4c2bbc6c r17272: move the callback stuff into a substructure
metze
(This used to be commit c49e27d5d0289e3525f7f6197b031e7d300df81b)
2007-10-10 14:10:26 -05:00
Stefan Metzmacher
64d6abac74 r17267: - add an async interface for gensec_update() to the public gensec api
- note this is still uses the sync update() hook of the gensec modules
  but it allows me to fix the callers first

Later auth_check_password() will also get an async version,
so that we can later implement an async version of auth_winbind
using async IRPC to the winbind task.

metze
(This used to be commit d5638a4fafd1d60ccc4cd76e92a1b2b0093865a7)
2007-10-10 14:10:25 -05:00
Andrew Bartlett
1ea4f560fc r17223: In some protocols it is not possible to negoitate off some features,
without the agreement of the peer.  This can cause problems, because
one side things sealing is disabled, while the other thinks it is
enabled.

Andrew Bartlett
(This used to be commit 68ddc4921f43252b3fba73e9d85cc38c359d599d)
2007-10-10 14:10:20 -05:00
Andrew Bartlett
048d0c64f9 r17171: Add a gensec function to determine the maximum negotiated buffer size,
and the maximum amount of user data that may be fitted into that.

This is used in the new SASL code, to correctly honour SASL buffer sizes.

Andrew Bartlett
(This used to be commit cbbe99d9c1f0262e67a495fb098cacc09fd78e05)
2007-10-10 14:10:15 -05:00
Andrew Bartlett
3ed1e8ff3c r16829: Fix a number of issues raised by the IBM checker, or gcc warnings.
In particular, this removes one use of the LDB_DN_NULL_FAILED macro,
which was being used on more than DNs, had an embedded goto, and
confused the IBM checker.

In the password_hash code, ensure that sambaAttr is not, before
checking the number of values.

In GENSEC, note that this switch value can't occour.  This seems to be
the only way to quiet both the IBM checker and gcc, as well as cope
with possibly invalid inputs.

Andrew Bartlet
(This used to be commit 3e58350ec2ab883795b1dd03ac46a3520cac67d0)
2007-10-10 14:09:48 -05:00
Jelmer Vernooij
c07125d133 r14952: Make sure the auth subsystem gets initialized if a gensec module needs it.
(This used to be commit ecf84248b48783fb0ccbeff4d37d930b21fb96df)
2007-10-10 14:00:22 -05:00
Andrew Bartlett
26137648ab r14713: For testing, it is sometimes useful to specify a hostname for kerberos
that differs from the hostname the connect() uses.

In particular, this helps in running Kerberos tests in 'make test'.

Andrew Bartlett
(This used to be commit 78447333b0fc9450e18cd1d1c15df62acb5f0f36)
2007-10-10 13:59:12 -05:00
Jelmer Vernooij
18cddd580e r14575: Move some path-related functions to libsamba-config so libsamba-util
doesn't have to depend on the lp_* functions.
(This used to be commit f97df7d90a41b77a9edd2d6bdc47c27bf1b6bb07)
2007-10-10 13:58:52 -05:00
Jelmer Vernooij
35349a58df r14542: Remove librpc, libndr and libnbt from includes.h
(This used to be commit 51b4270513752d2eafbe77f9de598de16ef84a1f)
2007-10-10 13:58:42 -05:00
Andrew Tridgell
c061e9089f r14409: quieten warnings
(This used to be commit 2ec2894f72b44ba4e400961921b65b03ad8742de)
2007-10-10 13:57:19 -05:00
Jelmer Vernooij
0fbcfd8920 r13969: Make these names lowercase as well (just like they are now in the buildsystem)
(This used to be commit 04c49e211fc4f80e03d9322b983bbde15baba640)
2007-10-10 13:52:33 -05:00
Jelmer Vernooij
af30a32b69 r13840: Mark some functions as public.
(This used to be commit 9a188eb1f48a50d92a67a4fc2b3899b90074059a)
2007-10-10 13:52:14 -05:00
Jelmer Vernooij
80c8a52286 r13655: Use new name of build header
(This used to be commit bca0e8054f6d9c7adc9d92e0c30d4323f994c9e9)
2007-10-10 13:52:05 -05:00
Stefan Metzmacher
5f7b504cef r13619: fix compiler warning
metze
(This used to be commit 7b284174aa36fdd5d6841dab4934f1f6ecfba4ce)
2007-10-10 13:52:01 -05:00
Andrew Bartlett
f256a9c55e r13342: Make the GSSAPI SASL mech actually work, by (shock horror) reading the spec.
GSSAPI differs from GSS-SPNEGO in an additional 3 packets, negotiating
a buffer size and what integrity protection/privacy should be used.

I worked off draft-ietf-sasl-gssapi-03, and this works against Win2k3.

I'm doing this in the hope that Apple clients as well as SASL-based
LDAP tools may get a bit further.

I still can't get ldapsearch to work, it fails with the ever-helpful
'Local error'.

Andrew Bartlett
(This used to be commit 3e462897754b30306c1983af2d137329dd937ad6)
2007-10-10 13:51:46 -05:00
Andrew Bartlett
a0060cb343 r13245: Don't segfault if we don't have a credentials structure on this gensec
context.

Andrew Bartlett
(This used to be commit 1e840aa43679ceccb2a3afc694a5de0828147e8c)
2007-10-10 13:51:37 -05:00
Andrew Bartlett
44e601b5ad r13206: This patch finally re-adds a -k option that works reasonably.
From here we can add tests to Samba for kerberos, forcing it on and
off.  In the process, I also remove the dependency of credentials on
GENSEC.

This also picks up on the idea of bringing 'set_boolean' into general
code from jpeach's cifsdd patch.

Andrew Bartlett
(This used to be commit 1ac7976ea6e3ad6184c911de5df624c44e7c5228)
2007-10-10 13:51:33 -05:00
Andrew Bartlett
f55ea8bb3d r12804: This patch reworks the Samba4 sockets layer to use a socket_address
structure that is more generic than just 'IP/port'.

It now passes make test, and has been reviewed and updated by
metze. (Thankyou *very* much).

This passes 'make test' as well as kerberos use (not currently in the
testsuite).

The original purpose of this patch was to have Samba able to pass a
socket address stucture from the BSD layer into the kerberos routines
and back again.   It also removes nbt_peer_addr, which was being used
for a similar purpose.

It is a large change, but worthwhile I feel.

Andrew Bartlett
(This used to be commit 88198c4881d8620a37086f80e4da5a5b71c5bbb2)
2007-10-10 13:49:57 -05:00
Andrew Bartlett
8cd5930a4b r12682: This patch finally fixes our kpasswdd implementation to be compatible
with clients compiled against the MIT Kerberos implementation.  (Which
checks for address in KRB-PRIV packets, hence my comments on socket
functions earlier today).

It also fixes the 'set password' operation to behave correctly (it was
previously a no-op).

This allows Samba3 to join Samba4.  Some winbindd operations even work,
which I think is a good step forward.  There is naturally a lot of work
to do, but I wanted at least the very basics of Samba3 domain membership
to be available for the tech preview.

Andrew Bartlett
(This used to be commit 4e80a557f9c68b01ac6d5bb05716fe5b3fd400d4)
2007-10-10 13:49:37 -05:00
Jelmer Vernooij
8b7013fa50 r12628: Prevent double registration warnings
(This used to be commit 98ec52beeed47c71861c284c7aae66269c074e66)
2007-10-10 13:49:09 -05:00
Jelmer Vernooij
aa9f67163c r12620: Get rid of automatically generated lists of init functions of subsystems.
This allows Samba libraries to be used by other projects (and parts of
Samba to be built as shared libraries).
(This used to be commit 44f0aba715bfedc7e1ee3d07e9a101a91dbd84b3)
2007-10-10 13:49:06 -05:00
Jelmer Vernooij
6aafed9600 r12499: Move smb_build.h out of includes.h
(This used to be commit c92ace494f92084ddf178626cdf392d151043bc7)
2007-10-10 13:47:45 -05:00
Jelmer Vernooij
448483199f r12494: Support loading modules from .so files for most subsystems.
We now use a different system for initializing the modules for a subsystem.
Most subsystems now have an init function that looks something like this:

	init_module_fn static_init[] = STATIC_AUTH_MODULES;
	init_module_fn *shared_init = load_samba_modules(NULL, "auth");

	run_init_functions(static_init);
	run_init_functions(shared_init);

	talloc_free(shared_init);

I hope to eliminate the other init functions later on (the
init_programname_subsystems; defines).
(This used to be commit b6d2ad4ce0a91c4be790dd258820c492ff1787ea)
2007-10-10 13:47:45 -05:00
Andrew Bartlett
172a8b477e r12179: Allow our KDC to use LDAP to get to the backend database.
To avoid a circular depenency, it is not allowed to use Krb5 as an
authentication mechanism, so this must be removed from the list.  An
extension to the credentials system allows this function.

Also remove proto.h use for any of the KDC, and use NTSTATUS returns
in more places.

Andrew Bartlett
(This used to be commit 5f9dddd02c9c821675d2ccd07561a55edcd7f5b4)
2007-10-10 13:47:16 -05:00
Andrew Bartlett
61bd609574 r12060: Work towards allowing the credentials system to allow/deny certain
GENSEC mechansims.  This will allow a machine join to an NT4 domain to
avoid even trying kerberos, or a sensitive operation to require it.

Andrew Bartlett
(This used to be commit 11c7a89e523f85afd728d5e5f03bb084dc620244)
2007-10-10 13:47:02 -05:00
Andrew Bartlett
759e40fb4a r11991: Null termainte the list of backends. (Makes it easier to walk the list).
Andrew Bartlett
(This used to be commit fc4202dea88a72de061cb2e1caa7847fae37018f)
2007-10-10 13:46:56 -05:00
Andrew Bartlett
72820aaf92 r11521: Add in client support for checking supportedSASLmechanisms, and then
determining a mechanism to use.

Currently it doesn't to fallbacks like SPNEGO does, but this could be
added (to GENSEC, not to here).

This also adds a new function to GENSEC, which returns a list of SASL
names in our preference order (currently determined by the build
system of all things...).

Also make the similar function used for OIDs in SPNEGO do the same.

This is all a very long-winded way of moving from a hard-coded NTLM to
GSS-SPNEGO in our SASL client...

Andrew Bartlett
(This used to be commit 130eb9bb9a37957614c87e0e6846a812abb51e00)
2007-10-10 13:45:48 -05:00
Andrew Bartlett
372ca26b20 r11200: Reposition the creation of the kerberos keytab for GSSAPI and Krb5
authentication.  This pulls the creating of the keytab back to the
credentials code, and removes the special case of 'use keberos keytab
= yes' for now.

This allows (and requires) the callers to specify the credentials for
the server credentails to GENSEC.  This allows kpasswdd (soon to be
added) to use a different set of kerberos credentials.

The 'use kerberos keytab' code will be moved into the credentials
layer, as the layers below now expect a keytab.

We also now allow for the old secret to be stored into the
credentials, allowing service password changes.

Andrew Bartlett
(This used to be commit 205f77c579ac8680c85f713a76de5767189c627b)
2007-10-10 13:45:00 -05:00
Andrew Bartlett
f281d77824 r10291: The patch optionally (off by default, not available in all cases) allows
Samba to use the target principal name supplied in the mechTokenMIC of
an SPNEGO negTokenInit.

This isn't a great idea for security reasons, but is how Samba3 behaves,
and allows kerberos to function more often in some environments.  It is
only available for CIFS session setups, due to the ordering of the
exchange.

Andrew Bartlett
(This used to be commit f6a645644127ae695a9f7288e0a469f2eb7f3066)
2007-10-10 13:38:13 -05:00
Andrew Bartlett
5edbeca141 r10153: This patch adds a new parameter to gensec_sig_size(), the size of the
data to be signed/sealed.  We can use this to split the data from the
signature portion of the resultant wrapped packet.

This required merging the gsskrb5_wrap_size patch from
lorikeet-heimdal, and fixes AES encrption issues on DCE/RPC (we no
longer use a static 45 byte value).

This fixes one of the krb5 issues in my list.

Andrew Bartlett
(This used to be commit e4f2afc34362953f56a026b66ae1aea81e9db104)
2007-10-10 13:38:04 -05:00
Andrew Bartlett
7e36c7e607 r9416: Cleanups inspired by jra's work to migrate Samba4's NTLMSSP code back
into Samba3.

The NTLMSSP sign/seal code now assumes that GENSEC has already checked
to see if SIGN or SEAL should be permitted.  This simplfies the code
ensures that no matter what the mech, the correct code paths have been
set in place.

Also remove duplication caused by the NTLMv2 code's history, and
document why some of the things a bit funny.

In SPNEGO, create a new routine to handle the negTokenInit creation.
We no longer send an OID for a mech we can't start (like kerberos on
the server without a valid trust account).

Andrew Bartlett
(This used to be commit fe45ef608f961a6950d4d19b4cb5e7c27b38ba5f)
2007-10-10 13:33:36 -05:00
Andrew Tridgell
176ed87e48 r8774: make some gensec errors a bit less verbose
(This used to be commit 2134ca475586ed9e062fbf4ef7222fe286c60c57)
2007-10-10 13:30:04 -05:00
Andrew Bartlett
2fb1e179f6 r7965: Remove the GENSEC password callback structure members, as these are no
longer used.

Andrew Bartlett
(This used to be commit 14be7d95694dd7557af67dc94ee83a983d2f05f6)
2007-10-10 13:18:54 -05:00
Andrew Tridgell
af237084ec r7633: this patch started as an attempt to make the dcerpc code use a given
event_context for the socket_connect() call, so that when things that
use dcerpc are running alongside anything else it doesn't block the
whole process during a connect.

Then of course I needed to change any code that created a dcerpc
connection (such as the auth code) to also take an event context, and
anything that called that and so on .... thus the size of the patch.

There were 3 places where I punted:

  - abartlet wanted me to add a gensec_set_event_context() call
    instead of adding it to the gensec init calls. Andrew, my
    apologies for not doing this. I didn't do it as adding a new
    parameter allowed me to catch all the callers with the
    compiler. Now that its done, we could go back and use
    gensec_set_event_context()

  - the ejs code calls auth initialisation, which means it should pass
    in the event context from the web server. I punted on that. Needs fixing.

  - I used a NULL event context in dcom_get_pipe(). This is equivalent
    to what we did already, but should be fixed to use a callers event
    context. Jelmer, can you think of a clean way to do that?

I also cleaned up a couple of things:

 - libnet_context_destroy() makes no sense. I removed it.

 - removed some unused vars in various places
(This used to be commit 3a3025485bdb8f600ab528c0b4b4eef0c65e3fc9)
2007-10-10 13:18:15 -05:00
Andrew Bartlett
5c6dd5e800 r6800: A big GENSEC update:
Finally remove the distinction between 'krb5' and 'ms_krb5'.  We now
don't do kerberos stuff twice on failure.  The solution to this is
slightly more general than perhaps was really required (as this is a
special case), but it works, and I'm happy with the cleanup I achived
in the process.  All modules have been updated to supply a
NULL-terminated list of OIDs.

In that process, SPNEGO code has been generalised, as I realised that
two of the functions should have been identical in behaviour.

Over in the actual modules, I have worked to remove the 'kinit' code
from gensec_krb5, and placed it in kerberos/kerberos_util.c.

The GSSAPI module has been extended to use this, so no longer requires
a manual kinit at the command line.  It will soon loose the
requirement for a on-disk keytab too.

The general kerberos code has also been updated to move from
error_message() to our routine which gets the Heimdal error string
(which may be much more useful) when available.

Andrew Bartlett
(This used to be commit 0101728d8e2ed9419eb31fe95047944a718ba135)
2007-10-10 13:16:45 -05:00
Tim Potter
8bcfc14d64 r6610: Fix a const warning in the gensec spnego implementation. (A make proto
is required after updating to this version).
(This used to be commit 258d03ef9248b2827db18269e4f0883c73839084)
2007-10-10 13:16:30 -05:00
Andrew Bartlett
53079da638 r6454: Start to migrate NTLMSSP away from it's own API to just use GENSEC.
The aim here is to remove the extra layer of abstraction, and to then
use the credentials code directly in the NTLMSSP layer.

Andrew Bartlett
(This used to be commit b14c530dfd3e56975dea7e30aa8d62d4f2827700)
2007-10-10 13:11:38 -05:00
Andrew Bartlett
7cabdeb7ec r6113: Move GENSEC and the kerberos code out of libcli/auth, and into
auth/gensec and auth/kerberos.

This also pulls the kerberos configure code out of libads (which is
otherwise dead), and into auth/kerberos/kerberos.m4

Andrew Bartlett
(This used to be commit e074d63f3dcf4f84239a10879112ebaf1cfa6c4f)
2007-10-10 13:11:20 -05:00