From cf8b97daa71f3f6ffc3dd3e81294c7177705c449 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Wed, 20 Mar 1996 01:02:57 +0000 Subject: [PATCH] * conv_creds.c (krb524_convert_creds_plain): if the v5 lifetime is greater than the max v4 lifetime, use the max v4 lifetime (0xff), rather than masking it with 0xff. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7671 dc483132-0cff-0310-8789-dd5450dbe970 --- src/krb524/ChangeLog | 6 ++++++ src/krb524/conv_creds.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/krb524/ChangeLog b/src/krb524/ChangeLog index 282941e2d..c9e7f1b6e 100644 --- a/src/krb524/ChangeLog +++ b/src/krb524/ChangeLog @@ -1,3 +1,9 @@ +Tue Mar 19 17:07:44 1996 Richard Basch + + * conv_creds.c (krb524_convert_creds_plain): + if the v5 lifetime is greater than the max v4 lifetime, use the max + v4 lifetime (0xff), rather than masking it with 0xff. + Fri Jan 12 04:37:23 1996 Mark Eichin * cnv_tkt_skey.c (krb524_convert_tkt_skey): rather than apply fit diff --git a/src/krb524/conv_creds.c b/src/krb524/conv_creds.c index 5ab295f2b..5346f883d 100644 --- a/src/krb524/conv_creds.c +++ b/src/krb524/conv_creds.c @@ -99,6 +99,7 @@ int krb524_convert_creds_plain(context, v5creds, v4creds) { unsigned long addr; int ret; + krb5_timestamp lifetime; memset((char *) v4creds, 0, sizeof(CREDENTIALS)); @@ -122,8 +123,10 @@ int krb524_convert_creds_plain(context, v5creds, v4creds) /* V4 has no concept of authtime or renew_till, so ignore them */ /* V4 lifetime is 1 byte, in 5 minute increments */ - v4creds->lifetime = 0xff & + lifetime = ((v5creds->times.endtime - v5creds->times.starttime) / 300); + v4creds->lifetime = + ((lifetime > 0xff) ? 0xff : lifetime); v4creds->issue_date = v5creds->times.starttime; /* XXX perhaps we should use the addr of the client host if */ -- 2.26.2