diff options
Diffstat (limited to 'source4/auth/gensec/ntlmssp.c')
-rw-r--r-- | source4/auth/gensec/ntlmssp.c | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/source4/auth/gensec/ntlmssp.c b/source4/auth/gensec/ntlmssp.c index c17352a469..5b40a412bd 100644 --- a/source4/auth/gensec/ntlmssp.c +++ b/source4/auth/gensec/ntlmssp.c @@ -325,9 +325,12 @@ static NTSTATUS gensec_ntlmssp_update(struct gensec_security *gensec_security, T * @param ntlmssp_state NTLMSSP State */ -NTSTATUS ntlmssp_session_key(struct ntlmssp_state *ntlmssp_state, - DATA_BLOB *session_key) +NTSTATUS gensec_ntlmssp_session_key(struct gensec_security *gensec_security, + DATA_BLOB *session_key) { + struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data; + struct ntlmssp_state *ntlmssp_state = gensec_ntlmssp_state->ntlmssp_state; + if (!ntlmssp_state->session_key.data) { return NT_STATUS_NO_USER_SESSION_KEY; } @@ -337,24 +340,6 @@ NTSTATUS ntlmssp_session_key(struct ntlmssp_state *ntlmssp_state, } /** - * End an NTLMSSP state machine - * - * @param ntlmssp_state NTLMSSP State, free()ed by this function - */ - -void ntlmssp_end(struct ntlmssp_state **ntlmssp_state) -{ - (*ntlmssp_state)->ref_count--; - - if ((*ntlmssp_state)->ref_count == 0) { - talloc_free(*ntlmssp_state); - } - - *ntlmssp_state = NULL; - return; -} - -/** * Determine correct target name flags for reply, given server role * and negotiated flags * @@ -1440,17 +1425,6 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, return nt_status; } -static int gensec_ntlmssp_destroy(void *ptr) -{ - struct gensec_ntlmssp_state *gensec_ntlmssp_state = ptr; - - if (gensec_ntlmssp_state->ntlmssp_state) { - ntlmssp_end(&gensec_ntlmssp_state->ntlmssp_state); - } - - return 0; -} - static NTSTATUS gensec_ntlmssp_start(struct gensec_security *gensec_security) { struct gensec_ntlmssp_state *gensec_ntlmssp_state; @@ -1465,8 +1439,6 @@ static NTSTATUS gensec_ntlmssp_start(struct gensec_security *gensec_security) gensec_ntlmssp_state->server_info = NULL; gensec_ntlmssp_state->have_features = 0; - talloc_set_destructor(gensec_ntlmssp_state, gensec_ntlmssp_destroy); - gensec_security->private_data = gensec_ntlmssp_state; return NT_STATUS_OK; } @@ -1560,14 +1532,6 @@ static NTSTATUS gensec_ntlmssp_client_start(struct gensec_security *gensec_secur return NT_STATUS_OK; } -static NTSTATUS gensec_ntlmssp_session_key(struct gensec_security *gensec_security, - DATA_BLOB *session_key) -{ - struct gensec_ntlmssp_state *gensec_ntlmssp_state = gensec_security->private_data; - - return ntlmssp_session_key(gensec_ntlmssp_state->ntlmssp_state, session_key); -} - /** * Return the credentials of a logged on user, including session keys * etc. |