diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-05-11 12:48:41 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-05-21 21:05:11 +0200 |
commit | a5f37e6cca68358d6ae077977ee6b690981a7cd9 (patch) | |
tree | b4a034d9d1cd6f403d04a797db7b916ccb83b7ed /auth | |
parent | 9f3d94b750fa9a7f1d724abcc1688f3cc02a29ad (diff) | |
download | samba-a5f37e6cca68358d6ae077977ee6b690981a7cd9.tar.gz |
auth/gensec: remove the sync update() hook from gensec_security_ops
Some backends still do some nested event context magic,
but that mapping between async and sync is done in these backends
and not in the core gensec code anymore.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth')
-rw-r--r-- | auth/gensec/gensec.c | 84 | ||||
-rw-r--r-- | auth/gensec/gensec_internal.h | 3 |
2 files changed, 0 insertions, 87 deletions
diff --git a/auth/gensec/gensec.c b/auth/gensec/gensec.c index 9b1661eebcd..df4ac4e53f1 100644 --- a/auth/gensec/gensec.c +++ b/auth/gensec/gensec.c @@ -334,47 +334,6 @@ _PUBLIC_ NTSTATUS gensec_update_ev(struct gensec_security *gensec_security, return NT_STATUS_INVALID_PARAMETER; } - if (ops->update_send == NULL) { - - if (ev == NULL) { - frame = talloc_stackframe(); - - ev = samba_tevent_context_init(frame); - if (ev == NULL) { - status = NT_STATUS_NO_MEMORY; - goto fail; - } - - /* - * TODO: remove this hack once the backends - * are fixed. - */ - tevent_loop_allow_nesting(ev); - } - - status = ops->update(gensec_security, out_mem_ctx, - ev, in, out); - TALLOC_FREE(frame); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - /* - * Because callers using the - * gensec_start_mech_by_auth_type() never call - * gensec_want_feature(), it isn't sensible for them - * to have to call gensec_have_feature() manually, and - * these are not points of negotiation, but are - * asserted by the client - */ - status = gensec_verify_features(gensec_security); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - - return NT_STATUS_OK; - } - frame = talloc_stackframe(); if (ev == NULL) { @@ -442,18 +401,8 @@ struct gensec_update_state { struct tevent_req *subreq; struct gensec_security *gensec_security; DATA_BLOB out; - - /* - * only for sync backends, we should remove this - * once all backends are async. - */ - struct tevent_immediate *im; - DATA_BLOB in; }; -static void gensec_update_async_trigger(struct tevent_context *ctx, - struct tevent_immediate *im, - void *private_data); static void gensec_update_subreq_done(struct tevent_req *subreq); /** @@ -489,20 +438,6 @@ _PUBLIC_ struct tevent_req *gensec_update_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } - if (state->ops->update_send == NULL) { - state->in = in; - state->im = tevent_create_immediate(state); - if (tevent_req_nomem(state->im, req)) { - return tevent_req_post(req, ev); - } - - tevent_schedule_immediate(state->im, ev, - gensec_update_async_trigger, - req); - - return req; - } - state->subreq = state->ops->update_send(state, ev, gensec_security, in); if (tevent_req_nomem(state->subreq, req)) { return tevent_req_post(req, ev); @@ -515,25 +450,6 @@ _PUBLIC_ struct tevent_req *gensec_update_send(TALLOC_CTX *mem_ctx, return req; } -static void gensec_update_async_trigger(struct tevent_context *ctx, - struct tevent_immediate *im, - void *private_data) -{ - struct tevent_req *req = - talloc_get_type_abort(private_data, struct tevent_req); - struct gensec_update_state *state = - tevent_req_data(req, struct gensec_update_state); - NTSTATUS status; - - status = state->ops->update(state->gensec_security, state, ctx, - state->in, &state->out); - if (tevent_req_nterror(req, status)) { - return; - } - - tevent_req_done(req); -} - static void gensec_update_subreq_done(struct tevent_req *subreq) { struct tevent_req *req = diff --git a/auth/gensec/gensec_internal.h b/auth/gensec/gensec_internal.h index 9c160d3d084..b3a84344d2d 100644 --- a/auth/gensec/gensec_internal.h +++ b/auth/gensec/gensec_internal.h @@ -37,9 +37,6 @@ struct gensec_security_ops { */ NTSTATUS (*magic)(struct gensec_security *gensec_security, const DATA_BLOB *first_packet); - NTSTATUS (*update)(struct gensec_security *gensec_security, TALLOC_CTX *out_mem_ctx, - struct tevent_context *ev, - const DATA_BLOB in, DATA_BLOB *out); struct tevent_req *(*update_send)(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct gensec_security *gensec_security, |