summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-08-20 04:42:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:33:35 -0500
commit8e11003e214729462b7dcf46f09d47efc736e1e8 (patch)
treee03160e17f827cc014708cdef147df51e021ce19 /source4/auth
parentd5edfef3257ba624d8dbd0f3ffb6dc55afc955c8 (diff)
downloadsamba-8e11003e214729462b7dcf46f09d47efc736e1e8.tar.gz
samba-8e11003e214729462b7dcf46f09d47efc736e1e8.tar.bz2
samba-8e11003e214729462b7dcf46f09d47efc736e1e8.zip
r9411: Ensure we don't send a challenge without first getting a negotiate in
NTLMSSP, unless we are in datagram mode (not fully implemented yet). Andrew Bartlett (This used to be commit 727f5109421e9414a335e42e3ad3dd3ff19776bd)
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/gensec/gensec.h1
-rw-r--r--source4/auth/ntlmssp/ntlmssp.c10
2 files changed, 9 insertions, 2 deletions
diff --git a/source4/auth/gensec/gensec.h b/source4/auth/gensec/gensec.h
index a02e160259..f55e5354ad 100644
--- a/source4/auth/gensec/gensec.h
+++ b/source4/auth/gensec/gensec.h
@@ -40,6 +40,7 @@ struct gensec_target {
#define GENSEC_FEATURE_SEAL 0x00000004
#define GENSEC_FEATURE_DCE_STYLE 0x00000008
#define GENSEC_FEATURE_ASYNC_REPLIES 0x00000010
+#define GENSEC_FEATURE_DATAGRAM_MODE 0x00000020
/* GENSEC mode */
enum gensec_role
diff --git a/source4/auth/ntlmssp/ntlmssp.c b/source4/auth/ntlmssp/ntlmssp.c
index 1fd7ac6756..339c219f62 100644
--- a/source4/auth/ntlmssp/ntlmssp.c
+++ b/source4/auth/ntlmssp/ntlmssp.c
@@ -138,8 +138,14 @@ static NTSTATUS gensec_ntlmssp_update(struct gensec_security *gensec_security,
ntlmssp_command = NTLMSSP_INITIAL;
break;
case NTLMSSP_SERVER:
- /* 'datagram' mode - no neg packet */
- ntlmssp_command = NTLMSSP_NEGOTIATE;
+ if (gensec_security->want_features & GENSEC_FEATURE_DATAGRAM_MODE) {
+ /* 'datagram' mode - no neg packet */
+ ntlmssp_command = NTLMSSP_NEGOTIATE;
+ } else {
+ /* This is normal in SPNEGO mech negotiation fallback */
+ DEBUG(2, ("Failed to parse NTLMSSP packet: zero length\n"));
+ return NT_STATUS_INVALID_PARAMETER;
+ }
break;
}
} else {