summaryrefslogtreecommitdiff
path: root/source4/libcli/auth/spnego.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-26 02:16:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:16 -0500
commit4b1050a6cf3e6d9f7a8e75dd90ed1ccd52f29abb (patch)
tree17ccfac3fbbde4dc6c48ce01dc530e39c8e8f21a /source4/libcli/auth/spnego.c
parent525a993469f50ccf8cf5a44cb337a06d61f50622 (diff)
downloadsamba-4b1050a6cf3e6d9f7a8e75dd90ed1ccd52f29abb.tar.gz
samba-4b1050a6cf3e6d9f7a8e75dd90ed1ccd52f29abb.tar.bz2
samba-4b1050a6cf3e6d9f7a8e75dd90ed1ccd52f29abb.zip
r2645: converted the NTLMSSP code to the new style of talloc
(This used to be commit b378aae95d4001c4cf4e6e59ed80ee1bd55382ee)
Diffstat (limited to 'source4/libcli/auth/spnego.c')
-rw-r--r--source4/libcli/auth/spnego.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/source4/libcli/auth/spnego.c b/source4/libcli/auth/spnego.c
index bbf8f86676..efe9ad675b 100644
--- a/source4/libcli/auth/spnego.c
+++ b/source4/libcli/auth/spnego.c
@@ -37,7 +37,6 @@ enum spnego_state_position {
};
struct spnego_state {
- TALLOC_CTX *mem_ctx;
uint_t ref_count;
enum spnego_message_type expected_packet;
enum spnego_state_position state_position;
@@ -47,19 +46,14 @@ struct spnego_state {
static NTSTATUS gensec_spnego_client_start(struct gensec_security *gensec_security)
{
struct spnego_state *spnego_state;
- TALLOC_CTX *mem_ctx = talloc_init("gensec_spnego_client_start");
- if (!mem_ctx) {
- return NT_STATUS_NO_MEMORY;
- }
- spnego_state = talloc_p(mem_ctx, struct spnego_state);
-
+
+ spnego_state = talloc_p(gensec_security, struct spnego_state);
if (!spnego_state) {
return NT_STATUS_NO_MEMORY;
}
spnego_state->expected_packet = SPNEGO_NEG_TOKEN_INIT;
spnego_state->state_position = SPNEGO_CLIENT_START;
- spnego_state->mem_ctx = mem_ctx;
spnego_state->sub_sec_security = NULL;
gensec_security->private_data = spnego_state;
@@ -69,19 +63,14 @@ static NTSTATUS gensec_spnego_client_start(struct gensec_security *gensec_securi
static NTSTATUS gensec_spnego_server_start(struct gensec_security *gensec_security)
{
struct spnego_state *spnego_state;
- TALLOC_CTX *mem_ctx = talloc_init("gensec_spnego_server_start");
- if (!mem_ctx) {
- return NT_STATUS_NO_MEMORY;
- }
- spnego_state = talloc_p(mem_ctx, struct spnego_state);
-
+
+ spnego_state = talloc_p(gensec_security, struct spnego_state);
if (!spnego_state) {
return NT_STATUS_NO_MEMORY;
}
spnego_state->expected_packet = SPNEGO_NEG_TOKEN_INIT;
spnego_state->state_position = SPNEGO_SERVER_START;
- spnego_state->mem_ctx = mem_ctx;
spnego_state->sub_sec_security = NULL;
gensec_security->private_data = spnego_state;
@@ -426,7 +415,7 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA
*out = data_blob(NULL, 0);
if (!out_mem_ctx) {
- out_mem_ctx = spnego_state->mem_ctx;
+ out_mem_ctx = spnego_state;
}
/* and switch into the state machine */
@@ -701,7 +690,7 @@ static void gensec_spnego_end(struct gensec_security *gensec_security)
gensec_end(&spnego_state->sub_sec_security);
}
- talloc_destroy(spnego_state->mem_ctx);
+ talloc_free(spnego_state);
gensec_security->private_data = NULL;
}