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

74 Commits

Author SHA1 Message Date
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Jeremy Allison
a53268fb20 r22920: Add in the UNIX capability for 24-bit readX, as discussed
with the Apple guys and Linux kernel guys. Still looking
at how to do writeX as there's no recvfile().
Jeremy.
2007-10-10 12:22:08 -05:00
Stefan Metzmacher
fa322f0cc9 r22001: change prototype of dump_data(), so that it takes unsigned char * now,
which matches what samba4 has.

also fix all the callers to prevent compiler warnings

metze
2007-10-10 12:18:59 -05:00
Jeremy Allison
1b828f051d r21922: Fixed the build by rather horrid means. I really need
to restructure libsmb/smb_signing.c so it isn't in
the base libs path but lives in libsmb instead (like
smb_seal.c does).
Jeremy.
2007-10-10 12:18:49 -05:00
Jeremy Allison
783a7b3085 r21897: Add in a basic raw NTLM encrypt request. Now
for testing.
Jeremy.
2007-10-10 12:18:46 -05:00
Jeremy Allison
78c1c43523 r19659: Fix bug #4187. Possible crash in signing on/off code.
Jeremy.
2007-10-10 12:15:45 -05:00
Jeremy Allison
61f052b0a6 r17595: Fix from Ben Winslow <rain@bluecherry.net> to allow
client smb signing to be correctly turned off.
Jeremy.
2007-10-10 11:38:41 -05:00
Jeremy Allison
85841a0198 r17431: Fix bug #4003, reported by dale-keyword-samba.c7b741@codefu.org.
NTcancel doesn't send a reply, so in this case the signing
sequence number is only incremented by 1, not 2.
Jeremy.
2007-10-10 11:38:33 -05:00
Volker Lendecke
be9aaffdac r17333: Some C++ warnings 2007-10-10 11:38:26 -05:00
Jeremy Allison
f462daf02c r17292: Try and fix bug #3967 - signing problems on trans
calls introduced by signing code simplification.
Please test if you've seen signing problems with
3.0.23a.
Jeremy.
2007-10-10 11:38:23 -05:00
Jeremy Allison
3b7fbe856c r16696: Fix the multiple-outstanding write and trans client
signing bug.
Jeremy.
2007-10-10 11:19:08 -05:00
Jeremy Allison
ec0a47b94c r16630: Fix bug #3881, reported by jason@ncac.gwu.edu.
Jeremy.
2007-10-10 11:19:04 -05:00
Jeremy Allison
08e52ead03 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
2007-10-10 11:15:57 -05:00
Jeremy Allison
7ada96a1cf r14355: Try and fix Coverity #158 by making the pointer
aliasing clearer. This isn't a bug but a code
clarification.
Jeremy.
2007-10-10 11:15:26 -05:00
Gerald Carter
13ed08cd2a r5806: * fix a couple more segvs in spoolss
* comment out unused variable after jra's change to revert the 56bit des
  smb signing changes
2007-10-10 10:56:02 -05:00
Jeremy Allison
0abfb67c79 r5804: Revert the signing change by Nalin Dahyabhai <nalin@redhat.com>.
Seems to be incorrect (several user reports).
Jeremy.
2007-10-10 10:56:01 -05:00
Jeremy Allison
620f2e608f r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
2007-10-10 10:53:32 -05:00
Jeremy Allison
55d23cb253 r3294: Fix for SMB signing with 56-bit DES session keys. From Nalin Dahyabhai <nalin@redhat.com>.
Jeremy.
2007-10-10 10:53:04 -05:00
Andrew Bartlett
6d594d5bb1 r1487: Remove unused parameter for the client-side signing functions.
Andrew Bartlett
2007-10-10 10:52:12 -05:00
Andrew Bartlett
ee23a4237d r1121: Fix memory leak in the trans2 signing code.
We would start the trans2 state, which is fine, but never pull the
expected reply off the packet queue.

I'm not sure if this is still a major problem after jra's recent 'no
duplicate mids on the list' change, but I think this is correct
anyway.
2007-10-10 10:51:56 -05:00
Jeremy Allison
1745ce4e2c r1117: Doh ! Remember to turn off signing when sending a "break to level II" oplock
message, or we mess up the signing sequence number.... Also improve sign error
reporting. Also when deferring an open that had been deferred due to an oplock
break, don't re-add the mid to the pending sign queue or we increment the sequence
number twice and mess up signing again...
I can now bounce between 2 WinXP/Win2003 boxes opening Excel spreadsheets with
signing turned on and get correct "file in use" messages.
Jeremy.
2007-10-10 10:51:56 -05:00
Jeremy Allison
5e8237e306 r1115: Fix for #1427. Catch bad path errors at the right point. Ensure all
our pathname parsing is consistent.
Jeremy.
2007-10-10 10:51:56 -05:00
Andrew Bartlett
43c71b3202 Let the comment match the function...
Andrew Bartlett
-
Andrew Bartlett
414d3fdc75 Make it clearer that this error refers to the peer, as this code is in both
the client and server.

Andrew Bartlett
-
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
-
Jeremy Allison
25d739978f Fix for a signing bug when the mid wraps.
Found by Fran Fabrizio <fran@cis.uab.edu>.
Add to the *start* of the list not the end of the list.
This ensures that the *last* send sequence with this mid
is returned by preference.
This can happen if the mid wraps and one of the early
mid numbers didn't get a reply and is still lurking on
the list.
Jeremy.
-
Volker Lendecke
f5afaafd61 Preliminary fix for our signing problem with failed NTLMSSP logins. This patch
solves the problem for me here, I can still successfully set up signing using
NTLMSSP against w2k3 and it does not show a signing error anymoe when the
password was wrong.

Jeremy, you might want to take a further look at it as this is not
particularly elegant.

Volker
-
Jeremy Allison
4912ad8f18 Fix spurious error msg. when seq=0.
Jeremy
-
Jeremy Allison
818cf32d63 Better fix for client signing bug. Ensure we don't malloc/free trans signing
state info each packet.
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.
-
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
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
63f3315643 Fix signing miss-sequence noticed by Stefan Metzmacher <metze@metzemix.de>
Jeremy.
-
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.
-
Herb Lewis
398bd14fc6 get rid of more compiler warnings -
Jeremy Allison
b43ce1ff61 An oplock break reply from the client causes the sequence number to be
updated by 2 if there is no open reply outstanding, else by one....
Yes - this makes no sense....
Jeremy.
-
Jeremy Allison
85907f02ce Turns out I had my packet sequences wrong for oplock break code.
I was storing the mid of the oplock break - I should have been
storing the mid from the open. There are thus 2 types of deferred
packet sequence returns - ones that increment the sequence number
(returns from oplock causing opens) and ones that don't (change notify
returns etc). Running with signing forced on does lead to some
interesting tests :-).
Jeremy.
-
Jeremy Allison
69c56ee8bc Fix oplock break detection code on incoming oplock break responses. This
fixes signing for oplocks.
Jeremy.
-
Jeremy Allison
9a8ffc239c Ensure we don't leak any sign records on cancel of pending requests.
Jeremy.
-
Jeremy Allison
270bf20fe3 Only look for mid sign records on incoming packets for oplock break replies.
Otherwise we find spurious mid sign records on reply_ntcancel calls (they cancel
by mid). That took a *lot* of tracking down. I still need to remove the mid
records from the sign state on reply_ntcancel to avoid leaking memory....
Jeremy.
-
Jeremy Allison
3a789cb7f0 More fixes for client and server side signing. Ensure sequence numbers
are updated correctly on returning an error for server trans streams.
Ensure we turn off client trans streams on error.
Jeremy.
-
Jeremy Allison
844898dbd8 Leave the packet sequence checkers enabled whilst I track down a smbclient -> smbd
sequence number problem.
Jeremy.
-
Jeremy Allison
901544b29b Add the same signing code to the server. Ensure we use identical session
numbers and MIDs when in trans/trans2/nttrans code.
Jeremy.
-
Jeremy Allison
2093a3130d Correct fix (removed the earlier band-aid) for what I thought was a signing
bug with w2k. Turns out that when we're doing a trans/trans2/nttrans call
the MID and send_sequence_number and reply_sequence_number must remain constant.
This was something we got very wrong in earlier versions of Samba. I can now
get a directory listing from WINNT\SYSTEM32 with the older earlier parameters
for clilist.c
This still needs to be fixed for the server side of Samba, client appears to
be working happily now (I'm doing a signed smbtar download of an entire W2K3
image to test this :-).
Jeremy.
-
Jeremy Allison
7c58673a10 Turn the 'doing_signing' variable on - fix bug where it was only being set
on when signing was mandatory.
Jeremy.
-
Andrew Bartlett
2c395a3904 Fix comment -
Jeremy Allison
3f9e3b6070 W00t! Client smb signing is now working correctly with krb5 and w2k server.
Server code *should* also work (I'll check shortly). May be the odd memory
leak. Problem was we (a) weren't setting signing on in the client krb5 sessionsetup
code (b) we need to ask for a subkey... (c). The client and server need to
ask for local and remote subkeys respectively.
Thanks to Paul Nelson @ Thursby for some sage advice on this :-).
Jeremy.
-
Jeremy Allison
a6e537f661 Fix packet signing with asynchronous oplock breaks. Removed bad error message
due to w2k bug. I think this code is now working.... Need more testing of course
but works on all the obvious cases I can think of.
Jeremy.
-
Jeremy Allison
dd83931a00 SMB signing is now working with change notify. Need to fix the disconnect
when bad signature received, plus check the oplock breaks....
Jermey.
-