add _krb5_krb_life_to_time

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11832 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-03-18 03:11:16 +00:00
parent 40c455e927
commit 1d25cbb527
2 changed files with 24 additions and 0 deletions

View File

@@ -79,6 +79,26 @@ _krb5_krb_time_to_life(time_t start, time_t end)
}
time_t
_krb5_krb_life_to_time(int start, int life_)
{
unsigned char life = (unsigned char) life_;
#if 0
if (krb_no_long_lifetimes)
return start + life*5*60;
#endif
if (life == TKTLIFENOEXPIRE)
return NEVERDATE;
if (life < TKTLIFEMINFIXED)
return start + life*5*60;
if (life > TKTLIFEMAXFIXED)
return start + MAXTKTLIFETIME;
return start + _tkt_lifetimes[life - TKTLIFEMINFIXED];
}
/* Convert the v5 credentials in `in_cred' to v4-dito in `v4creds'.
* This is done by sending them to the 524 function in the KDC. If
* `in_cred' doesn't contain a DES session key, then a new one is

View File

@@ -84,6 +84,10 @@ struct credentials {
int
_krb5_krb_time_to_life(time_t start, time_t end);
time_t
_krb5_krb_life_to_time(int start, int life_);
#define krb_time_to_life _krb5_krb_time_to_life
#define krb_life_to_time _krb5_krb_life_to_time
#endif /* __KRB5_V4COMPAT_H__ */