summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-06-13 22:41:14 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-06-29 15:59:21 +0200
commit6cdc7e2fc28c924230c59b4f67bd97472d1719eb (patch)
tree873d9a2991de5668c3f7c734693c338571d41433 /auth
parent2e0f749758d14a9be11a6b833a6e9c86bdada452 (diff)
downloadsamba-6cdc7e2fc28c924230c59b4f67bd97472d1719eb.tar.gz
auth/spnego: move some more logic to gensec_spnego_update_in()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'auth')
-rw-r--r--auth/gensec/spnego.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/auth/gensec/spnego.c b/auth/gensec/spnego.c
index 628652c5f5c..7e86d1f433b 100644
--- a/auth/gensec/spnego.c
+++ b/auth/gensec/spnego.c
@@ -1327,7 +1327,8 @@ static void gensec_spnego_update_cleanup(struct tevent_req *req,
}
static NTSTATUS gensec_spnego_update_in(struct gensec_security *gensec_security,
- const DATA_BLOB in, DATA_BLOB *full_in);
+ const DATA_BLOB in, TALLOC_CTX *mem_ctx,
+ DATA_BLOB *full_in);
static struct tevent_req *gensec_spnego_update_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
@@ -1371,8 +1372,8 @@ static struct tevent_req *gensec_spnego_update_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- status = gensec_spnego_update_in(gensec_security,
- in, &state->full_in);
+ status = gensec_spnego_update_in(gensec_security, in,
+ state, &state->full_in);
state->status = status;
if (NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
tevent_req_done(req);
@@ -1386,8 +1387,6 @@ static struct tevent_req *gensec_spnego_update_send(TALLOC_CTX *mem_ctx,
state, ev,
state->full_in,
&spnego_state->out_frag);
- data_blob_free(&spnego_state->in_frag);
- spnego_state->in_needed = 0;
if (NT_STATUS_IS_OK(status)) {
bool reset_full = true;
@@ -1420,7 +1419,8 @@ static struct tevent_req *gensec_spnego_update_send(TALLOC_CTX *mem_ctx,
}
static NTSTATUS gensec_spnego_update_in(struct gensec_security *gensec_security,
- const DATA_BLOB in, DATA_BLOB *full_in)
+ const DATA_BLOB in, TALLOC_CTX *mem_ctx,
+ DATA_BLOB *full_in)
{
struct spnego_state *spnego_state = (struct spnego_state *)gensec_security->private_data;
size_t expected;
@@ -1488,6 +1488,7 @@ static NTSTATUS gensec_spnego_update_in(struct gensec_security *gensec_security,
* more than expected.
*/
*full_in = in;
+ spnego_state->in_needed = 0;
return NT_STATUS_OK;
}
@@ -1502,6 +1503,9 @@ static NTSTATUS gensec_spnego_update_in(struct gensec_security *gensec_security,
}
*full_in = spnego_state->in_frag;
+ talloc_steal(mem_ctx, full_in->data);
+ spnego_state->in_frag = data_blob_null;
+ spnego_state->in_needed = 0;
return NT_STATUS_OK;
}