From 61717cbfd41b6180794b88185cf851880fe8ecb0 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Fri, 15 Aug 1997 01:47:32 +0000 Subject: [PATCH] kdc-req-body->till is optional. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2989 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kdc/kerberos5.c | 24 +++++++++++++++--------- lib/krb5/get_cred.c | 5 ++++- lib/krb5/get_in_tkt.c | 5 ++++- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/kdc/kerberos5.c b/kdc/kerberos5.c index aa66e7d00..32ccc6fe3 100644 --- a/kdc/kerberos5.c +++ b/kdc/kerberos5.c @@ -354,9 +354,11 @@ as_rep(KDC_REQ *req, kdc_log(2, "Postdated ticket requested -- %s", client_name); } - if(b->till == 0) - b->till = MAX_TIME; - t = b->till; + if(b->till == NULL){ + ALLOC(b->till); + *b->till = MAX_TIME; + } + t = *b->till; if(client->max_life) t = min(t, start + *client->max_life); if(server->max_life) @@ -365,14 +367,14 @@ as_rep(KDC_REQ *req, t = min(t, start + realm->max_life); #endif et.endtime = t; - if(f.renewable_ok && et.endtime < b->till){ + if(f.renewable_ok && et.endtime < *b->till){ f.renewable = 1; if(b->rtime == NULL){ ALLOC(b->rtime); *b->rtime = 0; } - if(*b->rtime < b->till) - *b->rtime = b->till; + if(*b->rtime < *b->till) + *b->rtime = *b->till; } if(f.renewable && b->rtime){ t = *b->rtime; @@ -680,7 +682,11 @@ tgs_make_reply(KDC_REQ_BODY *b, EncTicketPart *tgt, rep.msg_type = krb_tgs_rep; et.authtime = tgt->authtime; - et.endtime = min(tgt->endtime, b->till); + if(b->till == NULL){ + ALLOC(b->till); + *b->till = MAX_TIME; + } + et.endtime = min(tgt->endtime, *b->till); ALLOC(et.starttime); *et.starttime = kdc_time; @@ -709,10 +715,10 @@ tgs_make_reply(KDC_REQ_BODY *b, EncTicketPart *tgt, et.endtime = *et.starttime + life; } if(f.renewable_ok && tgt->flags.renewable && - et.renew_till == NULL && et.endtime < b->till){ + et.renew_till == NULL && et.endtime < *b->till){ et.flags.renewable = 1; ALLOC(et.renew_till); - *et.renew_till = b->till; + *et.renew_till = *b->till; } if(et.renew_till){ time_t renew; diff --git a/lib/krb5/get_cred.c b/lib/krb5/get_cred.c index 5ab89873c..902980cbf 100644 --- a/lib/krb5/get_cred.c +++ b/lib/krb5/get_cred.c @@ -99,7 +99,10 @@ init_tgs_req (krb5_context context, if (ret) goto fail; - t->req_body.till = in_creds->times.endtime; + if(in_creds->times.endtime){ + ALLOC(t->req_body.till, 1); + *t->req_body.till = in_creds->times.endtime; + } t->req_body.nonce = nonce; if(second_ticket){ diff --git a/lib/krb5/get_in_tkt.c b/lib/krb5/get_in_tkt.c index 5a530951c..78ba7fe1e 100644 --- a/lib/krb5/get_in_tkt.c +++ b/lib/krb5/get_in_tkt.c @@ -368,7 +368,10 @@ init_as_req (krb5_context context, } *a->req_body.from = creds->times.starttime; } - a->req_body.till = creds->times.endtime; + if(creds->times.endtime){ + ALLOC(a->req_body.till, 1); + *a->req_body.till = creds->times.endtime; + } if(creds->times.renew_till){ a->req_body.rtime = malloc(sizeof(*a->req_body.rtime)); if (a->req_body.rtime == NULL) {