auth/ntlmssp: fix handling of GENSEC_FEATURE_LDAP_STYLE as a server
authorStefan Metzmacher <metze@samba.org>
Mon, 7 May 2018 12:50:27 +0000 (14:50 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 4 Jun 2018 07:54:23 +0000 (09:54 +0200)
commite8489ae8538a06fb224e8af9e45da43fecaef316
tree70b964892dfc2345e4c8c4ab8c6ef56ec4a7463d
parent7731ad2c458b5d6650797b01367f4d2aa90e830a
auth/ntlmssp: fix handling of GENSEC_FEATURE_LDAP_STYLE as a server

This fixes "NTLMSSP NTLM2 packet check failed due to invalid signature!"
error messages, which were generated if the client only sends
NTLMSSP_NEGOTIATE_SIGN without NTLMSSP_NEGOTIATE_SEAL on an LDAP
connection.

This fixes a regession in the combination of commits
77adac8c3cd2f7419894d18db735782c9646a202 and
3a0b835408a6efa339e8b34333906bfe3aacd6e3.

We need to evaluate GENSEC_FEATURE_LDAP_STYLE at the end
of the authentication (as a server, while we already
do so at the beginning as a client).

As a reminder I introduced GENSEC_FEATURE_LDAP_STYLE
(as an internal flag) in order to let us work as a
Windows using NTLMSSP for LDAP. Even if only signing is
negotiated during the authentication the following PDUs
will still be encrypted if NTLMSSP is used. This is exactly the
same as if the client would have negotiated NTLMSSP_NEGOTIATE_SEAL.
I guess it's a bug in Windows, but we have to reimplement that
bug. Note this only applies to NTLMSSP and only to LDAP!
Signing only works fine for LDAP with Kerberos
or DCERPC and NTLMSSP.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13427

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed May 16 03:26:03 CEST 2018 on sn-devel-144

(cherry picked from commit c7a3ce95ac4ce837d8fde36578b3b1f56c3ac2fa)
auth/ntlmssp/gensec_ntlmssp_server.c
auth/ntlmssp/ntlmssp_server.c
selftest/knownfail.d/ntlmssp_ldap_style_send_seal [deleted file]