freebsd-dev/eBones/krb/get_request.c
markm cf635440ff Start the eBones cleanup ball rolling.
These are the start of a lot of work to clean up the FreeBSD eBones code.
these changes include, but are not limited to:
- Create prototypes for all the library routines
- Make all the libraries compile clean with -Wall set
- Fix numerous small bugs shown up in the above process
- Prepare the code for libdes's removal to secure/
- add register, registerd and make_keypair to the make
Lots more will follow in days to come.

OK'ed by: rgrimes
1995-08-25 22:52:32 +00:00

51 lines
1.3 KiB
C

/*
* Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
* of Technology.
* For copying and distribution information, please see the file
* <Copyright.MIT>.
*
* from: get_request.c,v 4.7 88/12/01 14:00:11 jtkohl Exp $
* $Id: get_request.c,v 1.3 1995/07/18 16:38:39 mark Exp $
*/
#if 0
#ifndef lint
static char *rcsid =
"$Id: get_request.c,v 1.3 1995/07/18 16:38:39 mark Exp $";
#endif /* lint */
#endif
#include <krb.h>
#include <prot.h>
/*
* This procedure is obsolete. It is used in the kerberos_slave
* code for Version 3 tickets.
*
* This procedure sets s_name, and instance to point to
* the corresponding fields from tne nth request in the packet.
* it returns the lifetime requested. Garbage will be returned
* if there are less than n requests in the packet.
*/
int get_request(KTEXT pkt, int n, char **s_name, char **instance)
{
/* Go to the beginning of the request list */
char *ptr = (char *) pkt_a_realm(pkt) + 6 +
strlen((char *)pkt_a_realm(pkt));
/* Read requests until we hit the right one */
while (n-- > 1) {
ptr++;
ptr += 1 + strlen(ptr);
ptr += 1 + strlen(ptr);
}
/* Set the arguments to point to the right place */
*s_name = 1 + ptr;
*instance = 2 + ptr + strlen(*s_name);
/* Return the requested lifetime */
return((int) *ptr);
}