svn commit: samba r6465 - in
branches/SAMBA_4_0/source/auth/ntlmssp: .
abartlet at samba.org
abartlet at samba.org
Mon Apr 25 10:58:47 GMT 2005
Author: abartlet
Date: 2005-04-25 10:58:46 +0000 (Mon, 25 Apr 2005)
New Revision: 6465
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6465
Log:
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
Modified:
branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp.c
branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c
Changeset:
Modified: branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp.c
===================================================================
--- branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp.c 2005-04-25 10:33:00 UTC (rev 6464)
+++ branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp.c 2005-04-25 10:58:46 UTC (rev 6465)
@@ -307,7 +307,7 @@
{
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;
}
Modified: branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c
===================================================================
--- branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c 2005-04-25 10:33:00 UTC (rev 6464)
+++ branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_server.c 2005-04-25 10:58:46 UTC (rev 6465)
@@ -74,42 +74,6 @@
}
/**
- * 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 @@
/* 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 @@
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 @@
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;
}
More information about the samba-cvs
mailing list