diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-12-24 09:54:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:37 -0500 |
commit | 44113c4de1ae06a78a940782dc762b6576310d0d (patch) | |
tree | 7d6e30dc5a56b11edcd2def2304aa78071b1405e /source4/librpc | |
parent | bebe512a57c6aabe6cd539750834297a17b5c4f5 (diff) | |
download | samba-44113c4de1ae06a78a940782dc762b6576310d0d.tar.gz samba-44113c4de1ae06a78a940782dc762b6576310d0d.tar.bz2 samba-44113c4de1ae06a78a940782dc762b6576310d0d.zip |
r4355: More work from the elves on Christmas eve:
- Update Samba4's kerberos code to match the 'salting' changes in
Samba3 (and many other cleanups by jra).
- Move GENSEC into the modern era of talloc destructors. This avoids
many of the memory leaks in this code, as we now can't somehow
'forget' to call the end routine.
- This required fixing some of the talloc hierarchies.
- The new krb5 seems more sensitive to getting the service name
right, so start actually setting the service name on the krb5 context.
Andrew Bartlett
(This used to be commit 278bf1a61a6da6ef955a12c13d7b1a0357cebf1f)
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/rpc/dcerpc_schannel.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c index ab32a82934..635735a55d 100644 --- a/source4/librpc/rpc/dcerpc_schannel.c +++ b/source4/librpc/rpc/dcerpc_schannel.c @@ -266,6 +266,18 @@ NTSTATUS dcerpc_schannel_creds(struct gensec_security *gensec_security, } +/* + end crypto state +*/ +static int dcerpc_schannel_destroy(void *ptr) +{ + struct dcerpc_schannel_state *dce_schan_state = ptr; + + schannel_end(&dce_schan_state->schannel_state); + + return 0; +} + static NTSTATUS dcerpc_schannel_start(struct gensec_security *gensec_security) { struct dcerpc_schannel_state *dce_schan_state; @@ -281,6 +293,8 @@ static NTSTATUS dcerpc_schannel_start(struct gensec_security *gensec_security) GENSEC_FEATURE_SESSION_KEY | GENSEC_FEATURE_SIGN | GENSEC_FEATURE_SEAL; + + talloc_set_destructor(dce_schan_state, dcerpc_schannel_destroy); return NT_STATUS_OK; } @@ -309,20 +323,6 @@ static NTSTATUS dcerpc_schannel_client_start(struct gensec_security *gensec_secu return NT_STATUS_OK; } -/* - end crypto state -*/ -static void dcerpc_schannel_end(struct gensec_security *gensec_security) -{ - struct dcerpc_schannel_state *dce_schan_state = gensec_security->private_data; - - schannel_end(&dce_schan_state->schannel_state); - - talloc_free(dce_schan_state); - - gensec_security->private_data = NULL; -} - /* get a schannel key using a netlogon challenge on a secondary pipe @@ -522,7 +522,6 @@ static const struct gensec_security_ops gensec_dcerpc_schannel_security_ops = { .session_key = dcerpc_schannel_session_key, .session_info = dcerpc_schannel_session_info, .sig_size = dcerpc_schannel_sig_size, - .end = dcerpc_schannel_end }; NTSTATUS gensec_dcerpc_schannel_init(void) |