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

193 Commits

Author SHA1 Message Date
Andrew Bartlett
b97d3cb2ef r1498: (merge from 3.0)
Rework our random number generation system.

On systems with /dev/urandom, this avoids a change to secrets.tdb for every fork().

For other systems, we now only re-seed after a fork, and on startup.
No need to do it per-operation.  This removes the 'need_reseed'
parameter from generate_random_buffer().

This also requires that we start the secrets subsystem, as that is
where the reseed value is stored, for systems without /dev/urandom.

In order to aviod identical streams in forked children, the random
state is re-initialised after the fork(), at the same point were we do
that to the tdbs.

Andrew Bartlett
2007-10-10 12:57:35 -05:00
Stefan Metzmacher
65147f5aa2 r1497: add forward declaration for struct auth_session_info
(fix compiler warning)

metze
2007-10-10 12:57:35 -05:00
Stefan Metzmacher
463982bf3f r1494: fix debug message
metze
2007-10-10 12:57:35 -05:00
Andrew Bartlett
30d88580ef r1476: Don't print messages about the CCACHE not being found - this is normal.
Andrew Bartlett
2007-10-10 12:57:34 -05:00
Andrew Bartlett
de5da66939 r1475: More kerberos work
- We can now connect to hosts that follow the SPNEGO RFC, and *do not*
give us their principal name in the mechListMIC.
 - The client code now remembers the hostname it connects to

- We now kinit for a user, if there is not valid ticket already

- Re-introduce clock skew compensation

TODO:
 - See if the username in the ccache matches the username specified
 - Use a private ccache, rather then the global one, for a 'new' kinit
 - Determine 'default' usernames.
  - The default for Krb5 is the one in the ccache, then $USER
  - For NTLMSSP, it's just $USER

Andrew Bartlett
2007-10-10 12:57:34 -05:00
Stefan Metzmacher
ffb7ba35cd r1469: fix a segfault and compiler warning,
introduced by the "compiler warning fix" in rev 1460...

metze
2007-10-10 12:57:33 -05:00
Stefan Metzmacher
9a876be76c r1467: disable gensec_krb5 by default till abartlet
add the kinit code

metze
2007-10-10 12:57:33 -05:00
Andrew Tridgell
ea5659b051 r1466: the name "oid" is taken by some silly system headers - avoid it in our code 2007-10-10 12:57:33 -05:00
Stefan Metzmacher
fc8d00b8ab r1463: fix the krb5 build
metze
2007-10-10 12:57:32 -05:00
Andrew Bartlett
cea578d6f3 r1462: GENSEC Kerberos and SPENGO work:
- Spelling - it's SPNEGO, not SPENGO
 - SMB signing - Krb5 logins are now correctly signed
 - SPNEGO - Changes to always tell GENSEC about incoming packets, empty or not.

Andrew Bartlett
2007-10-10 12:57:32 -05:00
Andrew Bartlett
67ac960066 r1461: ntlm_check.c is a server-side peice of code, so it belongs in AUTH.
Andrew Bartlett
2007-10-10 12:57:32 -05:00
Andrew Bartlett
10a973da88 r1460: Avoid a compile warning.
Andrew Bartlett
2007-10-10 12:57:32 -05:00
Andrew Bartlett
893a9a3865 r1457: Add the GSSAPI layer to our gensec_krb5 code.
Andrew Bartlett
2007-10-10 12:56:58 -05:00
Jelmer Vernooij
7e9884799e r1451: More missing files... 2007-10-10 12:56:58 -05:00
Jelmer Vernooij
eaa2940ba0 r1450: Oops.. Missing files :-) 2007-10-10 12:56:57 -05:00
Jelmer Vernooij
69de0d95c5 r1449: Use the config system somewhat better in libcli/auth 2007-10-10 12:56:57 -05:00
Andrew Bartlett
1164be10af r1448: Indent this so proto doesn't pick it up.
Andrew Bartlett
2007-10-10 12:56:57 -05:00
Andrew Bartlett
b97ea8a63f r1447: Fix compile.
Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
310a570936 r1446: Another funciton to avoid in proto.h
Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
159c234589 r1445: Ensure get_auth_data_from_tkt doesn't get into proto.h
Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
64e99170c3 r1443: More changes towards Kerberos in Samba4's GENSEC.
The kerberos context is now tied in life to the GENSEC context.

Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
3e9aa67e3f r1442: I was going to rename kerberos.c -> kerberos_kinit.c, but didn't.
Fix config.mk...

(oh, and this file is somehow marked as binary...)

Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
231e505dea r1441: Indentation and comment fixes.
Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
1c31aa4271 r1440: GENSEC improvements:
- Infrustructure for kerberos
 - Don't segfault on un-implemented backend functions
 - Add comments.

Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
e48557158e r1439: Once we are authenticated, always return NT_STATUS_OK. (Makes SPENGO
easier to code, as it may return an 'ok' with an empty blob).

Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
06b997c826 r1438: Record the principal name we are sent in the SPENGO mechListMIC in a
seperate char *, not a DATA_BLOB.

This allows us to tell if we were sent a string here, or a real MIC.
2007-10-10 12:56:56 -05:00
Andrew Bartlett
eb0dd4a821 r1437: Intermediate commit of krb5 for GENSEC.
The session key in the client is wrong, we don't do signing/sealing
and we are sending raw Kerberos, not GSSAPI.

But it's a start, and if we continue to have to call Krb5 directly,
this will be the basis.

I also intend to provide an alternate implementation, using just
GSSAPI.

Andrew Bartlett
2007-10-10 12:56:56 -05:00
Andrew Bartlett
2de3a30823 r1436: Move GENSEC across to config.mk
Andrew Bartlett
2007-10-10 12:56:55 -05:00
Stefan Metzmacher
ae2e6b5862 r1429: enable spnego in smbclient too.
metze
2007-10-10 12:56:55 -05:00
Andrew Bartlett
c283837556 r1426: Fix some of my silly compile errors...
Andrew Bartlett
2007-10-10 12:56:55 -05:00
Andrew Bartlett
c5a1529d54 r1423: Make sure to destory the mem_ctx.
Andrew Bartlett
2007-10-10 12:56:55 -05:00
Stefan Metzmacher
79953dccc1 r1421: fix a uninitialized var (thanks valgrind:-)
add a view debug messages

metze
2007-10-10 12:56:54 -05:00
Stefan Metzmacher
db19d6047c r1420: be more strict reject if the context has the wrong type
metze
2007-10-10 12:56:54 -05:00
Andrew Bartlett
7596f311c9 r1418: Merge Samba 3.0's recent kerberos changes into Samba4. None of this
is used yet.

Andrew Bartlett
2007-10-10 12:56:54 -05:00
Stefan Metzmacher
e3760fcc17 r1409: if we have no user name don't use extended security
the capabilities in the union smb_sesssetup should be used to decide
if we can use extented security

metze
2007-10-10 12:56:54 -05:00
Stefan Metzmacher
e06898f88c r1406: I got spnego in the smb client working
so I set 'use spnego = True'

metze
2007-10-10 12:56:54 -05:00
Andrew Bartlett
1a6c2018dd r1372: Remove the 'default' case from the SPENGO state machine, and fix up
some compiler warnings that allowed us to see.

Andrew Bartlett
2007-10-10 12:56:53 -05:00
Stefan Metzmacher
f737932402 r1367: SPNEGO know uses gensec_subcontext_start() in all places
metze
2007-10-10 12:56:53 -05:00
Stefan Metzmacher
ec978555f0 r1366: handle the case where the client need to send the negTokenInit before
getting something from the server.
(this is needed by SPNEGO in dcerpc)

metze
2007-10-10 12:56:53 -05:00
Stefan Metzmacher
b1217a4ef6 r1365: in SPNEGO_SERVER_TARG we should not check the spnego_negResult
because the client don't send this

metze
2007-10-10 12:56:53 -05:00
Stefan Metzmacher
49e4d375e9 r1364: the SPNEGO_SERVER_TARG state is different from the SPNEGO_CLIENT_TARG
the client checks but not send spnego_negResult

metze
2007-10-10 12:56:53 -05:00
Stefan Metzmacher
69d685d817 r1363: add SPNEGO_NONE_RESULT as spnego_negResult value
this should indicate that we don't send a spnego_negResult t all over the wire

metze
2007-10-10 12:56:53 -05:00
Stefan Metzmacher
e19e5a91f2 r1360: - remove unused state SPNEGO_CLIENT_SEND_MECHS
- remove unsed gensec_user forward, it's done by the gensec layer know

metze
2007-10-10 12:56:53 -05:00
Stefan Metzmacher
264afea9ec r1359: fix uninit var - found by valgrind
metze
2007-10-10 12:56:53 -05:00
Andrew Bartlett
73e03596d3 r1358: Re-indent the SPENGO implementation, and work on the basis of a
switch, rather than a series of if statements.

Also start to use the GENSEC subcontexts, and add some comments
explaining some of the 'odd' logic in parts.

I'll probably break these out into subfunctions soon.

Thanks to metze for getting me to do this :-)

Andrew Bartlett
2007-10-10 12:56:53 -05:00
Andrew Bartlett
7aedbfbdd9 r1357: Work on GENSEC:
- Add the concept of a 'subcontext' into gensec, so that the spengo
   code doesn't have to figure out how to make one.
   (A subcontext inherits the username, domain, password (or callback)
   from the main context).

 - Add comments to some other routines, and explain a bit about what
   the various 'start' functions are for.

Andrew Bartlett
2007-10-10 12:56:53 -05:00
Andrew Bartlett
9039a2a112 r1353: Fix compile with new ASN1 peek code.
Andrew Bartlett
2007-10-10 12:56:52 -05:00
Andrew Bartlett
5bce188d42 r1352: Add a 'peek' function to our ASN1 code, so we can safely perform the
various switches without looking one byte past te end of the buffer.
2007-10-10 12:56:52 -05:00
Stefan Metzmacher
7354521f3c r1350: - init nt_status- found by valgrind
- set auth_type = DCERPC_AUTH_TYPE_SPNEGO

metze
2007-10-10 12:56:52 -05:00
Stefan Metzmacher
a826accd55 r1349: don't segfault with empty data_blob
metze
2007-10-10 12:56:51 -05:00