summaryrefslogtreecommitdiff
path: root/source3/auth/auth_ntlmssp.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-07-26 14:40:33 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-08-03 18:48:04 +1000
commit9f663270fd7d40dbaf258fe6818685d42249a827 (patch)
tree33e966fa244efcfb3e130e6b2a33cfe827818939 /source3/auth/auth_ntlmssp.c
parent23bbf4e75850badaac7359643f9479bfa9d68a4e (diff)
downloadsamba-9f663270fd7d40dbaf258fe6818685d42249a827.tar.gz
samba-9f663270fd7d40dbaf258fe6818685d42249a827.tar.bz2
samba-9f663270fd7d40dbaf258fe6818685d42249a827.zip
s3-auth Add function to start any GENSEC mech by OID
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/auth/auth_ntlmssp.c')
-rw-r--r--source3/auth/auth_ntlmssp.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c
index 0d25ecdf68..fc197ce605 100644
--- a/source3/auth/auth_ntlmssp.c
+++ b/source3/auth/auth_ntlmssp.c
@@ -282,11 +282,27 @@ static int auth_ntlmssp_state_destructor(void *ptr)
return 0;
}
-NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state *auth_ntlmssp_state)
+NTSTATUS auth_generic_start(struct auth_ntlmssp_state *auth_ntlmssp_state, const char *oid)
{
if (auth_ntlmssp_state->auth_context->gensec_start_mech_by_oid) {
- return auth_ntlmssp_state->auth_context->gensec_start_mech_by_oid(auth_ntlmssp_state->gensec_security, GENSEC_OID_NTLMSSP);
+ return auth_ntlmssp_state->auth_context->gensec_start_mech_by_oid(auth_ntlmssp_state->gensec_security, oid);
+ }
+
+ if (strcmp(oid, GENSEC_OID_NTLMSSP) != 0) {
+ /* The caller will then free the auth_ntlmssp_state,
+ * undoing what was done in auth_ntlmssp_prepare().
+ *
+ * We can't do that logic here, as
+ * auth_ntlmssp_want_feature() may have been called in
+ * between.
+ */
+ return NT_STATUS_NOT_IMPLEMENTED;
}
return NT_STATUS_OK;
}
+
+NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state *auth_ntlmssp_state)
+{
+ return auth_generic_start(auth_ntlmssp_state, GENSEC_OID_NTLMSSP);
+}