1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-02 00:23:50 +03:00
Commit Graph

157 Commits

Author SHA1 Message Date
Andrew Tridgell
5921587ec2 r3323: more warning reductions 2007-10-10 13:04:55 -05:00
Andrew Tridgell
02d5d0f685 r3322: fixed a bunch of warnings in the build, including one case where it was a real bug 2007-10-10 13:04:55 -05:00
Stefan Metzmacher
5eb0ff78d5 r3289: Mr. L. and Mr. B.!
can we decide to not break WinXP clients:-)

metze
2007-10-10 13:04:50 -05:00
Volker Lendecke
d91659b037 r3219: Hi, Andrew B.!
Not sure which Samba3 you mean, but *my* one bails out with
INVALID_PARAMETER...

Volker
2007-10-10 13:04:42 -05:00
Andrew Bartlett
18e08b4497 r3190: When we don't have a PAC, do a lookup in the local ldb instead.
This required reworking the auth_sam code, so that it would export the
'name -> server_info' functionality.  It's a bit ugly from a modular
point of view, but it's what we have to do...

Fix up some of the code to better use the new talloc()

Andrew Bartlett
2007-10-10 13:04:38 -05:00
Andrew Bartlett
bbd52ab264 r3187: This 'optional' part of the ASN.1 in SPNEGO is required by Samba3 (but
not Microsoft).  Unfortunetly it's harder to fix Samba3 than to make
Samba4 cope...

Andrew Bartlett
2007-10-10 13:04:38 -05:00
Andrew Bartlett
4efb87eb03 r3128: Return the correct error code for a secrets/kerberos login, but
skipping 'bad encryption type'.

Andrew Bartlett
2007-10-10 13:02:24 -05:00
Andrew Bartlett
9f19aae0c0 r3115: Bugfixes and extra debug in our kerberos verify code.
Andrew Bartlett
2007-10-10 13:02:23 -05:00
Andrew Bartlett
e08366ffeb r3110: Fix the krb5 client and server, so that it doesn't segfault. There
were also gensec bugs that didn't turn up until we hit error paths in
the krb5 code.

Andrew Bartlett
2007-10-10 13:02:22 -05:00
Andrew Bartlett
173f29a1d8 r3075: Initialise (and check for intialisation) of the private pointer to
ensure we don't segfault on the cleanup from an incomplete schannel
bind.

Andrew Bartlett
2007-10-10 13:01:56 -05:00
Stefan Metzmacher
30aa8af044 r2860: add gensec_have_feature() to check what feature are used in the connection
metze
2007-10-10 12:59:39 -05:00
Andrew Bartlett
18367c4235 r2859: It seems useful to allow the seal/unseal functions in gensec to pass
though to the sign/check_sig functions.

Andrew Bartlett
2007-10-10 12:59:39 -05:00
Andrew Tridgell
814881f0e5 r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions.
The motivation for this change was to avoid having to convert to/from
ucs2 strings for so many operations. Doing that was slow, used many
static buffers, and was also incorrect as it didn't cope properly with
unicode codepoints above 65536 (which could not be represented
correctly as smb_ucs2_t chars)

The two core functions that allowed this change are next_codepoint()
and push_codepoint(). These functions allow you to correctly walk a
arbitrary multi-byte string a character at a time without converting
the whole string to ucs2.

While doing this cleanup I also fixed several ucs2 string handling
bugs. See the commit for details.

The following code (which counts the number of occuraces of 'c' in a
string) shows how to use the new interface:

size_t count_chars(const char *s, char c)
{
	size_t count = 0;

	while (*s) {
		size_t size;
		codepoint_t c2 = next_codepoint(s, &size);
		if (c2 == c) count++;
		s += size;
	}

	return count;
}
2007-10-10 12:59:39 -05:00
Stefan Metzmacher
d02fab41f8 r2850: - check for GENSEC_WANT_SEAL in gensec_unseal_packet()
- pass functions to the subcontext in spnego

metze
2007-10-10 12:59:38 -05:00
Andrew Tridgell
8dc23821c9 r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
278cef77f0 r2669: convert make_user_info() and associated functions from malloc to talloc 2007-10-10 12:59:19 -05:00
Andrew Tridgell
4aba6e7101 r2650: fixed a memory leak in make_server_info() 2007-10-10 12:59:16 -05:00
Andrew Tridgell
230e1cd777 r2648: - use a destructor on struct server_connection to simplify the
connection termination cleanup, and to ensure that the event
  contexts are properly removed for every process model

- gave auth_context the new talloc treatment, which removes another
  source of memory leaks.
2007-10-10 12:59:16 -05:00
Andrew Tridgell
2dc334a328 r2646: - use a talloc destructor to ensure that sockets from the new socket
library are closed on abnormal termination

- convert the service.h structures to the new talloc methods
2007-10-10 12:59:16 -05:00
Andrew Tridgell
b378aae95d r2645: converted the NTLMSSP code to the new style of talloc 2007-10-10 12:59:16 -05:00
Andrew Tridgell
f19201ea27 r2643: convert more of the auth subsyystem to the new talloc methods. This
also fixes a memory leak found with --leak-check.
2007-10-10 12:59:15 -05:00
Andrew Tridgell
f12ee2f241 r2629: convert gensec to the new talloc model
by making our gensec structures a talloc child of the open connection
we can be sure that it will be destroyed when the connection is
dropped.
2007-10-10 12:59:14 -05:00
Andrew Tridgell
5b967c1cbb r2587: fixed a couple of authentication memory leaks. There are more to be
fixed - I'll commit a little test suite soon.
2007-10-10 12:59:08 -05:00
Andrew Bartlett
dfecb01506 r2552: Character set conversion and string handling updates.
The intial motivation for this commit was to merge in some of the
bugfixes present in Samba3's chrcnv and string handling code into
Samba4.  However, along the way I found a lot of unused functions, and
decided to do a bit more...

The strlen_m code now does not use a fixed buffer, but more work is
needed to finish off other functions in str_util.c.  These fixed
length buffers hav caused very nasty, hard to chase down bugs at some
sites.

The strupper_m() function has a strupper_talloc() to replace it (we
need to go around and fix more uses, but it's a start).  Use of these
new functions will avoid bugs where the upper or lowercase version of
a string is a different length.

I have removed the push_*_allocate functions, which are replaced by
calls to push_*_talloc.  Likewise, pstring and other 'fixed length'
wrappers are removed, where possible.

I have removed the first ('base pointer') argument, used by push_ucs2,
as the Samba4 way of doing things ensures that this is always on an
even boundary anyway.  (It was used in only one place, in any case).
2007-10-10 12:59:05 -05:00
Andrew Bartlett
69163500e0 r2534: Change NTLMSSP parsing to avoid a seperate str_chrnum() call - storing
away the string as a data blob to be put in the buffers later.

This also avoids a length-limited push_str, moving to push_ucs2_talloc().

Andrew Bartlett
2007-10-10 12:59:03 -05:00
Andrew Tridgell
cef08d5789 r2432: more string function updates.
btw, the reason I want to use strncasecmp() instead of StrnCaseCmp()
is that the Samba internal functions are built to deal with
multi-byte, whereas in the cases I am converting we know we are
dealing with solely ascii string constants, so going via the slow
conversion libraries is pointless.
2007-10-10 12:58:52 -05:00
Andrew Tridgell
bcf9d787d6 r2385: the gensec:krb5 test is not needed here any more, as we do it in the registration code 2007-10-10 12:58:47 -05:00
Andrew Tridgell
66f88c7d89 r2377: added a more generic way of disabling gensec subsystems. For example,
"gensec:ntlmssp=no" will disable ntlmssp.
2007-10-10 12:58:46 -05:00
Andrew Tridgell
2d710a5eb5 r2376: added a way to disable krb5 on the command line. Just use
--option 'gensec:krb5=no'

or put "gensec:krb5 = no" in smb.conf

Given the frustration I've had with kerberos I was very tempted to name
this option --nfk, but resisted the temptation
2007-10-10 12:58:46 -05:00
Stefan Metzmacher
9177cd4285 r2315: change format
metze
2007-10-10 12:58:43 -05:00
Stefan Metzmacher
75c3108955 r2314: fix compiler warning
metze
2007-10-10 12:58:43 -05:00
Andrew Bartlett
99f7a38c07 r2307: Fix the use of 'raw' NTLMSSP to hosts that support extended security,
but do not support SPNEGO (such as XP, when not joined to a domain).

This is triggered by the presense or lack of a security blob in the
negprot reply.

Andrew Bartlett
2007-10-10 12:58:42 -05:00
Andrew Tridgell
0a4723d250 r2303: allow setting of many ntlmssp options from smb.conf or the command
line. This makes testing much easier.
2007-10-10 12:58:41 -05:00
Andrew Tridgell
fce7a4218b r2294: this fixes the NTLM2 sign+seal combination. I have now tested:
NTLM sign
 NTLM sign+seal
 NTLM2 sign
 NTLM2 sign+seal

and all of the above both with and without key exchange

the NTLM2 seal case is ugly and involves an extra data copy, which
some API changes in gensec or the ndr layer might avoid in future.
2007-10-10 12:58:40 -05:00
Andrew Bartlett
b80d849b6b r2290: Fix 'lsakey' for the server-side, it is static for
'authenticated' connections.

Fix kerberos session key issues - we need to call the
routine for extracting the session key, not just read the cache.

Andrew Bartlett
2007-10-10 12:58:40 -05:00
Andrew Bartlett
f5a381094d r2286: Fixes towards krb5 logins into Samba's CIFS server.
These fixes aim particularly at allowing PAC-less logins, as I don't
yet generate a PAC in the lorikeet-heimdal KDC.

This is for the benifit of a Kerbeors-enabled domain join, which seems
to be progressing quite well!

Andrew Bartlett
2007-10-10 12:58:39 -05:00
Andrew Bartlett
2c701f59a7 r2285: Remove more static data, fix spelling in a comment. 2007-10-10 12:58:39 -05:00
Andrew Bartlett
a1fe175eec r2284: Thanks to some great detective work by tridge, NTLM2 signing now works.
This means that 'require NTLMv2 session security' now works for RPC
pipe signing.  We don't yet have sealing, but it can't be much further.

This is almost all tridge's code, munged into a form that can work
with the GENSEC API.

This commit also includes more lsakey fixes - that key is used for all
DCE-RPC level authenticated connections, even over CIFS/ncacn_np.

No doubt I missed something, but I'm going to get some sleep :-)

Andrew Bartlett
2007-10-10 12:58:39 -05:00
Andrew Bartlett
e8d0246882 r2119: Noticed by jra:
Clean up use of unitilaised variable.

Andrew Bartlett
2007-10-10 12:58:26 -05:00
Andrew Bartlett
0237389ce7 r2099: Get rid of another private ARCFOUR implementation from the codebase.
Andrew Bartlett
2007-10-10 12:58:24 -05:00
Andrew Bartlett
e509451538 r2096: Enable use of NTLM2 for connections that do not got on to be NTLMSSP
signed or sealed.

This allows NTLM2 for SMB connections, and NTLMSSP over HTTP for example.

Andrew Bartlett
2007-10-10 12:58:24 -05:00
Günther Deschner
fe93f58dfe r2058: Merge heimdal krb5_locate_kdc-fix over from trunk/3_0 although
krb5_locate_kdc is (yet) an unused function in Samba4.

Guenther
2007-10-10 12:58:22 -05:00
Andrew Bartlett
2cbbf123d2 r2054: Fix compile warnings/build failures on non-gcc.
Andrew Bartlett
2007-10-10 12:58:21 -05:00
Andrew Bartlett
46864dd9d7 r2053: All RPC sessions 'want' a session key. Of course, the key they
currently get it bougs, but anyway...

Andrew Bartlett
2007-10-10 12:58:21 -05:00
Andrew Tridgell
e1575a72a1 r2042: missed a couple of places that should be talloc_free() 2007-10-10 12:58:19 -05:00
Andrew Bartlett
86f61568ea r2041: Fix NTLMSSP RPC sealing, client -> win2k3 server.
The bug (found by tridge) is that Win2k3 is being tighter about the
NTLMSSP flags.  If we don't negotiate sealing, we can't use it.

We now have a way to indicate to the GENSEC implementation mechanisms
what things we want for a connection.

Andrew Bartlett
2007-10-10 12:58:19 -05:00
Andrew Tridgell
a2ad77fb3a r2036: switched the spnego code to use talloc
now that talloc_free() doesn't need to take a context ptr, there is no
reason we can't use talloc everywhere that we currently use malloc().
2007-10-10 12:58:19 -05:00
Stefan Metzmacher
17268837d2 r2020: fix compiler warnings
metze
2007-10-10 12:58:18 -05:00
Volker Lendecke
7be7f25a57 r1886: Fix the build 2007-10-10 12:58:08 -05:00
Stefan Metzmacher
fe655d0474 r1794: fix the build MIT krb5
metze
2007-10-10 12:57:57 -05:00