diff options
author | Luke Howard <lukeh@padl.com> | 2009-12-15 19:51:22 +0000 |
---|---|---|
committer | Luke Howard <lukeh@padl.com> | 2009-12-15 19:51:22 +0000 |
commit | 60b630669c60bc7dc395835b34cd890b532677f4 (patch) | |
tree | 4d8550372150f4f391858082f238bc9075e5ad68 | |
parent | 16b5ddeab41967a2f830db86d3bb7255781f235d (diff) | |
download | krb5-60b630669c60bc7dc395835b34cd890b532677f4.zip krb5-60b630669c60bc7dc395835b34cd890b532677f4.tar.gz krb5-60b630669c60bc7dc395835b34cd890b532677f4.tar.bz2 |
make IAKERB use krb5_get_init_creds_opt_set_out_ccache()
git-svn-id: svn://anonsvn.mit.edu/krb5/users/lhoward/iakerb-refonly@23474 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/lib/gssapi/krb5/iakerb.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/lib/gssapi/krb5/iakerb.c b/src/lib/gssapi/krb5/iakerb.c index 0597d3d..33f7f90 100644 --- a/src/lib/gssapi/krb5/iakerb.c +++ b/src/lib/gssapi/krb5/iakerb.c @@ -53,6 +53,7 @@ struct _iakerb_ctx_id_rec { } u; krb5_data conv; /* conversation for checksumming */ unsigned int count; /* number of round trips */ + krb5_get_init_creds_opt *gic_opts; }; #define IAKERB_MAX_HOPS ( 16 /* MAX_IN_TKT_LOOPS */ + KRB5_REFERRAL_MAXHOPS ) @@ -83,6 +84,7 @@ iakerb_release_context(iakerb_ctx_id_t ctx) break; } krb5_free_data_contents(ctx->k5c, &ctx->conv); + krb5_get_init_creds_opt_free(ctx->k5c, ctx->gic_opts); krb5_free_context(ctx->k5c); free(ctx); } @@ -441,7 +443,6 @@ iakerb_init_creds_ctx(iakerb_ctx_id_t ctx, OM_uint32 time_req) { krb5_error_code code; - krb5_get_init_creds_opt opts; if (cred->iakerb_mech == 0 || cred->password.data == NULL) { code = EINVAL; @@ -451,16 +452,24 @@ iakerb_init_creds_ctx(iakerb_ctx_id_t ctx, assert(cred->name != NULL); assert(cred->name->princ != NULL); - krb5_get_init_creds_opt_init(&opts); + code = krb5_get_init_creds_opt_alloc(ctx->k5c, &ctx->gic_opts); + if (code != 0) + goto cleanup; + if (time_req != 0 && time_req != GSS_C_INDEFINITE) - krb5_get_init_creds_opt_set_tkt_life(&opts, time_req); + krb5_get_init_creds_opt_set_tkt_life(ctx->gic_opts, time_req); + + code = krb5_get_init_creds_opt_set_out_ccache(ctx->k5c, ctx->gic_opts, + cred->ccache); + if (code != 0) + goto cleanup; code = krb5_init_creds_init(ctx->k5c, cred->name->princ, NULL, /* prompter */ NULL, /* data */ 0, /* start_time */ - &opts, + ctx->gic_opts, &ctx->u.icc); if (code != 0) goto cleanup; @@ -591,11 +600,6 @@ iakerb_initiator_step(iakerb_ctx_id_t ctx, if (code != 0) goto cleanup; if (flags != 0) { - code = krb5_init_creds_store_creds(ctx->k5c, ctx->u.icc, - cred->ccache); - if (code != 0) - goto cleanup; - krb5_init_creds_get_times(ctx->k5c, ctx->u.icc, ×); cred->tgt_expire = times.endtime; |