From: Ezra Peisach Date: Sun, 7 Jul 1996 19:20:37 +0000 (+0000) Subject: * get_creds.c: (krb5_get_credentials_val_renew_core) Combine X-Git-Tag: krb5-1.0-beta7~322 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=001b4bd4a5b0c26c815ff3c7a66643a10a55cb45;p=krb5.git * get_creds.c: (krb5_get_credentials_val_renew_core) Combine common internals needed from krb5_get_credentials_validate() and used by new function krb5_get_credentials_renew() * gc_frm_kdc.c (krb5_get_cred_from_kdc_renew): A wrapper that passes KDC_OPT_RENEW to the static krb5_get_cred_from_kdc_opt so that kinit can use it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8558 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 6d36c7fe3..6234b1bb3 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,14 @@ +Sun Jul 7 15:14:43 1996 Ezra Peisach + + * get_creds.c: (krb5_get_credentials_val_renew_core) Combine + common internals needed from krb5_get_credentials_validate() + and used by new function krb5_get_credentials_renew() + + * gc_frm_kdc.c (krb5_get_cred_from_kdc_renew): A wrapper that + passes KDC_OPT_RENEW to the static + krb5_get_cred_from_kdc_opt so that kinit can use it. + + Mon Jun 24 09:45:04 1996 Theodore Ts'o * bld_princ.c (krb5_build_principal_va): Change const to diff --git a/src/lib/krb5/krb/gc_frm_kdc.c b/src/lib/krb5/krb/gc_frm_kdc.c index 4b4120d14..ac31b466d 100644 --- a/src/lib/krb5/krb/gc_frm_kdc.c +++ b/src/lib/krb5/krb/gc_frm_kdc.c @@ -424,3 +424,16 @@ krb5_get_cred_from_kdc_validate(context, ccache, in_cred, out_cred, tgts) return krb5_get_cred_from_kdc_opt(context, ccache, in_cred, out_cred, tgts, KDC_OPT_VALIDATE); } + +krb5_error_code +krb5_get_cred_from_kdc_renew(context, ccache, in_cred, out_cred, tgts) + krb5_context context; + krb5_ccache ccache; + krb5_creds *in_cred; + krb5_creds **out_cred; + krb5_creds ***tgts; +{ + + return krb5_get_cred_from_kdc_opt(context, ccache, in_cred, out_cred, tgts, + KDC_OPT_RENEW); +} diff --git a/src/lib/krb5/krb/get_creds.c b/src/lib/krb5/krb/get_creds.c index 19cff0365..4ff62f174 100644 --- a/src/lib/krb5/krb/get_creds.c +++ b/src/lib/krb5/krb/get_creds.c @@ -143,13 +143,18 @@ krb5_get_credentials(context, options, ccache, in_creds, out_creds) return retval; } -krb5_error_code INTERFACE -krb5_get_credentials_validate(context, options, ccache, in_creds, out_creds) +#define INT_GC_VALIDATE 1 +#define INT_GC_RENEW 2 + +static krb5_error_code +krb5_get_credentials_val_renew_core(context, options, ccache, + in_creds, out_creds, which) krb5_context context; const krb5_flags options; krb5_ccache ccache; krb5_creds *in_creds; krb5_creds **out_creds; + int which; { krb5_error_code retval; krb5_creds mcreds; @@ -163,8 +168,20 @@ krb5_get_credentials_validate(context, options, ccache, in_creds, out_creds) if (retval) return retval; - retval = krb5_get_cred_from_kdc_validate(context, ccache, + switch(which) { + case INT_GC_VALIDATE: + retval = krb5_get_cred_from_kdc_validate(context, ccache, + in_creds, out_creds, &tgts); + break; + case INT_GC_RENEW: + retval = krb5_get_cred_from_kdc_renew(context, ccache, in_creds, out_creds, &tgts); + break; + default: + /* Should never happen */ + retval = 255; + break; + } if (retval) return retval; if (tgts) krb5_free_tgt_creds(context, tgts); @@ -177,3 +194,30 @@ krb5_get_credentials_validate(context, options, ccache, in_creds, out_creds) retval = krb5_cc_store_cred(context, ccache, *out_creds); return retval; } + +krb5_error_code INTERFACE +krb5_get_credentials_validate(context, options, ccache, in_creds, out_creds) + krb5_context context; + const krb5_flags options; + krb5_ccache ccache; + krb5_creds *in_creds; + krb5_creds **out_creds; +{ + return(krb5_get_credentials_val_renew_core(context, options, ccache, + in_creds, out_creds, + INT_GC_VALIDATE)); +} + +krb5_error_code INTERFACE +krb5_get_credentials_renew(context, options, ccache, in_creds, out_creds) + krb5_context context; + const krb5_flags options; + krb5_ccache ccache; + krb5_creds *in_creds; + krb5_creds **out_creds; +{ + + return(krb5_get_credentials_val_renew_core(context, options, ccache, + in_creds, out_creds, + INT_GC_RENEW)); +}