summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-04-25 10:58:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:39 -0500
commit9c0647ddca26c1ef3beb63ff01830e46cdc9ed2a (patch)
treefb22f80d18154e8c0c449619f560a73cbd3f6914 /source4
parent8b0e09e24f7a3afbaf836e4e4a28cf62f012b588 (diff)
downloadsamba-9c0647ddca26c1ef3beb63ff01830e46cdc9ed2a.tar.gz
samba-9c0647ddca26c1ef3beb63ff01830e46cdc9ed2a.tar.bz2
samba-9c0647ddca26c1ef3beb63ff01830e46cdc9ed2a.zip
r6465: Use talloc_zero for the gensec_ntlmssp_state structure, as the history
of this code has too many pre-zeroed structure assumptions. Remove unused 'stub' functions Andrew Bartlett (This used to be commit 78dc57c65513ba4c271308d84fc2a2a533f76061)
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/ntlmssp/ntlmssp.c2
-rw-r--r--source4/auth/ntlmssp/ntlmssp_server.c45
2 files changed, 6 insertions, 41 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp.c b/source4/auth/ntlmssp/ntlmssp.c
index 3a4bc5a385..254736688b 100644
--- a/source4/auth/ntlmssp/ntlmssp.c
+++ b/source4/auth/ntlmssp/ntlmssp.c
@@ -307,7 +307,7 @@ NTSTATUS gensec_ntlmssp_start(struct gensec_security *gensec_security)
{
struct gensec_ntlmssp_state *gensec_ntlmssp_state;
- gensec_ntlmssp_state = talloc(gensec_security, struct gensec_ntlmssp_state);
+ gensec_ntlmssp_state = talloc_zero(gensec_security, struct gensec_ntlmssp_state);
if (!gensec_ntlmssp_state) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c
index 891be43d81..c54d30abdc 100644
--- a/source4/auth/ntlmssp/ntlmssp_server.c
+++ b/source4/auth/ntlmssp/ntlmssp_server.c
@@ -74,42 +74,6 @@ static NTSTATUS ntlmssp_set_workstation(struct gensec_ntlmssp_state *gensec_ntlm
}
/**
- * Default challenge generation code.
- *
- */
-
-static const uint8_t *get_challenge(const struct gensec_ntlmssp_state *gensec_ntlmssp_state)
-{
- uint8_t *chal = talloc_size(gensec_ntlmssp_state, 8);
- generate_random_buffer(chal, 8);
-
- return chal;
-}
-
-/**
- * Default 'we can set the challenge to anything we like' implementation
- *
- */
-
-static BOOL may_set_challenge(const struct gensec_ntlmssp_state *gensec_ntlmssp_state)
-{
- return True;
-}
-
-/**
- * Default 'we can set the challenge to anything we like' implementation
- *
- * Does not actually do anything, as the value is always in the structure anyway.
- *
- */
-
-static NTSTATUS set_challenge(struct gensec_ntlmssp_state *gensec_ntlmssp_state, DATA_BLOB *challenge)
-{
- SMB_ASSERT(challenge->length == 8);
- return NT_STATUS_OK;
-}
-
-/**
* Determine correct target name flags for reply, given server role
* and negotiated flags
*
@@ -295,6 +259,7 @@ static NTSTATUS ntlmssp_server_preauth(struct gensec_ntlmssp_state *gensec_ntlms
/* zero these out */
data_blob_free(&gensec_ntlmssp_state->lm_resp);
data_blob_free(&gensec_ntlmssp_state->nt_resp);
+ data_blob_free(&gensec_ntlmssp_state->encrypted_session_key);
gensec_ntlmssp_state->user = NULL;
gensec_ntlmssp_state->domain = NULL;
@@ -733,10 +698,6 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
gensec_ntlmssp_state->role = NTLMSSP_SERVER;
- gensec_ntlmssp_state->get_challenge = get_challenge;
- gensec_ntlmssp_state->set_challenge = set_challenge;
- gensec_ntlmssp_state->may_set_challenge = may_set_challenge;
-
gensec_ntlmssp_state->workstation = NULL;
gensec_ntlmssp_state->server_name = lp_netbios_name();
@@ -754,6 +715,10 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
gensec_ntlmssp_state->neg_flags =
NTLMSSP_NEGOTIATE_NTLM;
+ gensec_ntlmssp_state->lm_resp = data_blob(NULL, 0);
+ gensec_ntlmssp_state->nt_resp = data_blob(NULL, 0);
+ gensec_ntlmssp_state->encrypted_session_key = data_blob(NULL, 0);
+
if (lp_parm_bool(-1, "ntlmssp_server", "128bit", True)) {
gensec_ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_128;
}