summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-04-16 12:14:07 +0200
committerStefan Metzmacher <metze@samba.org>2012-04-16 14:44:46 +0200
commit51e3bbd3e0a29171f4ed9e6fb933f4d124400de7 (patch)
treeaaa90363ead358c57752ecd1aa36259ae337dad9
parentdaa5cec1ba765f2894e26b8218b09312e3a682c3 (diff)
downloadsamba-51e3bbd3e0a29171f4ed9e6fb933f4d124400de7.tar.gz
samba-51e3bbd3e0a29171f4ed9e6fb933f4d124400de7.tar.bz2
samba-51e3bbd3e0a29171f4ed9e6fb933f4d124400de7.zip
s4:libcli/smb2: fix anonymous session setups against windows servers
Windows server doesn't set the SMB2_SESSION_FLAG_IS_GUEST nor SMB2_SESSION_FLAG_IS_NULL flag. This fix makes sure we don't try to verify a signature on the final session setup response. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Mon Apr 16 14:44:46 CEST 2012 on sn-devel-104
-rw-r--r--source4/libcli/smb2/session.c15
-rw-r--r--source4/libcli/smb2/wscript_build2
2 files changed, 16 insertions, 1 deletions
diff --git a/source4/libcli/smb2/session.c b/source4/libcli/smb2/session.c
index 2657266401..57033b866a 100644
--- a/source4/libcli/smb2/session.c
+++ b/source4/libcli/smb2/session.c
@@ -27,6 +27,7 @@
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
#include "auth/gensec/gensec.h"
+#include "auth/credentials/credentials.h"
#include "../libcli/smb/smbXcli_base.h"
#include "../source3/libsmb/smb2cli.h"
@@ -231,6 +232,20 @@ static void smb2_session_setup_spnego_done(struct tevent_req *subreq)
return;
}
+ if (cli_credentials_is_anonymous(state->credentials)) {
+ /*
+ * Windows server does not set the
+ * SMB2_SESSION_FLAG_IS_GUEST nor
+ * SMB2_SESSION_FLAG_IS_NULL flag.
+ *
+ * This fix makes sure we do not try
+ * to verify a signature on the final
+ * session setup response.
+ */
+ tevent_req_done(req);
+ return;
+ }
+
status = gensec_session_key(session->gensec, state,
&session_key);
if (tevent_req_nterror(req, status)) {
diff --git a/source4/libcli/smb2/wscript_build b/source4/libcli/smb2/wscript_build
index 2685fe71bf..02fc5b821d 100644
--- a/source4/libcli/smb2/wscript_build
+++ b/source4/libcli/smb2/wscript_build
@@ -4,7 +4,7 @@ bld.SAMBA_SUBSYSTEM('LIBCLI_SMB2',
source='transport.c request.c session.c tcon.c create.c close.c connect.c getinfo.c write.c read.c setinfo.c find.c ioctl.c logoff.c tdis.c flush.c lock.c notify.c cancel.c keepalive.c break.c util.c signing.c lease_break.c',
autoproto='smb2_proto.h',
deps='tevent-util cli_smb_common',
- public_deps='smbclient-raw gensec tevent',
+ public_deps='smbclient-raw gensec samba-credentials tevent',
public_headers='smb2.h',
)