From 105186eeeeb6aa85d5ff5818e8abf65e3912cb7d Mon Sep 17 00:00:00 2001 From: csgr Date: Fri, 30 Sep 1994 14:50:09 +0000 Subject: Initial import of eBones. (Including all changes for FreeBSD - importing the original eBones distribution would be too complex at this stage, since I don't have access to Piero's CVS.) (If you want to include eBones in your system, don't forget to include MAKE_EBONES in /etc/make.conf.) (This stuff is now also suppable from braae.ru.ac.za.) Bones originally from MIT SIPB. Original port to FreeBSD 1.x by Piero Serini. Moved to FreeBSD 2.0 by Doug Rabson and Geoff Rehmet. Nice bug fixes from Doug Rabson. --- eBones/lib/libkrb/pkt_clen.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 eBones/lib/libkrb/pkt_clen.c (limited to 'eBones/lib/libkrb/pkt_clen.c') diff --git a/eBones/lib/libkrb/pkt_clen.c b/eBones/lib/libkrb/pkt_clen.c new file mode 100644 index 0000000..23ad4c3 --- /dev/null +++ b/eBones/lib/libkrb/pkt_clen.c @@ -0,0 +1,53 @@ +/* + * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute + * of Technology. + * For copying and distribution information, please see the file + * . + * + * from: pkt_clen.c,v 4.7 88/11/15 16:56:36 jtkohl Exp $ + * $Id: pkt_clen.c,v 1.2 1994/07/19 19:26:09 g89r4222 Exp $ + */ + +#ifndef lint +static char *rcsid = +"$Id: pkt_clen.c,v 1.2 1994/07/19 19:26:09 g89r4222 Exp $"; +#endif /* lint */ + +#include +#include + +extern int krb_debug; +extern int swap_bytes; + +/* + * Given a pointer to an AUTH_MSG_KDC_REPLY packet, return the length of + * its ciphertext portion. The external variable "swap_bytes" is assumed + * to have been set to indicate whether or not the packet is in local + * byte order. pkt_clen() takes this into account when reading the + * ciphertext length out of the packet. + */ + +pkt_clen(pkt) + KTEXT pkt; +{ + static unsigned short temp,temp2; + int clen = 0; + + /* Start of ticket list */ + unsigned char *ptr = pkt_a_realm(pkt) + 10 + + strlen((char *)pkt_a_realm(pkt)); + + /* Finally the length */ + bcopy((char *)(++ptr),(char *)&temp,2); /* alignment */ + if (swap_bytes) { + /* assume a short is 2 bytes?? */ + swab((char *)&temp,(char *)&temp2,2); + temp = temp2; + } + + clen = (int) temp; + + if (krb_debug) + printf("Clen is %d\n",clen); + return(clen); +} -- cgit v1.1