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

1317 Commits

Author SHA1 Message Date
Jeremy Allison
6750dc33b4 Fix signing bug with secondary client trans requests. Turns out the last
packet is the one that matters for checking the signing replies. Need to
check the server code does this correctly too....
Bug #832 reported by Volker.
Jeremy.
-
Jeremy Allison
4a145531c2 If signing starts successfully, don't just turn it off automatically if
it fails later. Only turn it off automatically if it fails at the start.
Jeremy.
-
Andrew Bartlett
48123f7e42 Do not add NTLM2 to the NTLMSSP flags unconditionally - allow the
defaults specified by the caller to prevail.

Don't use NTLM2 for RPC pipes, until we know how it works in signing or sealing.

Call ntlmssp_sign_init() unconditionally in the client - we setup the
session key, why not setup the rest of the data.

Andrew Bartlett
-
Jeremy Allison
8916ddfc39 When server signing is set to "auto", if the client doesn't sign just
ignore it. Only fail if signing is set to "required".
Jeremy.
-
Andrew Bartlett
9ecf9408d9 Add support for variable-length session keys in our client code.
This means that we now support 'net rpc join' with KRB5 (des based)
logins.  Now, you need to hack 'net' to do that, but the principal is
important...

When we add kerberos to 'net rpc', it should be possible to still do
user management and the like over RPC.

(server-side support to follow shortly)

Andrew Bartlett
-
Andrew Bartlett
f3bbc87b0d Changes all over the shop, but all towards:
- NTLM2 support in the server
 - KEY_EXCH support in the server
 - variable length session keys.

In detail:

 - NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).

 * This is known as 'NTLMv2 session security' *

(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes.  We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)

This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed.  This also needs to be turned off for
'security=server', which does not support this.

- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.

- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.

- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure.  This should help the SPNEGO implementation.

- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.

- The other big change is to allow variable length session keys.  We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter.  However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.

 * This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *

- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe.  This
should help reduce some of the 'it just doesn't work' issues.

- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer.  (just allocate)


REMEMBER to make clean after this commit - I have changed plenty of data structures...
-
Gerald Carter
e374ce779e adding a useful debug -
Jeremy Allison
29413db303 Fix coredump in cli_get_backup_list.
Jeremy.
-
Tim Potter
23443e3aa0 Fix more 64-bit printf warnings. -
Jeremy Allison
ad06edd1bb Fixes to check for wraps which could cause coredumps.
Jeremy.
-
Richard Sharpe
084e4678c0 Remove some unused variables uncovered by the build farm. -
Richard Sharpe
ca3d98d08b Put in a work-around for ENOTSUP not being defined on OpenBSD. -
Richard Sharpe
84e620e5ba Apply latest of Derrell Lippman's changes to libsmbclient. -
Richard Sharpe
cf9311044c Commit Derrell's changes to libsmbclient plus a small change to configure.in
to see if SGI and other platforms will build.
-
Volker Lendecke
e5dbf2441c According to Ethereal we have a 32-Bit quantity here. And with SSVAL valgrind
reports an unitialized read which is obviously correct. And I hate valgrind
errors ;-)

Volker
-
Jeremy Allison
d7e35dfb92 Put strcasecmp/strncasecmp on the banned list (except for needed calls
in iconv.c and nsswitch/). Using them means you're not thinking about multibyte at
all and I really want to discourage that.
Jeremy.
-
Jeremy Allison
7eaae388b3 Fix for bug #64, Win9x Nexus tools not working against Samba3.0. Missing
map in errormap for ERROR_MORE_DATA -> ERRDOS, ERRmoredata.
Jeremy.
-
Jeremy Allison
06aa434c3f Patch from Stefan Metzmacher <metze@metzemix.de> to fix signing problems
when reverse connecting back to a client for printer notify.
Jeremy.
-
Jeremy Allison
63f3315643 Fix signing miss-sequence noticed by Stefan Metzmacher <metze@metzemix.de>
Jeremy.
-
Volker Lendecke
169f4dfee0 We are doing NT error codes now.... If we have an NT error, report that
back the same way we handle the DOS error. Although I don't see why
BUFFER_TOO_SMALL should not be handled as an error, simply copy the logic.

This is only called from smbcacls and smbcquotas.

Volker
-
Jeremy Allison
6e21261fe4 Enable us to see what sequence number we were expecting when we fail a sign
(should help track down out of sequence bugs).
Jeremy.
-
Tim Potter
18adfdbe0c Enclose usage of st_blksize and st_blocks struct stat members in
#ifdef HAVE_STAT_ST_BLKSIZE and #ifdef HAVE_STAT_ST_BLOCKS,
respectively.

Fixes bug 550 reported by Joachim Schmitz <schmitz@hp.com>.
-
Jeremy Allison
6ad2f0ba27 Fixup error code returns from Samba4 tester. Ensure invalid paths are
validated the same way.
Jeremy.
-
Tim Potter
e3cb0cd0d6 Applied Steve Langasek's patch for bug #450. -
Jeremy Allison
c816aacefb Fix #442 which Alexander considered a showstopper. Allow us to join mixed
mode domains.
Jeremy.
-
Gerald Carter
fe585d49cc address bug #359. Andrew B's patch for implementing client
portion of NTLMv2 key exchange.  Also revert the default for
'client ntlmv2 auth' to no.  This caused no ends of grief in
different cases.

And based on abartlet's mail....

> All I care about at this point is that we use NTLMv2
> in our client code when connecting to a server that
> supports it.

There is *no* way to tell this.  The server can't tell us, because it
doesn't know what it's DC supports.  The DC can't tell us, because it
doesn't know what the trusted DC supports.  One DC might be Win2k, and
the PDC could be an older NT4.
-
Jeremy Allison
f35e9a8b90 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
-
Jeremy Allison
ef140d15ea Used cachegrind to track down some bottlenecks.
Removed calls to clobber_region when not compiling with developer as
they were hiding speed problems.
Added fast path to convert_string() when dealing with ascii -> ascii,
ucs2-le to ascii and ascii to ucs2-le with values <= 0x7F. This
gives a speedup of 22% on my nbench tests.
Next I will do this on convert_string_allocate.
Jeremy.
-
Jeremy Allison
84ae44678a Fix the character set handling properly in nmbd. Also fix bug where
iconv wasn't re-initialised on reading of "charset" parameters. This
caused workgroup name to be set incorrectly if it contained an
extended character.
Jeremy.
-
Jeremy Allison
ecb8057387 Use correct size (17 not 16) when doing a push_ascii(). Ensure that
wins hook is called with unix charset.
Jeremy.
-
Gerald Carter
6e82c9fdf9 revert abartet's change that removed the check for CAP_EXTENDED_SECURITY when decidiing whether or not use ntlmv2 in client connections -
Jeremy Allison
eb79272743 Ensure nmb_namestr() converts back from CH_DOS to CH_UNIX.
Jeremy.
-
Jeremy Allison
cfde7477fd Attempt to fix the charcnv issues causing nmbd to crash. If we get a failed
conversion simply copy as is. Also fixed the horrid malloc-twice-copy code
in the convert alloc path.
Jeremy.
-
Gerald Carter
ae452e51b0 metze's autogenerate patch for version.h -
Andrew Bartlett
96b4187963 - Make 'net' use a single funciton for setting the 'use machine account' code.
- Make winbindd try to use kerberos for connections to DCs, so that it can
   access RA=2 servers, particularly for netlogon.
 - Make rpcclient follow the new flags for the NETLOGON pipe
 - Make all the code that uses schannel use the centralised functions for doing so.

Andrew Bartlett
-
Andrew Bartlett
33109fefe7 Break up 'cli_full_connection' to allow for the session setups to be done
elsewhere in the code.  This will allow us to try kerberos, then another user
then guest in the winbindd code.

Also, re-introduce the seperate, NT1 'guest' session setup code, as I found
some problems with doing guest under NTLMSSP.

Andrew Bartlett
-
Herb Lewis
398bd14fc6 get rid of more compiler warnings -
Volker Lendecke
dc2d2ad467 Add the gss-spnego kerberos server side to ntml_auth. This uses the
same ads_verify_ticket routine that smbd uses, so in the current state
we have to be have the host password in secrets.tdb instead of the
keytab. This means we have to be an ADS member, but it's a start.

Volker
-
Volker Lendecke
d8ab446859 Fix memleaks.
Currently I'm compiling against MIT Kerberos 1.2.8.

Anthony, you said you have a heimdal installation available. Could you
please compile this stuff with krb and check it with valgrind?

Thanks,

Volker
-
Herb Lewis
a6a39c61e8 get rid of some sompiler warnings on IRIX -
Andrew Bartlett
3547cb3def Change Samba to always use extended security for it's guest logins, (ie,
NTLMSSP with "" username, NULL password), and add --machine-pass (-P) to
all of Samba's clients.

When connecting to an Active Directory DC, you must initiate the CIFS level
session setup with Kerberos, not a guest login.  If you don't, your machine
account is demoted to NT4.

Andrew Bartlett
-
Volker Lendecke
2a724a7a87 Don't wrap up anything that is not there. Otherwise upper layers
can not figure that we got no ticket.

Volker
-
Volker Lendecke
9f453f27be Only close anything that is not fid 0. Was very confusing in ethereal...
Volker
-
Andrew Bartlett
d4a5f4fdf9 As described in http://davenport.sourceforge.net/ntlm.html add NTLM2
authentication.

NTLM2 is a version of NTLM, that involves both a client and server challenge,
and the creating of a new (presuable more secure) session key.

Unfortunetly this is not quite the same as NTLMv2, and we don't know how to
get the session key.  I suggest looking very closely at what MSCHAPv2, and
other MS auth protocols do...

Andrew Bartlett
-
Volker Lendecke
a4d2dd1d40 Fix client autonegotiate signing.
Jeremy.
-
Jeremy Allison
ba075ff03a Fallback to not using NTLMv2 is extended security not supported.
Jeremy.
-
Volker Lendecke
f6d853d36a I think this is the one to check...
Volker
-
Volker Lendecke
447f130619 Revert the latest fix. Need to investigate further.
Volker
-
Volker Lendecke
49c4f8a764 Fix a segfault in ntlm_auth when we can't find a domain or hostname.
Volker
-
Volker Lendecke
62b04d7776 Store the server domain from the ntlmssp challenge in the client struct
to be able to ask a LMB for the servers in its workgroup. Against
W2k this only works on port 139....

Volker
-