diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-05-11 13:23:07 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-05-21 21:05:11 +0200 |
commit | 8a3a1111ed2561a40333ebf644a82314ffde7b15 (patch) | |
tree | be374f6cc2fb4af901e04da5d6f327b328eceb9c /auth | |
parent | 9e3b27d35cca992d92735d0019a5524ef9b5b293 (diff) | |
download | samba-8a3a1111ed2561a40333ebf644a82314ffde7b15.tar.gz |
auth/gensec: improve NT_STATUS_MORE_PROCESSING_REQUIRED logic in gensec_update_*()
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 | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/auth/gensec/gensec.c b/auth/gensec/gensec.c index b37f560c0da..cf00a363247 100644 --- a/auth/gensec/gensec.c +++ b/auth/gensec/gensec.c @@ -399,6 +399,7 @@ _PUBLIC_ NTSTATUS gensec_update(struct gensec_security *gensec_security, struct gensec_update_state { const struct gensec_security_ops *ops; struct gensec_security *gensec_security; + NTSTATUS status; DATA_BLOB out; }; @@ -459,6 +460,11 @@ static void gensec_update_done(struct tevent_req *subreq) status = state->ops->update_recv(subreq, state, &state->out); TALLOC_FREE(subreq); + state->status = status; + if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { + tevent_req_done(req); + return; + } if (tevent_req_nterror(req, status)) { return; } @@ -496,18 +502,16 @@ _PUBLIC_ NTSTATUS gensec_update_recv(struct tevent_req *req, tevent_req_data(req, struct gensec_update_state); NTSTATUS status; + *out = data_blob_null; + if (tevent_req_is_nterror(req, &status)) { - if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { - tevent_req_received(req); - return status; - } - } else { - status = NT_STATUS_OK; + tevent_req_received(req); + return status; } *out = state->out; talloc_steal(out_mem_ctx, out->data); - + status = state->status; tevent_req_received(req); return status; } |