1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-28 00:49:42 +03:00

105 Commits

Author SHA1 Message Date
Andrew Bartlett
9d5821d5ee r1122: As spotted by lha@stacken.kth.se we don't actually use this variable any more.
Andrew Bartlett
2007-10-10 10:51:56 -05:00
Jeremy Allison
4695cc95fe r786: Memory leak fixes in (mostly) error code paths from
kawasa_r@itg.hitachi.co.jp. A couple of mem leak fixes in
mainline code paths though :-).
Jeremy.
2007-10-10 10:51:38 -05:00
Andrew Bartlett
724e8d3f33 r69: Global rename of 'nt_session_key' -> 'user_session_key'. The session key could
be anything, and may not be based on anything 'NT'.  This is also what microsoft
calls it.
2007-10-10 10:51:06 -05:00
Andrew Tridgell
40b5794ae0 r59: revert session key problem 2007-10-10 10:51:06 -05:00
Andrew Bartlett
26d8791dde r49: Support SMB signing on connections using only the
LANMAN password.  This also corrects the 'session key'
for these connections.
2007-10-10 10:51:06 -05:00
Andrew Bartlett
e27b5cbe75 Merge from HEAD the SMB signing patch that I developed a couple of weeks
ago.

This patch re-adds support for 'optional' SMB signing.  It also ensures that
we are much more careful about when we enable signing, particularly with
on-the-fly smb.conf reloads.

The client code will now attempt to use smb signing by default, and disable
it if the server doesn't correctly support it.

Andrew Bartlett
-
Gerald Carter
a90c3bd281 BUG 417: fix %UuGg variables expansion in include lines setging the current_user_info struct in register_vuid() -- shouldn't be any more broken than we were -
Gerald Carter
f2eaa14b1e BUG 1165, 1126: Fix bug with secondary groups (security = ads) and winbind use default domain = yes -
Andrew Bartlett
493ac5ce98 Patch by Luca Bolcioni <Luca.Bolcioni@yacme.com>. Ensure we always
initialise the session key.  Fixes segfaults with security=server, and
encrypt passwords = no.

Andrew Bartlett
-
Volker Lendecke
3d9931fe29 reply_spnego_kerberos did not set the domain of the user handed to
register_vuid correctly. We ended up with the local netbios name in
substitutions for %D later.

Volker

P.S: Tridge, I can *really* see why you want to get rid of global variables
:-)
-
Jeremy Allison
8e20c06ed3 Fix from Luke Howard <lukeh@PADL.COM> for incorrect early free().
Jeremy.
-
Volker Lendecke
3ce6c9f273 Commit the translation of the realm to the netbios domain name in the kerberos
session setup. After talking to jht and abartlet I made this unconditional, no
additional parameter.

Jerry: This is a change in behaviour, but I think it is necessary.

Volker
-
Jeremy Allison
ba0b5b8c9b Fix for bug #815. Make plaintext unicode passwords work with NT4.x
Jeremy.
-
Gerald Carter
2f43a1c166 fix %a variable for Windows 2003 -> Win2K3 -
Jeremy Allison
4e73faa7b4 Subtract NT_STATUS from common flag, don't add it...
Jeremy.
-
Jeremy Allison
0d82ac57a5 Don't automatically set nt status code flag unless client tells us it can
cope.
Jeremy.
-
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...
-
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.
-
Gerald Carter
62ed2598b3 more 2.2.x compatibility fixes - allow user looksup in the kerb5
sesssetup to fall back to 'user' instaed of failing is REA.LM\user
doesn't exist.

also fix include line in smb_acls.h as requested by metze
-
Volker Lendecke
afbf15f941 Fix memleak. -
Gerald Carter
ae452e51b0 metze's autogenerate patch for version.h -
Andrew Bartlett
a83506802f Win2k never returns 'no such user' here, so when we do it, the clients freak
out.  Return the standard 'logon failure' instead.

Andrew Bartlett
-
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
-
Volker Lendecke
ce5b8d2ec2 In ads_verify_realm, all we use in the ADS_STRUCT is the
auth.realm. So directly pass that instead of setting up and tearing
down the ADS_STRUCT.

Volker
-
Jim McDonough
a2bd8f0bfa Update my copyrights according to my agreement with IBM -
Gerald Carter
731420b03d only honor the first OID in the sessetup snego negotiate. Deviates
from RFC but I'm smelling a client bug here.

	/* only look at the first OID for determining the mechToken --
	   accoirding to RFC2478, we should choose the one we want
	   and renegotiate, but i smell a client bug here..

	   Problem observed when connecting to a member (samba box)
	   of an AD domain as a user in a Samba domain.  Samba member
	   server sent back krb5/mskrb5/ntlmssp as mechtypes, but the
	   client (2ksp3) replied with ntlmssp/mskrb5/krb5 and an
	   NTLMSSP mechtoken.                 --jerry              */
-
Jeremy Allison
79e0bf8298 Start the packet signing engine in the kerberos case in the same place
as the ntlmssp case.
Jeremy.
-
Tim Potter
59dae1da66 More printf portability fixes. Got caught out by some gcc'isms last
time.  )-:
-
Tim Potter
ba4d334b82 More printf fixes - size_t is long on some architectures. -
Jeremy Allison
eff74a1fcc Server side NTLM signing works - until the first async packet. Working on this
next....
Jeremy.
-
Gerald Carter
9f835b85dd convert snprintf() calls using pstrings & fstrings
to pstr_sprintf() and fstr_sprintf() to try to standardize.
lots of snprintf() calls were using len-1; some were using
len.  At least this helps to be consistent.
-
Jeremy Allison
e5714edc23 Signing so far... the client code fails on a SMBtrans2 secondary transaction
I think (my changes haven't affected this I believe). Initial support on the
server side for smbclient. Still doesn't work for w2k clients I think...
Work in progress..... (don't change).
Jeremy.
-
Jeremy Allison
c390b3e4cd Added the "required" keyword to the "client signing" parameter to force it
on. Fail if missmatch. Small format tidyups in smbd/sesssetup.c. Preparing
to add signing on server side.
Jeremy.
-
Jeremy Allison
30bbf4c8c4 It seems only NT4 does the VC == 0 session drop code.
Jeremy.
-
Jeremy Allison
bf0916e1da Correct (?) handling for VC = 0. Trying to fix XP logoff leaving resources
around.
Jeremy.
-
Gerald Carter
48c8211084 volker's add_signature() fix; must pass the beginning on the outbuf to get the flags field -
Gerald Carter
e7d635af80 fix for UNICODE plaintext passwords (bug #59) and fix smbclient to send the unicode plain text password if negoitated -
Gerald Carter
d7ca85613b really make sure to include the version in the lanman string; tested spnego using smbclient -
Tim Potter
865c112756 spelling -
Jeremy Allison
8dcc008999 Fix uninitialized blobs reported by Luke Howard.
Jeremy.
-
Gerald Carter
dade462a16 add version back to lanman string in sessetup reply -
Andrew Bartlett
8f8d819d58 Merge comment with HEAD -
Andrew Bartlett
3f9616a68a Merge from HEAD - sync up SessionSetup code to HEAD, including Luke Howard's
session key and auth verifier patches.

Andrew Bartlett
-
Gerald Carter
7bc5fc729f fix WinXP & Win2K3 remote_arch and check pointer in ntlmssp code before dereferencing -
Gerald Carter
e074cab810 adding some initiaial code to sert %a to Win2K3 (using Native LanMan string from .NET RC2) -
Gerald Carter
c7712fa054 additional fix for CR 601
* distinguish WinXP from Win2k
  * add a 1/3 of a second delay in OpenPrinter
    in order to trigger a LAN/WAN optimization in
    2k clients.
-
Andrew Bartlett
74b5436c75 Merge of server-side authentication changes to 3.0:
- user_ok() and user_in_group() now take a list of groups, instead of
   looking for the user in the members of all groups.

 - The 'server_info' returned from the authentication is now kept around
  - in future we won't copy the sesion key, username etc, we will just
    referece them directly.

 - rhosts upgraded to use the SAM if possible, otherwise fake up based on
   getpwnam().

 - auth_util code to deal with groups upgraded to deal with non-winbind domain
   members again.

Andrew Bartlett
-
Gerald Carter
8712bd1f8e check pointer before dereferencing it -
Andrew Bartlett
fbb46da79c Merge from HEAD:
- NTLMSSP over SPENGO (sesssion-setup-and-x) cleanup and code refactor.
  - also consequential changes to the NTLMSSP and SPNEGO parsing functions
  - and the client code that uses the same functions
 - Add ntlm_auth, a NTLMSSP authentication interface for use by applications
   like Squid and Apache.
  - also consquential changes to use common code for base64 encode/decode.
 - Winbind changes to support ntlm_auth (I don't want this program to need
   to read smb.conf, instead getting all it's details over the pipe).
 - nmbd changes for fstrcat() instead of fstrcpy().

Andrew Bartlett
-
Jeremy Allison
666861b1e2 pstring/fstring missmatches found by Andrew Bartlett.
Jeremy.
-