summaryrefslogtreecommitdiffstats
path: root/src/lib/gssapi/krb5/import_sec_context.c
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1995-09-16 07:33:23 +0000
committerTheodore Tso <tytso@mit.edu>1995-09-16 07:33:23 +0000
commit82f87f7e1268dd377295c09e0f266a99042e6220 (patch)
treee754af5495fea52c0b846c2b7a368cd395e458a8 /src/lib/gssapi/krb5/import_sec_context.c
parentc2380cebcdd54289bc48f5b8c56ff3309d007496 (diff)
downloadkrb5-82f87f7e1268dd377295c09e0f266a99042e6220.tar.gz
krb5-82f87f7e1268dd377295c09e0f266a99042e6220.tar.xz
krb5-82f87f7e1268dd377295c09e0f266a99042e6220.zip
Lots of memory leaks and other fixes...
gssapiP_krb5.h: Remove context and cred from the gssapi security context, as they aren't needed. kg_seal and kg_unseal now take a krb5_context argument. ser_sctx.c (kg_ctx_size, kg_ctx_externalize, kg_ctx_internalize): No longer serialize the context and cred fields of the gssapi security context. krb5_gss_glue.c: Don't rely on the context field of the gssapi security context. Use kg_context instead. verify.c (krb5_gss_verify, krb5_gss_verify_mic): unseal.c (krb5_gss_unwrap, krb5_gss_unseal): sign.c (krb5_gss_sign, krb5_gss_get_mic): seal.c (krb5_gss_seal, krb5_gss_wrap): process_context_token.c (krb5_gss_process_context_token): k5unseal.c (kg_unseal): k5seal.c (kg_seal_size): Add a krb5_context argument to this function, so we don't have to depend on the context field in the gssapi security context. init_sec_context.c (krb5_gss_init_sec_context): Don't initialize the context and cred fields in the gssapi security context. Copy ctx->subkey to ctx->seq.key, so they are separately allocated. gssapi_krb5.c (kg_get_context): When initialize kg_context, call krb5_init_ets() so that the error tables are initialized. export_sec_context.c (krb5_gss_export_sec_context): Don't depend on the context field from the gssapi security context. Free ctx->seq.key. delete_sec_context.c (krb5_gss_delete_sec_context): kg_seal() now takes a krb5_context argument. Free ctx->seq.key. acquire_cred.c (krb5_gss_acquire_cred): Clear the gssapi credential before setting it, to prevent purify from complaining. accept_sec_context.c (krb5_gss_accept_sec_context): Remove context and cred from the gssapi security context. Make sure the ticket is freed after we're done with it. import_sec_context.c (krb5_gss_import_sec_context): Don't bash the input interprocess_token. Otherwise, it can't be freed. Don't depend on the context field in the gss security context. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6798 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/gssapi/krb5/import_sec_context.c')
-rw-r--r--src/lib/gssapi/krb5/import_sec_context.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/gssapi/krb5/import_sec_context.c b/src/lib/gssapi/krb5/import_sec_context.c
index 1c9ffabd80..cc20ec8f68 100644
--- a/src/lib/gssapi/krb5/import_sec_context.c
+++ b/src/lib/gssapi/krb5/import_sec_context.c
@@ -69,8 +69,6 @@ krb5_gss_import_sec_context(context,
/* Make sure that everything is cool. */
if (kg_validate_ctx_id((gss_ctx_id_t) ctx)) {
- interprocess_token->value = ibp;
- interprocess_token->length = blen;
*context_handle = (gss_ctx_id_t) ctx;
retval = GSS_S_COMPLETE;
}
@@ -82,13 +80,13 @@ krb5_gss_import_sec_context(context,
if (ctx) {
(void) kg_delete_ctx_id((gss_ctx_id_t) ctx);
if (ctx->enc.processed)
- krb5_finish_key(ctx->context, &ctx->enc.eblock);
- krb5_free_keyblock(ctx->context, ctx->enc.key);
+ krb5_finish_key(context, &ctx->enc.eblock);
+ krb5_free_keyblock(context, ctx->enc.key);
if (ctx->seq.processed)
- krb5_finish_key(ctx->context, &ctx->seq.eblock);
- krb5_free_principal(ctx->context, ctx->here);
- krb5_free_principal(ctx->context, ctx->there);
- krb5_free_keyblock(ctx->context, ctx->subkey);
+ krb5_finish_key(context, &ctx->seq.eblock);
+ krb5_free_principal(context, ctx->here);
+ krb5_free_principal(context, ctx->there);
+ krb5_free_keyblock(context, ctx->subkey);
/* Zero out context */
memset(ctx, 0, sizeof(*ctx));