1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-29 16:23:52 +03:00
Commit Graph

44 Commits

Author SHA1 Message Date
Volker Lendecke
126cb3db4b r8321: Fix some uninitalized variable warnings 2007-10-10 13:20:06 -05:00
Andrew Bartlett
3b9558e82f r8250: More PAC work. We now sucessfully verify the KDC signature from my DC
(I have included the krbtgt key from my test network).

It turns out the krbtgt signature is over the 16 (or whatever,
enc-type dependent) bytes of the signature, not the entire structure.

Also do not even try to use Kerberos or GSSAPI on an IP address, it
will only fail.

Andrew Bartlett
2007-10-10 13:19:25 -05:00
Andrew Bartlett
44b86b7e65 r8016: Get the keyblock arguments correct. (the context struct changed, but
I forgot to update the users)

Andrew Bartlett
2007-10-10 13:18:59 -05:00
Andrew Bartlett
e2015671c2 r7993: Further work on the Krb5 PAC.
We now generate the PAC, and can verifiy both our own PAC and the PAC
from Win2k3.

This commit adds the PAC generation code, spits out the code to get
the information we need from the NETLOGON server back into a auth/
helper function, and adds a number of glue functions.

In the process of building the PAC generation code, some hints in the
Microsoft PAC specification shed light on other parts of the code, and
the updates to samr.idl and netlogon.idl come from those hints.

Also in this commit:

The Heimdal build package has been split up, so as to only link the
KDC with smbd, not the client utils.

To enable the PAC to be veified with gensec_krb5 (which isn't quite
dead yet), the keyblock has been passed back to the calling layer.

Andrew Bartlett
2007-10-10 13:18:57 -05:00
Andrew Bartlett
28e49de929 r7986: Fix the compile, thanks to HotaruT.
This won't actually work until I get the keyblock filled in again, but
at least it will compile.

I first need to decide if we want to keep the server-side gensec_krb5
code at all, now we have the GSSAPI layer doing what we want.

Andrew Bartlett
2007-10-10 13:18:56 -05:00
Andrew Bartlett
6f0e1c80ae r7978: A start again on PAC verification. I have noticed that the kerberos
keys appear at the end of the PAC, which I feel is deliberate (it
makes this much easier).

I still can't make it work, but I'm sure we are closer.

Andrew Bartlett
2007-10-10 13:18:55 -05:00
Andrew Bartlett
2e82743c98 r7968: Pull the PAC from within GSSAPI, rather than only when using our own
'mock GSSAPI'.

Many thanks to Luke Howard for the work he has done on Heimdal for
XAD, to provide the right API hooks in GSSAPI.

Next step is to verify the signatures, and to build the PAC for the
KDC end.

Andrew Bartlett
2007-10-10 13:18:55 -05:00
Andrew Bartlett
14be7d9569 r7965: Remove the GENSEC password callback structure members, as these are no
longer used.

Andrew Bartlett
2007-10-10 13:18:54 -05:00
Andrew Bartlett
bedf92da5c r7843: Use the new Heimdal gsskrb_acquire_creds API. This has the right
lifetime constraints, and works with the in-memory keytab.

Move initialize_krb5_error_table() into our kerberos startup code,
rather than in the GSSAPI code explitly.  (Hmm, we probably don't need
this at all..)

Andrew Bartlett
2007-10-10 13:18:42 -05:00
Andrew Bartlett
c19d5706f4 r7827: Add in-memory keytab to Samba4, using the new MEMORY_WILDCARD keytab
support in Heimdal.

This removes the 'ext_keytab' step from my Samba4/WinXP client howto.

In doing this work, I realised that the replay cache in Heimdal is
currently a no-op, so I have removed the calls to it, and therefore
the mutex calls from passdb/secrets.c.

This patch also includes a replacement 'magic' mechanism detection,
that does not issue extra error messages from deep inside the GSSAPI
code.

Andrew Bartlett
2007-10-10 13:18:41 -05:00
Andrew Tridgell
3a3025485b 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
2007-10-10 13:18:15 -05:00
Andrew Tridgell
d4648249b2 r7352: the internal heimdal build change. This changes quite a few things:
- if you want kerberos now, you need to unpack a lorikeet heimdal
   tree in source/heimdal/. If source/heimdal/ does not exist at
   configure time then all kerberos features are disabled. You cannot
   use an external kerberos library for now. That may change later.

 - moved lib/replace/ config stuff to lib/replace/ and create a
   lib/replace/replace.h. That allows the heimdal build to use our
   portability layer, and prevenets duplicate definitions of functions
   like strlcat()

 - if you do enable heimdal, then you will need to do 'make
   HEIMDAL_EXTERNAL' before you build Samba. That should be fixed once
   I explain the problem to jelmer (the problem is the inability to
   set a depend without also dragging in the object list of the
   dependency. We need this for building the heimdal asn1 compiler and
   et compiler.

 - disabled all of the m4 checks for external kerberos libraries. I
   left them in place in auth/kerberos/, but disabled it in
   configure.in

some of the heimdal_build/ code is still very rough, for example I
don't correctly detect the correct awk, flex, bison replacements for
heimdal_build/build_external.sh. I expect to fix that stuff up over
the next few days.
2007-10-10 13:17:45 -05:00
Andrew Bartlett
63272794c4 r7270: A big revamp to the way we handle kerberos errors in Samba4. We now
fill in the function pointers to handle the logging, and catch all the
kerberos warnings. (Currently at level 3).

To avoid a memory leak, this requries a new function: krb5_freelog(),
which I've added to lorikeet/heimdal.

This also required a revamp to how we handle the krb5_context, so as
to make it easier to handle with talloc destructors.

Andrew Bartlett
2007-10-10 13:17:34 -05:00
Andrew Bartlett
35877387c8 r7240: Don't call our fancy error message routines on a null context.
Andrew Bartlett
2007-10-10 13:17:30 -05:00
Andrew Bartlett
1f68cf7d0e r7218: Don't use an uninitialised variable in an error message.
Andrew Bartlett
2007-10-10 13:17:27 -05:00
Andrew Bartlett
f2e9261925 r6882: Put in configure tests and #ifdef to keep Samba building on older Heimdal.
Andrew Bartlett
2007-10-10 13:16:54 -05:00
Jelmer Vernooij
2d980465af r6838: Remove unnecessary calls to gensec_gsskrb5
Make the build system give a proper warning about this in the future
2007-10-10 13:16:49 -05:00
Tim Potter
f377c71e4f r6810: Rename auth/{ntlmssp,gensec,kerberos} mk and m4 files to be called
config.mk and config.m4 to be consistent with the rest of Samba.
2007-10-10 13:16:46 -05:00
Jelmer Vernooij
a02e077397 r6805: Remove two remaining references to gensec_gsskrb5 2007-10-10 13:16:45 -05:00
Andrew Bartlett
a7e2ecfac9 r6803: Try to bring in the correct GSSAPI headers for the krb5 mech. This
should allow us to ditch the local static storage for OIDs, as well as
fix the build on non-heimdal platforms.

Andrew Bartlett
2007-10-10 13:16:45 -05:00
Andrew Bartlett
0101728d8e 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
2007-10-10 13:16:45 -05:00
Andrew Bartlett
e8cf3d58ec r6796: Remove the gensec_gsskrb5 module, which had had all of it's special
features merged back into gensec_gssapi.

(Removed because I've made some API changes, and it isn't worth
'fixing' the rudundent code to cope with changes)

Andrew Bartlett
2007-10-10 13:16:44 -05:00
Andrew Bartlett
9153d73061 r6792: Allow a mech to fail on the first pass at the packet, and still fall
back to the other options.

Andrew Bartlett
2007-10-10 13:16:43 -05:00
Tim Potter
45a0692be1 r6767: Fix compiler warning. 2007-10-10 13:16:42 -05:00
Andrew Tridgell
6d15e95111 r6740: make gensec_gssapi.c compile again 2007-10-10 13:16:40 -05:00
Andrew Bartlett
77d054c65a r6737: Explain these error returns a bit better.
Andrew Bartlett
2007-10-10 13:16:40 -05:00
Stefan Metzmacher
3536029e8f r6733: GSS_C_DCE_STYLE is not available for most builds
metze
2007-10-10 13:16:39 -05:00
Stefan Metzmacher
491d7804f5 r6730: register gensec_krb5 also with the drcrpc auth type
metze
2007-10-10 13:16:39 -05:00
Andrew Bartlett
400899995b r6729: Fix silly copy-paste bug spotted by metze.
Andrew Bartlett
2007-10-10 13:16:39 -05:00
Andrew Bartlett
c8fbda6bfd r6728: Microsoft relies very strongly on getting the OIDs it expects, so we
must register the 'MS' OID for the domain join to progress.

Andrew Bartlett
2007-10-10 13:16:38 -05:00
Andrew Bartlett
937ee36161 r6727: One more step down the long march to the 'Kerberos domain join'.
This patch allows a suitably patched Heimdal GSSAPI library (detected
in configure) to supply to us the session keys, and further compleats
the gensec_gssapi module.  This is tested for CIFS, but fails for LDAP
at this point (that is what I'll work on next).

We currently fill out the 'session info' from the SAM, like
gensec_krb5 does, but both will need to use the PAC extraction
functions in the near future.

Andrew Bartlett
2007-10-10 13:16:38 -05:00
Stefan Metzmacher
0a61d1f651 r6705: let the gensec module decide if messages can be signed and sealed in a different
order than a strict request - reply sequence

Note: we should also fix the client code...

metze
2007-10-10 13:16:36 -05:00
Stefan Metzmacher
9d86314c44 r6704: fix compiler warning
metze
2007-10-10 13:16:36 -05:00
Andrew Bartlett
9098b9321f r6700: Upper case realms in kerberos-specific parts of the code, as this is
no longer done globally.

This keeps MIT client libraries happy, because otherwise the windows
KDC will return a different case to what was requested.

Andrew Bartlett
2007-10-10 13:16:35 -05:00
Andrew Tridgell
250f1f69dd r6620: the type 23 schannel bind uses a workstation name, not an account name 2007-10-10 13:16:31 -05:00
Tim Potter
258d03ef92 r6610: Fix a const warning in the gensec spnego implementation. (A make proto
is required after updating to this version).
2007-10-10 13:16:30 -05:00
Andrew Bartlett
2f22841c67 r6458: Split up NTLMSSP into a new directory, and into seperate files for the
client and server logic code.  In future, this may allow us to build
only the NTLMSSP client, and not the server, but in the short-term, it
allows me greater sainity in moving around these files.

Andrew Bartlett
2007-10-10 13:11:38 -05:00
Andrew Bartlett
fc3e3653eb r6455: Remove wrapper functions, and ntlmssp_end (which is well handed by talloc() now).
Andrew Bartlett
2007-10-10 13:11:38 -05:00
Andrew Bartlett
b14c530dfd 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
2007-10-10 13:11:38 -05:00
Andrew Bartlett
24f98f32aa r6453: Move verbose errors for the schannel 'not in the DB, or DB corrupt' error cases.
Andrew Bartlett
2007-10-10 13:11:38 -05:00
Andrew Tridgell
e6376b2430 r6340: - added an easy to use function to initialise a temporary ldb with some ldif
- init the schannel.ldb with some CASE_INSENSITIVE attributes
2007-10-10 13:11:33 -05:00
Tim Potter
9c45f8d7bc r6322: Fix compile warning for struct sockaddr. 2007-10-10 13:11:31 -05:00
Stefan Metzmacher
8059315034 r6128: fix the build
metze
2007-10-10 13:11:20 -05:00
Andrew Bartlett
e074d63f3d 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
2007-10-10 13:11:20 -05:00