summaryrefslogtreecommitdiff
path: root/source3/auth/auth_generic.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-12-26 12:26:43 +1100
committerStefan Metzmacher <metze@samba.org>2012-01-05 17:17:28 +0100
commite22b1b4f9e1ec46cf7dffbce24a88240d6fa2a05 (patch)
tree777fd7d82132bf57c5d031d6385f1fddf5f04bbe /source3/auth/auth_generic.c
parent1075efabc73ef9e890fdb7a53b15cabf467c6a9b (diff)
downloadsamba-e22b1b4f9e1ec46cf7dffbce24a88240d6fa2a05.tar.gz
samba-e22b1b4f9e1ec46cf7dffbce24a88240d6fa2a05.tar.bz2
samba-e22b1b4f9e1ec46cf7dffbce24a88240d6fa2a05.zip
s3-auth re-create the auth context in the s3 ntlmssp server module
This removes the abstraction violation in auth_generic.c. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/auth/auth_generic.c')
-rw-r--r--source3/auth/auth_generic.c60
1 files changed, 3 insertions, 57 deletions
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c
index 34a499895e..13246d642f 100644
--- a/source3/auth/auth_generic.c
+++ b/source3/auth/auth_generic.c
@@ -112,66 +112,12 @@ NTSTATUS auth_generic_prepare(TALLOC_CTX *mem_ctx,
NTSTATUS auth_generic_start(struct auth_generic_state *auth_ntlmssp_state, const char *oid)
{
- struct gensec_ntlmssp_context *gensec_ntlmssp;
- NTSTATUS status;
-
- 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, oid);
- }
-
- if (strcmp(oid, GENSEC_OID_NTLMSSP) != 0) {
- return NT_STATUS_NOT_IMPLEMENTED;
- }
-
- status = gensec_start_mech_by_oid(auth_ntlmssp_state->gensec_security, oid);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- gensec_ntlmssp =
- talloc_get_type_abort(auth_ntlmssp_state->gensec_security->private_data,
- struct gensec_ntlmssp_context);
-
- gensec_ntlmssp->auth_context = talloc_move(gensec_ntlmssp, &auth_ntlmssp_state->auth_context);
-
- return NT_STATUS_OK;
+ return gensec_start_mech_by_oid(auth_ntlmssp_state->gensec_security, oid);
}
NTSTATUS auth_generic_authtype_start(struct auth_generic_state *auth_ntlmssp_state,
uint8_t auth_type, uint8_t auth_level)
{
- struct gensec_ntlmssp_context *gensec_ntlmssp;
- NTSTATUS status;
-
- if (auth_ntlmssp_state->auth_context->gensec_start_mech_by_authtype) {
- return auth_ntlmssp_state->auth_context->gensec_start_mech_by_authtype(
- auth_ntlmssp_state->gensec_security,
- auth_type, auth_level);
- }
-
- if (auth_type != DCERPC_AUTH_TYPE_NTLMSSP) {
- /* The caller will then free the auth_ntlmssp_state,
- * undoing what was done in auth_generic_prepare().
- *
- * We can't do that logic here, as
- * auth_ntlmssp_want_feature() may have been called in
- * between.
- */
- return NT_STATUS_NOT_IMPLEMENTED;
- }
-
- status = gensec_start_mech_by_authtype(auth_ntlmssp_state->gensec_security,
- auth_type, auth_level);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- gensec_ntlmssp =
- talloc_get_type_abort(auth_ntlmssp_state->gensec_security->private_data,
- struct gensec_ntlmssp_context);
-
- gensec_ntlmssp->auth_context = talloc_move(gensec_ntlmssp, &auth_ntlmssp_state->auth_context);
-
- return NT_STATUS_OK;
+ return gensec_start_mech_by_authtype(auth_ntlmssp_state->gensec_security,
+ auth_type, auth_level);
}