summaryrefslogtreecommitdiffstats
path: root/crypto/kerberosIV/lib/krb/create_ticket.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1999-09-19 14:19:32 +0000
committermarkm <markm@FreeBSD.org>1999-09-19 14:19:32 +0000
commitc171f3b18205ec5324a32cba54aff58ae5594701 (patch)
tree66b3054dafd0977d967bd8aba7ce4e8bcc8d605f /crypto/kerberosIV/lib/krb/create_ticket.c
parent4f947d680afa74c70cf3f206d4f05dcc3555aa90 (diff)
parentfe83e8abf357ee11114856a5278bb38431a9517c (diff)
downloadFreeBSD-src-c171f3b18205ec5324a32cba54aff58ae5594701.zip
FreeBSD-src-c171f3b18205ec5324a32cba54aff58ae5594701.tar.gz
This commit was generated by cvs2svn to compensate for changes in r51415,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/kerberosIV/lib/krb/create_ticket.c')
-rw-r--r--crypto/kerberosIV/lib/krb/create_ticket.c45
1 files changed, 38 insertions, 7 deletions
diff --git a/crypto/kerberosIV/lib/krb/create_ticket.c b/crypto/kerberosIV/lib/krb/create_ticket.c
index b469232..822cfbb 100644
--- a/crypto/kerberosIV/lib/krb/create_ticket.c
+++ b/crypto/kerberosIV/lib/krb/create_ticket.c
@@ -38,7 +38,7 @@
#include "krb_locl.h"
-RCSID("$Id: create_ticket.c,v 1.12 1997/04/01 08:18:21 joda Exp $");
+RCSID("$Id: create_ticket.c,v 1.13 1998/06/09 19:25:17 joda Exp $");
/*
* Create ticket takes as arguments information that should be in a
@@ -103,21 +103,52 @@ krb_create_ticket(KTEXT tkt, /* Gets filled in by the ticket */
des_cblock *key) /* Service's secret key */
{
unsigned char *p = tkt->dat;
+ int tmp;
+ size_t rem = sizeof(tkt->dat);
memset(tkt, 0, sizeof(KTEXT_ST));
- p += krb_put_int(flags, p, 1);
- p += krb_put_nir(pname, pinstance, prealm, p);
+ tmp = krb_put_int(flags, p, rem, 1);
+ if (tmp < 0)
+ return KFAILURE;
+ p += tmp;
+ rem -= tmp;
+
+ tmp = krb_put_nir(pname, pinstance, prealm, p, rem);
+ if (tmp < 0)
+ return KFAILURE;
+ p += tmp;
+ rem -= tmp;
- p += krb_put_address(paddress, p);
+ tmp = krb_put_address(paddress, p, rem);
+ if (tmp < 0)
+ return KFAILURE;
+ p += tmp;
+ rem -= tmp;
+ if (rem < 8)
+ return KFAILURE;
memcpy(p, session, 8);
p += 8;
+ rem -= 8;
+
+ tmp = krb_put_int(life, p, rem, 1);
+ if (tmp < 0)
+ return KFAILURE;
+ p += tmp;
+ rem -= tmp;
- p += krb_put_int(life, p, 1);
- p += krb_put_int(time_sec, p, 4);
+ tmp = krb_put_int(time_sec, p, rem, 4);
+ if (tmp < 0)
+ return KFAILURE;
+ p += tmp;
+ rem -= tmp;
- p += krb_put_nir(sname, sinstance, NULL, p);
+ tmp = krb_put_nir(sname, sinstance, NULL, p, rem);
+ if (tmp < 0)
+ return KFAILURE;
+ p += tmp;
+ rem -= tmp;
/* multiple of eight bytes */
tkt->length = (p - tkt->dat + 7) & ~7;
OpenPOWER on IntegriCloud