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

38 Commits

Author SHA1 Message Date
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.
-
Jeremy Allison
eff74a1fcc Server side NTLM signing works - until the first async packet. Working on this
next....
Jeremy.
-
Jeremy Allison
f4b02e52e2 Don't check in two places for signing turned off...
Jeremy.
-
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
9515de83a8 Correctly toggle the signing state to what it was previosly when sending
an oplock break.
Jeremy.
-
Jeremy Allison
f2e84f1ba6 Putting the framework for server signing in place. Ensure we don't use
sendfile when signing (I need to add this for readbraw/writebraw too...).
Jeremy.
-
Jeremy Allison
203e4bf0bf Refactor signing code to remove most dependencies on 'struct cli'.
Ensure a server can't do a downgrade attack if client signing is mandatory.
Add a lp_server_signing() function and a 'server signing' parameter that
will act as the client one does.
Jeremy
-
Jeremy Allison
61fc9a7b2e Add API framework for server SMB signing.
Jeremy.
-
Jeremy Allison
dd46f8b22d Add krb5_princ_component to Heimdal. Remove cli_ from mark packet signed.
Jeremy.
-
Tim Potter
2750418752 Spelling. -
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
0b8724ed65 Add a cli_ prefix to a few functions to ensure everything that takes a struct cli_state
is so marked.
Jeremy
-
Andrew Bartlett
95ec8317d4 Fix SMB signing when using NTLMSSP...
It's so simple now I know how it works - and it has nothing to do with
NTLMSSP (it's just a slightly different use of the old algorithm). :-).

Note:  This is actually less secure then the non-NTLMSSP code, as there is
no per-session random data included for NTLM logins.  (NTLMv2 is better,
fortunetly).

Andrew Bartlett
-
Andrew Bartlett
dd33212f1e Rework our smb signing code again, this factors out some of the common
MAC calcuation code, and now supports multiple outstanding packets.

Fixes bug #40

Andrew Bartlett
-
Tim Potter
865c112756 spelling -
Andrew Bartlett
7645d3d28a SMB Signing with NTLMv2 works!
(well, under certain conditions :-)

There is no length limit on the size of the authentication response added
into the MD5 hash.  (We had previously limited this to lengths like 40, 44 or
64 in attempts to make sense of what the SNIA spec tells us).

Instead, the entire authentication response is added in.

Currently, this only works on a Win2k domain members with a Samba PDC,
becouse our NTLMv2 code currently fails against an Win2k PDC.

However, this splits the problem in half - particularly as the NTLMv2 format
is known, and even has an ethereal disector! (thanks tpot).

Andrew Bartlett
-
Andrew Bartlett
7f1c271cfb Add doco to our SMB signing code.
This should make it clearer what magic numbers refer to the magic numbers
in the CIFS spec, and what bits and peices are being appended into the MD5
calculation where.

Andrew Bartlett
-
Andrew Bartlett
c6c4f69b8d Merge SMB signing, cli buffer clobber and NTLMSSP signing tweaks from HEAD. -
Volker Lendecke
8c70f657cf Merge a trivial fix across from HEAD. Not that this
would work now...

Volker
-
Andrew Bartlett
3d4c4b6cb3 Merge from HEAD - leave the SMB buffer untouched when checking it's SMB sig.
Andrew Bartlett
-
Jeremy Allison
f93c64b5ca Removed unused var.
Jeremy.
-
Rafal Szczesniak
d81b0d2690 We haven't implemented The Singing Contexts so far.
Who knows what .NET server brings, though ...?  ;-)


Rafal
-
Andrew Bartlett
a034a5e381 Further work on NTLMSSP-based SMB signing. Current status is that I cannnot
get Win2k to send a valid signiture in it's session setup reply - which it will
give to win2k clients.

So, I need to look at becoming 'more like MS', but for now I'll get this code
into the tree.  It's actually based on the TNG cli_pipe_ntlmssp.c, as it was
slightly easier to understand than our own (but only the utility functions
remain in any way intact...).

This includes the mysical 'NTLM2' code - I have no idea if it actually works.

(I couldn't get TNG to use it for its pipes either).

Andrew Bartlett
-
Andrew Bartlett
05cffbee56 Try not to clobber the session request. -
Andrew Bartlett
b9cf95c3dc Change the way we sign SMB packets, to a function pointer interface.
The intention is to allow for NTLMSSP and kerberos signing of packets, but
for now it's just what I call 'simple' signing. (aka SMB signing per the SNIA
spec)

Andrew Bartlett
-