diff options
Diffstat (limited to 'eBones/krb')
62 files changed, 596 insertions, 792 deletions
diff --git a/eBones/krb/Makefile b/eBones/krb/Makefile index 205b024..10ef4ba 100644 --- a/eBones/krb/Makefile +++ b/eBones/krb/Makefile @@ -1,10 +1,10 @@ # From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.4 1995/01/20 01:12:19 wollman Exp $ +# $Id: Makefile,v 1.5 1995/07/18 16:38:02 mark Exp $ LIB= krb SHLIB_MAJOR= 2 SHLIB_MINOR= 0 -CFLAGS+=-DKERBEROS -DCRYPT -DDEBUG -I${.CURDIR}/../include -DBSD42 +CFLAGS+=-DKERBEROS -DCRYPT -DDEBUG -I${.CURDIR}/../include -DBSD42 -Wall SRCS= krb_err.c create_auth_reply.c create_ciph.c \ create_death_packet.c create_ticket.c debug_decl.c decomp_ticket.c \ des_rw.c dest_tkt.c extract_ticket.c fgetst.c get_ad_tkt.c \ diff --git a/eBones/krb/add_ticket.c b/eBones/krb/add_ticket.c index cb79a18..bec7cd8 100644 --- a/eBones/krb/add_ticket.c +++ b/eBones/krb/add_ticket.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: add_ticket.c,v 4.7 88/10/07 06:06:26 shanzer Exp $ - * $Id: add_ticket.c,v 1.2 1994/07/19 19:24:54 g89r4222 Exp $ + * $Id: add_ticket.c,v 1.3 1995/07/18 16:38:04 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: add_ticket.c,v 1.2 1994/07/19 19:24:54 g89r4222 Exp $"; +"$Id: add_ticket.c,v 1.3 1995/07/18 16:38:04 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> diff --git a/eBones/krb/create_auth_reply.c b/eBones/krb/create_auth_reply.c index bfc3cfe..ea3afd6 100644 --- a/eBones/krb/create_auth_reply.c +++ b/eBones/krb/create_auth_reply.c @@ -5,14 +5,17 @@ * <Copyright.MIT>. * * from: create_auth_reply.c,v 4.10 89/01/13 17:47:38 steiner Exp $ - * $Id: create_auth_reply.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_auth_reply.c,v 1.3 1995/07/18 16:38:06 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_auth_reply.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_auth_reply.c,v 1.3 1995/07/18 16:38:06 mark Exp $"; #endif /* lint */ +#endif +#include <stdio.h> #include <krb.h> #include <prot.h> #include <strings.h> diff --git a/eBones/krb/create_ciph.c b/eBones/krb/create_ciph.c index 634d371..a383604 100644 --- a/eBones/krb/create_ciph.c +++ b/eBones/krb/create_ciph.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: create_ciph.c,v 4.8 89/05/18 21:24:26 jis Exp $ - * $Id: create_ciph.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_ciph.c,v 1.3 1995/07/18 16:38:07 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_ciph.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_ciph.c,v 1.3 1995/07/18 16:38:07 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <des.h> @@ -54,18 +56,9 @@ static char *rcsid = * */ -create_ciph(c, session, service, instance, realm, life, kvno, tkt, - kdc_time, key) - KTEXT c; /* Text block to hold ciphertext */ - C_Block session; /* Session key to send to user */ - char *service; /* Service name on ticket */ - char *instance; /* Instance name on ticket */ - char *realm; /* Realm of this KDC */ - unsigned long life; /* Lifetime of the ticket */ - int kvno; /* Key version number for service */ - KTEXT tkt; /* The ticket for the service */ - unsigned long kdc_time; /* KDC time */ - C_Block key; /* Key to encrypt ciphertext with */ +int create_ciph(KTEXT c, des_cblock session, char *service, char *instance, + char *realm, unsigned long life, int kvno, KTEXT tkt, + unsigned long kdc_time, des_cblock key) { char *ptr; Key_schedule key_s; @@ -100,9 +93,9 @@ create_ciph(c, session, service, instance, realm, life, kvno, tkt, c->length = (((ptr - (char *) c->dat) + 7) / 8) * 8; #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)c->dat,(C_Block *)c->dat,(long) c->length,key_s, - key,ENCRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)c->dat,(des_cblock *)c->dat,(long) c->length, + key_s,(des_cblock *)key,ENCRYPT); #endif /* NOENCRYPTION */ return(KSUCCESS); diff --git a/eBones/krb/create_death_packet.c b/eBones/krb/create_death_packet.c index 080e8a8..bdc0e34 100644 --- a/eBones/krb/create_death_packet.c +++ b/eBones/krb/create_death_packet.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: create_death_packet.c,v 4.9 89/01/17 16:05:59 rfrench Exp $ - * $Id: create_death_packet.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_death_packet.c,v 1.3 1995/07/18 16:38:09 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: create_death_packet.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_death_packet.c,v 1.3 1995/07/18 16:38:09 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> diff --git a/eBones/krb/create_ticket.c b/eBones/krb/create_ticket.c index 95d5ced..264d1ac 100644 --- a/eBones/krb/create_ticket.c +++ b/eBones/krb/create_ticket.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: create_ticket.c,v 4.11 89/03/22 14:43:23 jtkohl Exp $ - * $Id: create_ticket.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: create_ticket.c,v 1.3 1995/07/18 16:38:12 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: create_ticket.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: create_ticket.c,v 1.3 1995/07/18 16:38:12 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> #include <des.h> @@ -68,20 +70,9 @@ static char rcsid[] = * */ -int krb_create_ticket(tkt, flags, pname, pinstance, prealm, paddress, - session, life, time_sec, sname, sinstance, key) - KTEXT tkt; /* Gets filled in by the ticket */ - unsigned char flags; /* Various Kerberos flags */ - char *pname; /* Principal's name */ - char *pinstance; /* Principal's instance */ - char *prealm; /* Principal's authentication domain */ - long paddress; /* Net address of requesting entity */ - char *session; /* Session key inserted in ticket */ - short life; /* Lifetime of the ticket */ - long time_sec; /* Issue time and date */ - char *sname; /* Service Name */ - char *sinstance; /* Instance Name */ - C_Block key; /* Service's secret key */ +int krb_create_ticket(KTEXT tkt, unsigned char flags, char *pname, + char *pinstance, char *prealm, long paddress, char *session, short life, + long time_sec, char *sname, char *sinstance, des_cblock key) { Key_schedule key_s; register char *data; /* running index into ticket */ @@ -122,9 +113,9 @@ int krb_create_ticket(tkt, flags, pname, pinstance, prealm, paddress, } #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)tkt->dat,(C_Block *)tkt->dat,(long)tkt->length, - key_s,key,ENCRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)tkt->dat,(des_cblock *)tkt->dat, + (long)tkt->length,key_s,(des_cblock *)key,ENCRYPT); #endif return 0; } diff --git a/eBones/krb/debug_decl.c b/eBones/krb/debug_decl.c index 1a0f6df..f548e2a 100644 --- a/eBones/krb/debug_decl.c +++ b/eBones/krb/debug_decl.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: debug_decl.c,v 4.5 88/10/07 06:07:49 shanzer Exp $ - * $Id: debug_decl.c,v 1.2 1994/07/19 19:25:03 g89r4222 Exp $ + * $Id: debug_decl.c,v 1.3 1995/07/18 16:38:14 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: debug_decl.c,v 1.2 1994/07/19 19:25:03 g89r4222 Exp $"; +"$Id: debug_decl.c,v 1.3 1995/07/18 16:38:14 mark Exp $"; #endif lint +#endif /* Declare global debugging variables. */ diff --git a/eBones/krb/decomp_ticket.c b/eBones/krb/decomp_ticket.c index 181864c..ab46450 100644 --- a/eBones/krb/decomp_ticket.c +++ b/eBones/krb/decomp_ticket.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: decomp_ticket.c,v 4.12 89/05/16 18:44:46 jtkohl Exp $ - * $Id: decomp_ticket.c,v 1.2 1994/07/19 19:25:05 g89r4222 Exp $ + * $Id: decomp_ticket.c,v 1.3 1995/07/18 16:38:15 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: decomp_ticket.c,v 1.2 1994/07/19 19:25:05 g89r4222 Exp $"; +"$Id: decomp_ticket.c,v 1.3 1995/07/18 16:38:15 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> #include <des.h> @@ -44,31 +46,18 @@ static char *rcsid = * See create_ticket.c for the format of the ticket packet. */ -decomp_ticket(tkt, flags, pname, pinstance, prealm, paddress, session, - life, time_sec, sname, sinstance, key, key_s) - KTEXT tkt; /* The ticket to be decoded */ - unsigned char *flags; /* Kerberos ticket flags */ - char *pname; /* Authentication name */ - char *pinstance; /* Principal's instance */ - char *prealm; /* Principal's authentication domain */ - unsigned long *paddress; /* Net address of entity - * requesting ticket */ - C_Block session; /* Session key inserted in ticket */ - int *life; /* Lifetime of the ticket */ - unsigned long *time_sec; /* Issue time and date */ - char *sname; /* Service name */ - char *sinstance; /* Service instance */ - C_Block key; /* Service's secret key - * (to decrypt the ticket) */ - Key_schedule key_s; /* The precomputed key schedule */ +int decomp_ticket(KTEXT tkt, unsigned char *flags, char *pname, + char *pinstance, char *prealm, unsigned long *paddress, des_cblock session, + int *life, unsigned long *time_sec, char *sname, char *sinstance, + des_cblock key, des_key_schedule key_s) { static int tkt_swap_bytes; unsigned char *uptr; char *ptr = (char *)tkt->dat; #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)tkt->dat,(C_Block *)tkt->dat,(long)tkt->length, - key_s,key,DECRYPT); + pcbc_encrypt((des_cblock *)tkt->dat,(des_cblock *)tkt->dat, + (long)tkt->length,key_s,(des_cblock *)key,DECRYPT); #endif /* ! NOENCRYPTION */ *flags = *ptr; /* get flags byte */ diff --git a/eBones/krb/des_rw.c b/eBones/krb/des_rw.c index e5acb39..774e62b 100644 --- a/eBones/krb/des_rw.c +++ b/eBones/krb/des_rw.c @@ -35,7 +35,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: des_rw.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: des_rw.c,v 1.6 1995/07/18 16:38:17 mark Exp $ */ /* @@ -100,18 +100,11 @@ #include <sys/param.h> #include <sys/types.h> -#include <kerberosIV/des.h> -#include <kerberosIV/krb.h> - -extern int krb_net_read(int fd, void * data, size_t length); -extern int des_pcbc_encrypt(des_cblock *input, des_cblock *output, - register long length, - des_key_schedule schedule, - des_cblock *ivec, - int encrypt); +#include <krb.h> +#include <des.h> static bit_64 des_key; -static des_key_schedule key_sched; +static des_key_schedule key_schedule; /* * Buffer for storing extra data when more data is received, then was @@ -127,12 +120,10 @@ static u_char *buff_ptr = buffer; * inkey is the initial vector for the DES encryption, while insched is * the DES key, in unwrapped form. */ -void des_set_key(inkey, insched) - bit_64 *inkey; - u_char *insched; +void des_set_key(bit_64 *inkey, u_char *insched) { bcopy(inkey, &des_key, sizeof(bit_64)); - bcopy(insched, &key_sched, sizeof(des_key_schedule)); + bcopy(insched, &key_schedule, sizeof(des_key_schedule)); } /* @@ -142,13 +133,10 @@ void des_set_key(inkey, insched) void des_clear_key() { bzero(&des_key, sizeof(des_cblock)); - bzero(&key_sched, sizeof(des_key_schedule)); + bzero(&key_schedule, sizeof(des_key_schedule)); } -int des_read(fd, buf, len) - int fd; - register char * buf; - int len; +int des_read(int fd, char *buf, int len) { int msg_length; /* length of actual message data */ int pad_length; /* length of padded message */ @@ -173,7 +161,7 @@ int des_read(fd, buf, len) } } - nread = krb_net_read(fd, &msg_length, sizeof(msg_length)); + nread = krb_net_read(fd,(char *)&msg_length, sizeof(msg_length)); if(nread != (int)(sizeof(msg_length))) return(0); @@ -186,7 +174,7 @@ int des_read(fd, buf, len) des_pcbc_encrypt((des_cblock*) des_buff, (des_cblock*) buff_ptr, (msg_length < 8 ? 8 : msg_length), - key_sched, (des_cblock*) &des_key, DES_DECRYPT); + key_schedule, (des_cblock*) &des_key, DES_DECRYPT); if(msg_length < 8) @@ -212,17 +200,13 @@ int des_read(fd, buf, len) * Write a message onto a file descriptor (generally a socket), using * DES to encrypt the message. */ -int des_write(fd, buf, len) - int fd; - char * buf; - int len; +int des_write(int fd, char *buf, int len) { static int seeded = 0; char garbage[8]; long rnd; int pad_len; int write_len; - int nwritten = 0; int i; char *data; @@ -249,7 +233,7 @@ int des_write(fd, buf, len) } des_pcbc_encrypt((des_cblock*) data, (des_cblock*) des_buff, - (len < 8)?8:len, key_sched, (des_cblock*) &des_key, DES_ENCRYPT); + (len < 8)?8:len, key_schedule, (des_cblock*) &des_key, DES_ENCRYPT); write_len = htonl(len); diff --git a/eBones/krb/dest_tkt.c b/eBones/krb/dest_tkt.c index 6a06454..6e6082e 100644 --- a/eBones/krb/dest_tkt.c +++ b/eBones/krb/dest_tkt.c @@ -5,15 +5,20 @@ * <Copyright.MIT>. * * from: dest_tkt.c,v 4.9 89/10/02 16:23:07 jtkohl Exp $ - * $Id: dest_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: dest_tkt.c,v 1.3 1995/07/18 16:38:19 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: dest_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: dest_tkt.c,v 1.3 1995/07/18 16:38:19 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include <krb.h> #include <sys/file.h> #include <sys/types.h> @@ -32,7 +37,7 @@ static char *rcsid = * The ticket file (TKT_FILE) is defined in "krb.h". */ -dest_tkt() +int dest_tkt() { char *file = TKT_FILE; int i,fd; diff --git a/eBones/krb/extract_ticket.c b/eBones/krb/extract_ticket.c index 571d5da..97e8432 100644 --- a/eBones/krb/extract_ticket.c +++ b/eBones/krb/extract_ticket.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: extract_ticket.c,v 4.6 88/10/07 06:08:15 shanzer Exp $ - * $Id: extract_ticket.c,v 1.2 1994/07/19 19:25:08 g89r4222 Exp $ + * $Id: extract_ticket.c,v 1.3 1995/07/18 16:38:21 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: extract_ticket.c,v 1.2 1994/07/19 19:25:08 g89r4222 Exp $"; +"$Id: extract_ticket.c,v 1.3 1995/07/18 16:38:21 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> @@ -25,14 +27,8 @@ static char *rcsid = * session, liftime and kvno. */ -extract_ticket(cipher,n,session,lifetime,kvno,realm,ticket) - KTEXT cipher; /* The ciphertext */ - int n; /* Which ticket */ - char *session; /* The session key for this tkt */ - int *lifetime; /* The life of this ticket */ - int *kvno; /* The kvno for the service */ - char *realm; /* Realm in which tkt issued */ - KTEXT ticket; /* The ticket itself */ +void extract_ticket(KTEXT cipher, int n, char *session, int *lifetime, + int *kvno, char *realm, KTEXT ticket) { char *ptr; int i; diff --git a/eBones/krb/fgetst.c b/eBones/krb/fgetst.c index b855541..4c6a364 100644 --- a/eBones/krb/fgetst.c +++ b/eBones/krb/fgetst.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: fgetst.c,v 4.0 89/01/23 10:08:31 jtkohl Exp $ - * $Id: fgetst.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: fgetst.c,v 1.3 1995/07/18 16:38:23 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: fgetst.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: fgetst.c,v 1.3 1995/07/18 16:38:23 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> @@ -23,10 +25,7 @@ static char rcsid[] = * returns the number of characters read, including the null terminator. */ -fgetst(f, s, n) - FILE *f; - register char *s; - int n; +int fgetst(FILE *f, char *s, int n) { register count = n; int ch; /* NOT char; otherwise you don't see EOF */ diff --git a/eBones/krb/get_ad_tkt.c b/eBones/krb/get_ad_tkt.c index 1c14d3c..ad76a4f 100644 --- a/eBones/krb/get_ad_tkt.c +++ b/eBones/krb/get_ad_tkt.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: get_ad_tkt.c,v 4.15 89/07/07 15:18:51 jtkohl Exp $ - * $Id: get_ad_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $ + * $Id: get_ad_tkt.c,v 1.3 1995/07/18 16:38:25 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_ad_tkt.c,v 1.1.1.1 1994/09/30 14:49:59 csgr Exp $"; +"$Id: get_ad_tkt.c,v 1.3 1995/07/18 16:38:25 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <des.h> @@ -25,8 +27,6 @@ static char rcsid[] = #include <sys/time.h> #include <sys/types.h> -extern int krb_debug; - struct timeval tt_local = { 0, 0 }; int swap_bytes; @@ -65,11 +65,7 @@ unsigned long rep_err_code; * extraction macros like pkt_version(), pkt_msg_type(), etc. */ -get_ad_tkt(service,sinstance,realm,lifetime) - char *service; - char *sinstance; - char *realm; - int lifetime; +int get_ad_tkt(char *service, char *sinstance, char *realm, int lifetime) { static KTEXT_ST pkt_st; KTEXT pkt = & pkt_st; /* Packet to KDC */ @@ -150,7 +146,7 @@ get_ad_tkt(service,sinstance,realm,lifetime) rpkt->length = 0; /* Send the request to the local ticket-granting server */ - if (kerror = send_to_kdc(pkt, rpkt, realm)) return(kerror); + if ((kerror = send_to_kdc(pkt, rpkt, realm))) return(kerror); /* check packet version of the returned packet */ if (pkt_version(rpkt) != KRB_PROT_VERSION ) @@ -181,9 +177,9 @@ get_ad_tkt(service,sinstance,realm,lifetime) bcopy((char *) pkt_cipher(rpkt),(char *) (cip->dat),cip->length); #ifndef NOENCRYPTION - key_sched(cr.session,key_s); - pcbc_encrypt((C_Block *)cip->dat,(C_Block *)cip->dat,(long)cip->length, - key_s,cr.session,DECRYPT); + key_sched((des_cblock *)cr.session,key_s); + pcbc_encrypt((des_cblock *)cip->dat,(des_cblock *)cip->dat, + (long)cip->length,key_s,(des_cblock *)cr.session,DECRYPT); #endif /* Get rid of all traces of key */ bzero((char *) cr.session, sizeof(key)); @@ -226,8 +222,8 @@ get_ad_tkt(service,sinstance,realm,lifetime) code */ } - if (kerror = save_credentials(s_name,s_instance,rlm,ses,lifetime, - kvno,tkt,tt_local.tv_sec)) + if ((kerror = save_credentials(s_name,s_instance,rlm,ses,lifetime, + kvno,tkt,tt_local.tv_sec))) return(kerror); return(AD_OK); diff --git a/eBones/krb/get_admhst.c b/eBones/krb/get_admhst.c index c36e997..b33b828 100644 --- a/eBones/krb/get_admhst.c +++ b/eBones/krb/get_admhst.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: get_admhst.c,v 4.0 89/01/23 10:08:55 jtkohl Exp $ - * $Id: get_admhst.c,v 1.2 1994/07/19 19:25:13 g89r4222 Exp $ + * $Id: get_admhst.c,v 1.3 1995/07/18 16:38:27 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_admhst.c,v 1.2 1994/07/19 19:25:13 g89r4222 Exp $"; +"$Id: get_admhst.c,v 1.3 1995/07/18 16:38:27 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> #include <krb.h> @@ -37,10 +39,7 @@ static char *rcsid = * provided by a nameserver. */ -krb_get_admhst(h, r, n) - char *h; - char *r; - int n; +int krb_get_admhst(char *h, char *r, int n) { FILE *cnffile; char tr[REALM_SZ]; diff --git a/eBones/krb/get_cred.c b/eBones/krb/get_cred.c index 6eb63f6..14e1cc1 100644 --- a/eBones/krb/get_cred.c +++ b/eBones/krb/get_cred.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: get_cred.c,v 4.10 89/05/31 17:46:22 jtkohl Exp $ - * $Id: get_cred.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_cred.c,v 1.3 1995/07/18 16:38:28 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_cred.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_cred.c,v 1.3 1995/07/18 16:38:28 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> #include <krb.h> @@ -25,11 +27,7 @@ static char *rcsid = * On failure it returns a Kerberos error code. */ -krb_get_cred(service,instance,realm,c) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - CREDENTIALS *c; /* Credentials struct */ +int krb_get_cred(char *service, char *instance, char *realm, CREDENTIALS *c) { int tf_status; /* return value of tf function calls */ diff --git a/eBones/krb/get_in_tkt.c b/eBones/krb/get_in_tkt.c index 00fc57a..79758f6 100644 --- a/eBones/krb/get_in_tkt.c +++ b/eBones/krb/get_in_tkt.c @@ -4,20 +4,22 @@ * <Copyright.MIT>. * * from: get_in_tkt.c,v 4.12 89/07/18 16:32:56 jtkohl Exp $ - * $Id: get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> +#include <des.h> +#include "conf.h" -#ifndef NULL -#define NULL 0 -#endif +#include <stdio.h> /* * This file contains two routines: passwd_to_key() converts @@ -42,18 +44,17 @@ static char rcsid[] = */ /*ARGSUSED */ -static int passwd_to_key(user,instance,realm,passwd,key) - char *user, *instance, *realm, *passwd; - C_Block key; +static int passwd_to_key(char *user, char *instance, char *realm, + char *passwd, des_cblock key) { #ifdef NOENCRYPTION if (!passwd) placebo_read_password(key, "Password: ", 0); #else if (passwd) - string_to_key(passwd,key); + string_to_key(passwd,(des_cblock *)key); else - des_read_password(key,"Password: ",0); + des_read_password((des_cblock *)key,"Password: ",0); #endif return (0); } @@ -75,10 +76,8 @@ static int passwd_to_key(user,instance,realm,passwd,key) * The result of the call to krb_get_in_tkt() is returned. */ -krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) - char *user, *instance, *realm, *service, *sinstance; - int life; - char *password; +int krb_get_pw_in_tkt(char *user, char *instance, char *realm, char *service, + char *sinstance, int life, char *password) { return(krb_get_in_tkt(user,instance,realm,service,sinstance,life, passwd_to_key, NULL, password)); @@ -86,8 +85,8 @@ krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) #ifdef NOENCRYPTION /* - * $Source: /home/ncvs/src/eBones/krb/get_in_tkt.c,v $ - * $Author: csgr $ + * $Source: /usr/cvs/src/eBones/krb/get_in_tkt.c,v $ + * $Author: mark $ * * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute * of Technology. @@ -100,41 +99,16 @@ krb_get_pw_in_tkt(user,instance,realm,service,sinstance,life,password) * echoing. */ +#if 0 #ifndef lint static char rcsid_read_password_c[] = -"Bones$Header: /home/ncvs/src/eBones/krb/get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"Bones$Header: /usr/cvs/src/eBones/krb/get_in_tkt.c,v 1.3 1995/07/18 16:38:30 mark Exp $"; #endif lint - -#include <des.h> -#include "conf.h" - -#include <stdio.h> -#ifdef BSDUNIX -#include <strings.h> -#include <sys/ioctl.h> -#include <signal.h> -#include <setjmp.h> -#else -char *strcpy(); -int strcmp(); #endif -#ifdef BSDUNIX -static jmp_buf env; -#endif - -#ifdef BSDUNIX -static void sig_restore(); -static push_signals(), pop_signals(); -int placebo_read_pw_string(); -#endif /*** Routines ****************************************************** */ -int -placebo_read_password(k,prompt,verify) - des_cblock *k; - char *prompt; - int verify; +int placebo_read_password(des_cblock *k, char *prompt, int verify) { int ok; char key_string[BUFSIZ]; @@ -161,8 +135,7 @@ lose: * Returns 0 on success, non-zero on failure. */ -int -placebo_read_pw_string(s,max,prompt,verify) +int placebo_read_pw_string(char *s, int max, char *prompt, int verify) char *s; int max; char *prompt; @@ -264,23 +237,21 @@ static void (*old_sigfunc[NSIG])(); static int (*old_sigfunc[NSIG])(); #endif POSIX -static push_signals() +static void push_signals() { register i; for (i = 0; i < NSIG; i++) old_sigfunc[i] = signal(i,sig_restore); } -static pop_signals() +static void pop_signals() { register i; for (i = 0; i < NSIG; i++) signal(i,old_sigfunc[i]); } -static void sig_restore(sig,code,scp) - int sig,code; - struct sigcontext *scp; +static void sig_restore(int sig, int code, struct sigcontext *scp) { longjmp(env,1); } diff --git a/eBones/krb/get_krbhst.c b/eBones/krb/get_krbhst.c index bb1ea50..ab3abbd 100644 --- a/eBones/krb/get_krbhst.c +++ b/eBones/krb/get_krbhst.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: get_krbhst.c,v 4.8 89/01/22 20:00:29 rfrench Exp $ - * $Id: get_krbhst.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_krbhst.c,v 1.3 1995/07/18 16:38:32 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_krbhst.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_krbhst.c,v 1.3 1995/07/18 16:38:32 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> #include <krb.h> @@ -48,10 +50,7 @@ static char *rcsid = * nameserver. */ -krb_get_krbhst(h,r,n) - char *h; - char *r; - int n; +int krb_get_krbhst(char *h, char *r, int n) { FILE *cnffile; char tr[REALM_SZ]; diff --git a/eBones/krb/get_krbrlm.c b/eBones/krb/get_krbrlm.c index 7df073d..150a916 100644 --- a/eBones/krb/get_krbrlm.c +++ b/eBones/krb/get_krbrlm.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: get_krbrlm.c,v 4.8 89/01/22 20:02:54 rfrench Exp $ - * $Id: get_krbrlm.c,v 1.2 1994/07/19 19:25:19 g89r4222 Exp $ + * $Id: get_krbrlm.c,v 1.3 1995/07/18 16:38:34 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_krbrlm.c,v 1.2 1994/07/19 19:25:19 g89r4222 Exp $"; +"$Id: get_krbrlm.c,v 1.3 1995/07/18 16:38:34 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> #include <krb.h> @@ -32,11 +34,9 @@ static char *rcsid = * krb_get_krbhst(). */ -krb_get_lrealm(r,n) - char *r; - int n; +int krb_get_lrealm(char *r, int n) { - FILE *cnffile, *fopen(); + FILE *cnffile; if (n > 1) return(KFAILURE); /* Temporary restriction */ diff --git a/eBones/krb/get_phost.c b/eBones/krb/get_phost.c index 9b12d10..4b0f495 100644 --- a/eBones/krb/get_phost.c +++ b/eBones/krb/get_phost.c @@ -4,19 +4,21 @@ * <Copyright.MIT>. * * from: get_phost.c,v 4.6 89/01/23 09:25:40 jtkohl Exp $ - * $Id: get_phost.c,v 1.2 1994/07/19 19:25:20 g89r4222 Exp $ + * $Id: get_phost.c,v 1.3 1995/07/18 16:38:35 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_phost.c,v 1.2 1994/07/19 19:25:20 g89r4222 Exp $"; +"$Id: get_phost.c,v 1.3 1995/07/18 16:38:35 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> +#include <string.h> #include <ctype.h> #include <netdb.h> - -char *index(); +#include <krb.h> /* * This routine takes an alias for a host name and returns the first @@ -35,8 +37,7 @@ char *index(); * to the original "alias" argument is returned. */ -char * krb_get_phost(alias) - char *alias; +char *krb_get_phost(char *alias) { struct hostent *h; char *phost = alias; diff --git a/eBones/krb/get_pw_tkt.c b/eBones/krb/get_pw_tkt.c index 48a003c..1b016a8 100644 --- a/eBones/krb/get_pw_tkt.c +++ b/eBones/krb/get_pw_tkt.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: get_pw_tkt.c,v 4.6 89/01/13 18:19:11 steiner Exp $ - * $Id: get_pw_tkt.c,v 1.2 1994/07/19 19:25:23 g89r4222 Exp $ + * $Id: get_pw_tkt.c,v 1.3 1995/07/18 16:38:37 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: get_pw_tkt.c,v 1.2 1994/07/19 19:25:23 g89r4222 Exp $"; +"$Id: get_pw_tkt.c,v 1.3 1995/07/18 16:38:37 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> @@ -46,11 +48,7 @@ static char *rcsid = * the password-changing server will be in the user's ticket file. */ -get_pw_tkt(user,instance,realm,cpw) - char *user; - char *instance; - char *realm; - char *cpw; +int get_pw_tkt(char *user, char *instance, char *realm, char *cpw) { int kerror; diff --git a/eBones/krb/get_request.c b/eBones/krb/get_request.c index 131ffd5..dec742b 100644 --- a/eBones/krb/get_request.c +++ b/eBones/krb/get_request.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: get_request.c,v 4.7 88/12/01 14:00:11 jtkohl Exp $ - * $Id: get_request.c,v 1.2 1994/07/19 19:25:24 g89r4222 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.2 1994/07/19 19:25:24 g89r4222 Exp $"; +"$Id: get_request.c,v 1.3 1995/07/18 16:38:39 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> @@ -26,11 +28,7 @@ static char *rcsid = * if there are less than n requests in the packet. */ -get_request(pkt, n, s_name, instance) - KTEXT pkt; /* The packet itself */ - int n; /* Which request do we want */ - char **s_name; /* Service name to be filled in */ - char **instance; /* Instance name to be filled in */ +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 + diff --git a/eBones/krb/get_svc_in_tkt.c b/eBones/krb/get_svc_in_tkt.c index 0b0fe71..cd90f9e 100644 --- a/eBones/krb/get_svc_in_tkt.c +++ b/eBones/krb/get_svc_in_tkt.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: get_svc_in_tkt.c,v 4.9 89/07/18 16:33:34 jtkohl Exp $ - * $Id: get_svc_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_svc_in_tkt.c,v 1.3 1995/07/18 16:38:41 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_svc_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_svc_in_tkt.c,v 1.3 1995/07/18 16:38:41 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> @@ -63,7 +65,7 @@ static int srvtab_to_key(user, instance, realm, srvtab, key) * It returns the return value of the krb_get_in_tkt() call. */ -krb_get_svc_in_tkt(user, instance, realm, service, sinstance, life, srvtab) +int krb_get_svc_in_tkt(user, instance, realm, service, sinstance, life, srvtab) char *user, *instance, *realm, *service, *sinstance; int life; char *srvtab; diff --git a/eBones/krb/get_tf_fullname.c b/eBones/krb/get_tf_fullname.c index 540e828..45226db 100644 --- a/eBones/krb/get_tf_fullname.c +++ b/eBones/krb/get_tf_fullname.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: get_tf_fullname.c,v 4.3 90/03/10 22:40:20 jon Exp $ - * $Id: get_tf_fullname.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_tf_fullname.c,v 1.3 1995/07/18 16:38:42 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_tf_fullname.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_tf_fullname.c,v 1.3 1995/07/18 16:38:42 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <strings.h> @@ -30,11 +32,8 @@ static char rcsid[] = * krb_get_in_tkt(). */ -krb_get_tf_fullname(ticket_file, name, instance, realm) - char *ticket_file; - char *name; - char *instance; - char *realm; +int krb_get_tf_fullname(char *ticket_file, char *name, char *instance, + char *realm) { int tf_status; CREDENTIALS c; diff --git a/eBones/krb/get_tf_realm.c b/eBones/krb/get_tf_realm.c index df2845e..704c687 100644 --- a/eBones/krb/get_tf_realm.c +++ b/eBones/krb/get_tf_realm.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: get_tf_realm.c,v 4.2 90/01/02 13:40:19 jtkohl Exp $ - * $Id: get_tf_realm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: get_tf_realm.c,v 1.3 1995/07/18 16:38:44 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: get_tf_realm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: get_tf_realm.c,v 1.3 1995/07/18 16:38:44 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <strings.h> @@ -26,9 +28,7 @@ static char rcsid[] = * */ -krb_get_tf_realm(ticket_file, realm) - char *ticket_file; - char *realm; +int krb_get_tf_realm(char *ticket_file, char *realm) { return(krb_get_tf_fullname(ticket_file, 0, 0, realm)); } diff --git a/eBones/krb/getrealm.c b/eBones/krb/getrealm.c index c850bd0..37686c4 100644 --- a/eBones/krb/getrealm.c +++ b/eBones/krb/getrealm.c @@ -6,13 +6,15 @@ * routine to convert hostname into realm name. * * from: getrealm.c,v 4.6 90/01/02 13:35:56 jtkohl Exp $ - * $Id: getrealm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $ + * $Id: getrealm.c,v 1.3 1995/07/18 16:38:46 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: getrealm.c,v 1.1.1.1 1994/09/30 14:50:00 csgr Exp $"; +"$Id: getrealm.c,v 1.3 1995/07/18 16:38:46 mark Exp $"; #endif lint +#endif #include <strings.h> #include <stdio.h> @@ -45,9 +47,7 @@ static char rcsid[] = static char ret_realm[REALM_SZ+1]; -char * -krb_realmofhost(host) -char *host; +char *krb_realmofhost(char *host) { char *domain; FILE *trans_file; diff --git a/eBones/krb/getst.c b/eBones/krb/getst.c index edd55ec..549ec50 100644 --- a/eBones/krb/getst.c +++ b/eBones/krb/getst.c @@ -4,13 +4,17 @@ * <Copyright.MIT>. * * form: getst.c,v 4.5 88/11/15 16:31:39 jtkohl Exp $ - * $Id: getst.c,v 1.2 1994/07/19 19:25:33 g89r4222 Exp $ + * $Id: getst.c,v 1.3 1995/07/18 16:38:47 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: getst.c,v 1.2 1994/07/19 19:25:33 g89r4222 Exp $"; +"$Id: getst.c,v 1.3 1995/07/18 16:38:47 mark Exp $"; #endif /* lint */ +#endif + +#include <unistd.h> /* * getst() takes a file descriptor, a string and a count. It reads @@ -22,9 +26,7 @@ static char rcsid[] = * the null terminator. */ -getst(fd, s, n) - int fd; - register char *s; +int getst(int fd, char *s, int n) { register count = n; while (read(fd, s, 1) > 0 && --count) diff --git a/eBones/krb/in_tkt.c b/eBones/krb/in_tkt.c index 5a05259..12fbb39 100644 --- a/eBones/krb/in_tkt.c +++ b/eBones/krb/in_tkt.c @@ -5,16 +5,19 @@ * <Copyright.MIT>. * * from: kt.c,v 4.9 89/10/25 19:03:35 qjb Exp $ - * $Id: in_tkt.c,v 1.1.1.1 1994/09/30 14:50:01 csgr Exp $ + * $Id: in_tkt.c,v 1.6 1995/07/18 16:38:49 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: in_tkt.c,v 1.1.1.1 1994/09/30 14:50:01 csgr Exp $"; +"$Id: in_tkt.c,v 1.6 1995/07/18 16:38:49 mark Exp $"; #endif /* lint */ +#endif #include <unistd.h> #include <stdio.h> +#include <string.h> #include <krb.h> #include <sys/file.h> #include <sys/fcntl.h> @@ -24,8 +27,6 @@ static char rcsid[] = #include <sys/param.h> #endif -extern int krb_debug; - /* * in_tkt() is used to initialize the ticket store. It creates the * file to contain the tickets and writes the given user's name "pname" @@ -33,9 +34,7 @@ extern int krb_debug; * success, or KFAILURE if something goes wrong. */ -in_tkt(pname,pinst) - char *pname; - char *pinst; +int in_tkt(char *pname, char *pinst) { int tktfile; uid_t me, metoo; @@ -91,7 +90,7 @@ in_tkt(pname,pinst) return(KFAILURE); } else if (krb_debug) - printf("swapped UID's %d and %d\n",metoo,me); + printf("swapped UID's %ld and %ld\n",metoo,me); } if ((tktfile = open(file,O_CREAT | O_TRUNC | O_WRONLY,0600)) < 0) { if (krb_debug) @@ -106,7 +105,7 @@ in_tkt(pname,pinst) return(KFAILURE); } else if (krb_debug) - printf("swapped UID's %d and %d\n",me,metoo); + printf("swapped UID's %ld and %ld\n",me,metoo); } if (lstat(file,&buf) < 0) { if (krb_debug) diff --git a/eBones/krb/k_gethostname.c b/eBones/krb/k_gethostname.c index e5c11ca..093ee5d 100644 --- a/eBones/krb/k_gethostname.c +++ b/eBones/krb/k_gethostname.c @@ -4,13 +4,17 @@ * <Copyright.MIT>. * * from: k_gethostname.c,v 4.1 88/12/01 14:04:42 jtkohl Exp $ - * $Id: k_gethostname.c,v 1.2 1994/07/19 19:25:36 g89r4222 Exp $ + * $Id: k_gethostname.c,v 1.3 1995/07/18 16:38:51 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: k_gethostname.c,v 1.2 1994/07/19 19:25:36 g89r4222 Exp $"; +"$Id: k_gethostname.c,v 1.3 1995/07/18 16:38:51 mark Exp $"; #endif /* lint */ +#endif + +#include <unistd.h> #ifndef PC #ifndef BSD42 @@ -37,8 +41,7 @@ extern get_custom(); * not work. */ -k_gethostname(name, namelen) - char *name; +int k_gethostname(char *name, int namelen) { #ifdef BSD42 return gethostname(name, namelen); diff --git a/eBones/krb/klog.c b/eBones/krb/klog.c index b530e8b..97d52c7 100644 --- a/eBones/krb/klog.c +++ b/eBones/krb/klog.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: klog.c,v 4.6 88/12/01 14:06:05 jtkohl Exp $ - * $Id: klog.c,v 1.2 1994/07/19 19:25:37 g89r4222 Exp $ + * $Id: klog.c,v 1.3 1995/07/18 16:38:52 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: klog.c,v 1.2 1994/07/19 19:25:37 g89r4222 Exp $"; +"$Id: klog.c,v 1.3 1995/07/18 16:38:52 mark Exp $"; #endif /* lint */ +#endif #include <sys/time.h> #include <stdio.h> @@ -48,14 +50,11 @@ static char logtxt[1000]; * text string "logtxt". */ -char * klog(type,format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) - int type; - char *format; - int a1,a2,a3,a4,a5,a6,a7,a8,a9,a0; +char *klog(int type, char *format, int a1, int a2, int a3, int a4, int a5, + int a6, int a7, int a8, int a9, int a0) { - FILE *logfile, *fopen(); + FILE *logfile; long time(),now; - char *month_sname(); struct tm *tm; static int logtype_array[NLOGTYPE] = {0,0}; static int array_initialized; @@ -100,8 +99,7 @@ char * klog(type,format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) * the logfile defaults to KRBLOG, defined in "krb.h". */ -kset_logfile(filename) - char *filename; +void kset_logfile(char *filename) { log_name = filename; is_open = 0; diff --git a/eBones/krb/kname_parse.c b/eBones/krb/kname_parse.c index dd5fe0b..c69b5cc 100644 --- a/eBones/krb/kname_parse.c +++ b/eBones/krb/kname_parse.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: kname_parse.c,v 4.4 88/12/01 14:07:29 jtkohl Exp $ - * $Id: kname_parse.c,v 1.2 1994/07/19 19:25:39 g89r4222 Exp $ + * $Id: kname_parse.c,v 1.3 1995/07/18 16:38:54 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kname_parse.c,v 1.2 1994/07/19 19:25:39 g89r4222 Exp $"; +"$Id: kname_parse.c,v 1.3 1995/07/18 16:38:54 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> #include <krb.h> @@ -38,7 +40,7 @@ extern char *krb_err_txt[]; * Definition of "syntactically legitimate" names is according to * the Project Athena Technical Plan Section E.2.1, page 7 "Specifying * names", version dated 21 Dec 1987. - * / + */ /* * kname_parse() takes a Kerberos name "fullname" of the form: @@ -52,8 +54,7 @@ extern char *krb_err_txt[]; * KNAME_FMT is returned. */ -kname_parse(np, ip, rp, fullname) - char *np, *ip, *rp, *fullname; +int kname_parse(char *np, char *ip, char *rp, char *fullname) { static char buf[FULL_SZ]; char *rnext, *wnext; /* next char to read, write */ @@ -70,7 +71,7 @@ kname_parse(np, ip, rp, fullname) return KNAME_FMT; (void) strcpy(buf, fullname); - while (c = *rnext++) { + while ((c = *rnext++)) { if (backslash) { *wnext++ = c; backslash = 0; @@ -136,8 +137,7 @@ kname_parse(np, ip, rp, fullname) * Kerberos name; returns 0 if it's not. */ -k_isname(s) - char *s; +int k_isname(char *s) { register char c; int backslash = 0; @@ -146,7 +146,7 @@ k_isname(s) return 0; if (strlen(s) > ANAME_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; @@ -172,15 +172,14 @@ k_isname(s) * Kerberos instance; returns 0 if it's not. */ -k_isinst(s) - char *s; +int k_isinst(char *s) { register char c; int backslash = 0; if (strlen(s) > INST_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; @@ -205,8 +204,7 @@ k_isinst(s) * Kerberos realm; returns 0 if it's not. */ -k_isrealm(s) - char *s; +int k_isrealm(char *s) { register char c; int backslash = 0; @@ -215,7 +213,7 @@ k_isrealm(s) return 0; if (strlen(s) > REALM_SZ - 1) return 0; - while(c = *s++) { + while((c = *s++)) { if (backslash) { backslash = 0; continue; diff --git a/eBones/krb/kntoln.c b/eBones/krb/kntoln.c index 62ec1b5..ddb1ba2 100644 --- a/eBones/krb/kntoln.c +++ b/eBones/krb/kntoln.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: kntoln.c,v 4.7 89/01/23 09:25:15 jtkohl Exp $ - * $Id: kntoln.c,v 1.2 1994/07/19 19:25:40 g89r4222 Exp $ + * $Id: kntoln.c,v 1.3 1995/07/18 16:38:56 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: kntoln.c,v 1.2 1994/07/19 19:25:40 g89r4222 Exp $"; +"$Id: kntoln.c,v 1.3 1995/07/18 16:38:56 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <strings.h> @@ -42,9 +44,7 @@ static char *rcsid = * KSUCCESS if all goes well, otherwise KFAILURE. */ -krb_kntoln(ad,lname) - AUTH_DAT *ad; - char *lname; +int krb_kntoln(AUTH_DAT *ad, char *lname) { static char lrealm[REALM_SZ] = ""; diff --git a/eBones/krb/kparse.c b/eBones/krb/kparse.c index d79f1cf..edb471c 100644 --- a/eBones/krb/kparse.c +++ b/eBones/krb/kparse.c @@ -30,15 +30,18 @@ * * * from: kparse.c,v 4.5 89/01/21 17:20:39 jtkohl Exp $ - * $Id: kparse.c,v 1.2 1994/07/19 19:25:42 g89r4222 Exp $ + * $Id: kparse.c,v 1.3 1995/07/18 16:38:58 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kparse.c,v 1.2 1994/07/19 19:25:42 g89r4222 Exp $"; +"$Id: kparse.c,v 1.3 1995/07/18 16:38:58 mark Exp $"; #endif lint +#endif #include <stdio.h> +#include <stdlib.h> #include <ctype.h> #include <kparse.h> @@ -47,23 +50,21 @@ static char rcsid[] = #define TRUE 1 #endif -#define void int - #define MAXKEY 80 #define MAXVALUE 80 -char *malloc(); -char *strcpy(); +int fGetKeywordValue(FILE *fp, char *keyword, int klen, char *value, int vlen); +int fGetToken(FILE *fp, char *dest, int maxlen); +int fGetChar(FILE *fp); +int fUngetChar(int ch, FILE*fp); +int fGetLiteral(FILE *fp);; int LineNbr=1; /* current line nbr in parameter file */ char ErrorMsg[80]; /* meaningful only when KV_SYNTAX, PS_SYNTAX, * or PS_BAD_KEYWORD is returned by * fGetKeywordValue or fGetParameterSet */ -int fGetParameterSet( fp,parm,parmcount ) - FILE *fp; - parmtable parm[]; - int parmcount; +int fGetParameterSet(FILE *fp, parmtable parm[], int parmcount ) { int rc,i; char keyword[MAXKEY]; @@ -126,11 +127,7 @@ int fGetParameterSet( fp,parm,parmcount ) * different. Like strcmp, ParmCompare returns 0 for a match found, -1 * otherwise */ -int ParmCompare( parm, parmcount, keyword, value ) - parmtable parm[]; - int parmcount; - char *keyword; - char *value; +int ParmCompare(parmtable parm[], int parmcount, char *keyword, char *value ) { int i; @@ -146,9 +143,7 @@ int ParmCompare( parm, parmcount, keyword, value ) return(-1); } -void FreeParameterSet(parm,parmcount) - parmtable parm[]; - int parmcount; +void FreeParameterSet(parmtable parm[], int parmcount) { int i; @@ -160,12 +155,7 @@ void FreeParameterSet(parm,parmcount) } } -int fGetKeywordValue( fp, keyword, klen, value, vlen ) - FILE *fp; - char *keyword; - int klen; - char *value; - int vlen; +int fGetKeywordValue(FILE *fp, char *keyword, int klen, char *value, int vlen) { int rc; int gotit; @@ -321,6 +311,7 @@ int fGetKeywordValue( fp, keyword, klen, value, vlen ) } while ( !gotit ); /*NOTREACHED*/ + return 0; /* I know, I know. - markm */ } /* @@ -352,10 +343,7 @@ int fGetKeywordValue( fp, keyword, klen, value, vlen ) * classification for end of file is * always zero. */ -int fGetToken(fp, dest, maxlen) - FILE *fp; - char *dest; - int maxlen; +int fGetToken(FILE *fp, char *dest, int maxlen) { int ch='\0'; int len=0; @@ -448,8 +436,7 @@ int fGetToken(fp, dest, maxlen) * special case certain values (\n, \f, \r, \b) or return a literal * otherwise (useful for \", for example). */ -fGetLiteral(fp) - FILE *fp; +int fGetLiteral(FILE *fp) { int ch; int n=0; @@ -524,9 +511,7 @@ fGetLiteral(fp) * exactly the same as ungetc(3) except that the line number of the * input file is maintained. */ -fUngetChar(ch,fp) - int ch; - FILE *fp; +int fUngetChar(int ch, FILE*fp) { if (ch=='\n') LineNbr--; return(ungetc(ch,fp)); @@ -537,8 +522,7 @@ fUngetChar(ch,fp) * exactly the same as fgetc(3) except that the line number of the * input file is maintained. */ -fGetChar(fp) - FILE *fp; +int fGetChar(FILE *fp) { int ch = fgetc(fp); if (ch=='\n') LineNbr++; @@ -564,8 +548,7 @@ fGetChar(fp) * Return Value: pointer to copied string * */ -char * strsave(p) - char *p; +char *strsave(char *p) { return(strcpy(malloc(strlen(p)+1),p)); } @@ -576,8 +559,7 @@ char * strsave(p) * the pointer to the beginning of the string is returned. */ -char * strutol( start ) - char *start; +char *strutol(char *start) { char *q; for (q=start; *q; q++) @@ -592,9 +574,7 @@ char * strutol( start ) char *pgm = "gettoken"; -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { char *p; int type; @@ -647,9 +627,7 @@ main(argc,argv) #ifdef KVTEST -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { int rc,ch; FILE *fp; @@ -706,9 +684,7 @@ parmtable kparm[] = { { "instance", "", (char *)NULL } }; -main(argc,argv) - int argc; - char **argv; +main(int argc, char **argv) { int rc,i,ch; FILE *fp; diff --git a/eBones/krb/krb_err.et b/eBones/krb/krb_err.et index 2c6830b..7d2baef 100644 --- a/eBones/krb/krb_err.et +++ b/eBones/krb/krb_err.et @@ -1,9 +1,9 @@ # Copyright 1987,1988 Massachusetts Institute of Technology # For copying and distribution information, see the file # "Copyright.MIT". -# +# # from: krb_err.et,v 4.1 89/09/26 09:24:20 jtkohl Exp $ -# $Id: krb_err.et,v 1.2 1994/07/19 19:25:44 g89r4222 Exp $ +# $Id: krb_err.et,v 1.3 1995/07/18 16:39:00 mark Exp $ # error_table krb @@ -45,7 +45,7 @@ ec KRBET_KRB_RES12, "Reserved 12" - + ec KRBET_KRB_RES13, "Reserved 13" diff --git a/eBones/krb/krb_err_txt.c b/eBones/krb/krb_err_txt.c index 785563f..2c8c0ca 100644 --- a/eBones/krb/krb_err_txt.c +++ b/eBones/krb/krb_err_txt.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: krb_err_txt.c,v 4.7 88/12/01 14:10:14 jtkohl Exp $ - * $Id: krb_err_txt.c,v 1.2 1994/07/19 19:25:45 g89r4222 Exp $ + * $Id: krb_err_txt.c,v 1.3 1995/07/18 16:39:02 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: krb_err_txt.c,v 1.2 1994/07/19 19:25:45 g89r4222 Exp $"; +"$Id: krb_err_txt.c,v 1.3 1995/07/18 16:39:02 mark Exp $"; #endif lint +#endif /* * This file contains an array of error text strings. diff --git a/eBones/krb/krb_get_in_tkt.c b/eBones/krb/krb_get_in_tkt.c index af92bc6..e17b60e 100644 --- a/eBones/krb/krb_get_in_tkt.c +++ b/eBones/krb/krb_get_in_tkt.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: der: krb_get_in_tkt.c,v 4.19 89/07/18 16:31:31 jtkohl Exp $ - * $Id: krb_get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: krb_get_in_tkt.c,v 1.3 1995/07/18 16:39:04 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: krb_get_in_tkt.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: krb_get_in_tkt.c,v 1.3 1995/07/18 16:39:04 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <des.h> @@ -33,13 +35,8 @@ int swap_bytes; * using the key returned by key_proc. */ -static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) - char *user; - char *instance; - char *realm; - char *arg; - int (*key_proc)(); - KTEXT *cipp; +static int decrypt_tkt(char *user, char *instance, char *realm, char *arg, + int (*key_proc)(), KTEXT *cipp) { KTEXT cip = *cipp; C_Block key; /* Key for decrypting cipher */ @@ -59,9 +56,9 @@ static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) } #ifndef NOENCRYPTION - key_sched(key,key_s); - pcbc_encrypt((C_Block *)cip->dat,(C_Block *)cip->dat, - (long) cip->length,key_s,key,DES_DECRYPT); + key_sched((des_cblock *)key,key_s); + pcbc_encrypt((des_cblock *)cip->dat,(des_cblock *)cip->dat, + (long) cip->length,key_s,(des_cblock *)key,DES_DECRYPT); #endif /* !NOENCRYPTION */ /* Get rid of all traces of key */ bzero((char *)key,sizeof(key)); @@ -111,17 +108,9 @@ static int decrypt_tkt(user, instance, realm, arg, key_proc, cipp) * string sinstance service's instance */ -krb_get_in_tkt(user, instance, realm, service, sinstance, life, - key_proc, decrypt_proc, arg) - char *user; - char *instance; - char *realm; - char *service; - char *sinstance; - int life; - int (*key_proc)(); - int (*decrypt_proc)(); - char *arg; +int krb_get_in_tkt(char *user, char *instance, char *realm, char *service, + char *sinstance, int life, int (*key_proc)(), int (*decrypt_proc)(), + char *arg) { KTEXT_ST pkt_st; KTEXT pkt = &pkt_st; /* Packet to KDC */ @@ -182,7 +171,7 @@ krb_get_in_tkt(user, instance, realm, service, sinstance, life, /* SEND THE REQUEST AND RECEIVE THE RETURN PACKET */ - if (kerror = send_to_kdc(pkt, rpkt, realm)) return(kerror); + if ((kerror = send_to_kdc(pkt, rpkt, realm))) return(kerror); /* check packet version of the returned packet */ if (pkt_version(rpkt) != KRB_PROT_VERSION) @@ -289,8 +278,8 @@ krb_get_in_tkt(user, instance, realm, service, sinstance, life, return(INTK_ERR); /* stash ticket, session key, etc. for future use */ - if (kerror = save_credentials(s_name, s_instance, rlm, ses, - lifetime, kvno, tkt, t_local.tv_sec)) + if ((kerror = save_credentials(s_name, s_instance, rlm, ses, + lifetime, kvno, tkt, t_local.tv_sec))) return(kerror); return(INTK_OK); diff --git a/eBones/krb/krbglue.c b/eBones/krb/krbglue.c index 8e864c1..de5b7e2 100644 --- a/eBones/krb/krbglue.c +++ b/eBones/krb/krbglue.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: krbglue.c,v 4.1 89/01/23 15:51:50 wesommer Exp $ - * $Id: krbglue.c,v 1.2 1994/07/19 19:25:49 g89r4222 Exp $ + * $Id: krbglue.c,v 1.3 1995/07/18 16:39:05 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -$Id: krbglue.c,v 1.2 1994/07/19 19:25:49 g89r4222 Exp $"; +$Id: krbglue.c,v 1.3 1995/07/18 16:39:05 mark Exp $"; #endif lint +#endif #ifndef NCOMPAT /* diff --git a/eBones/krb/kuserok.c b/eBones/krb/kuserok.c index 404532d..15a25e8 100644 --- a/eBones/krb/kuserok.c +++ b/eBones/krb/kuserok.c @@ -7,16 +7,19 @@ * access to a local account * * from: kuserok.c,v 4.5 89/01/23 09:25:21 jtkohl Exp $ - * $Id: kuserok.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: kuserok.c,v 1.3 1995/07/18 16:39:07 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: kuserok.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: kuserok.c,v 1.3 1995/07/18 16:39:07 mark Exp $"; #endif lint +#endif #include <krb.h> #include <stdio.h> +#include <unistd.h> #include <pwd.h> #include <sys/param.h> #include <sys/socket.h> @@ -83,9 +86,7 @@ parmtable kparm[] = { #define KPARMS kparm,PARMCOUNT(kparm) #endif ATHENA_COMPAT -kuserok(kdata, luser) - AUTH_DAT *kdata; - char *luser; +int kuserok(AUTH_DAT *kdata, char *luser) { struct stat sbuf; struct passwd *pwd; @@ -178,7 +179,7 @@ kuserok(kdata, luser) linebuf[BUFSIZ-1] = '\0'; newline = NULL; /* nuke the newline if it exists */ - if (newline = index(linebuf, '\n')) + if ((newline = index(linebuf, '\n'))) *newline = '\0'; rc = kname_parse(principal, inst, realm, linebuf); if (rc == KSUCCESS) { diff --git a/eBones/krb/log.c b/eBones/krb/log.c index 42fccfb..aea6ab9 100644 --- a/eBones/krb/log.c +++ b/eBones/krb/log.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: log.c,v 4.7 88/12/01 14:15:14 jtkohl Exp $ - * $Id: log.c,v 1.2 1994/07/19 19:25:53 g89r4222 Exp $ + * $Id: log.c,v 1.3 1995/07/18 16:39:09 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: log.c,v 1.2 1994/07/19 19:25:53 g89r4222 Exp $"; +"$Id: log.c,v 1.3 1995/07/18 16:39:09 mark Exp $"; #endif /* lint */ +#endif #include <sys/time.h> #include <stdio.h> @@ -42,18 +44,12 @@ static is_open; * The return value is undefined. */ -__BEGIN_DECLS -char *month_sname __P((int)); -__END_DECLS - - /*VARARGS1 */ -void log(format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) - char *format; - int a1,a2,a3,a4,a5,a6,a7,a8,a9,a0; +void log(char *format,int a1,int a2,int a3,int a4,int a5,int a6,int a7, + int a8,int a9,int a0) { - FILE *logfile, *fopen(); - long time(),now; + FILE *logfile; + long now; struct tm *tm; if ((logfile = fopen(log_name,"a")) == NULL) @@ -77,8 +73,7 @@ void log(format,a1,a2,a3,a4,a5,a6,a7,a8,a9,a0) * the logfile defaults to KRBLOG, defined in "krb.h". */ -set_logfile(filename) - char *filename; +void set_logfile(char *filename) { log_name = filename; is_open = 0; @@ -91,9 +86,7 @@ set_logfile(filename) * on success. */ -new_log(t,string) - long t; - char *string; +int new_log(long t, char *string) { static FILE *logfile; diff --git a/eBones/krb/mk_err.c b/eBones/krb/mk_err.c index 331cba9..8600240 100644 --- a/eBones/krb/mk_err.c +++ b/eBones/krb/mk_err.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: mk_err.c,v 4.4 88/11/15 16:33:36 jtkohl Exp $ - * $Id: mk_err.c,v 1.2 1994/07/19 19:25:54 g89r4222 Exp $ + * $Id: mk_err.c,v 1.3 1995/07/18 16:39:11 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: mk_err.c,v 1.2 1994/07/19 19:25:54 g89r4222 Exp $"; +"$Id: mk_err.c,v 1.3 1995/07/18 16:39:11 mark Exp $"; #endif /* lint */ +#endif #include <sys/types.h> #include <krb.h> diff --git a/eBones/krb/mk_priv.c b/eBones/krb/mk_priv.c index 3050cf4..bc377de 100644 --- a/eBones/krb/mk_priv.c +++ b/eBones/krb/mk_priv.c @@ -16,16 +16,19 @@ * Steve Miller Project Athena MIT/DEC * * from: mk_priv.c,v 4.13 89/03/22 14:48:59 jtkohl Exp $ - * $Id: mk_priv.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_priv.c,v 1.3 1995/07/18 16:39:13 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: mk_priv.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_priv.c,v 1.3 1995/07/18 16:39:13 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include <stdio.h> +#include <string.h> #include <errno.h> #include <sys/types.h> #include <netinet/in.h> @@ -37,13 +40,8 @@ static char rcsid[] = #include <prot.h> #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ - static u_long c_length; static struct timeval msg_time; static u_char msg_time_5ms; @@ -92,16 +90,9 @@ static long msg_time_sec; * 0<=n<=7 bytes pad to 8 byte multiple zeroes */ -long krb_mk_priv(in,out,length,schedule,key,sender,receiver) - u_char *in; /* application data */ - u_char *out; /* put msg here, leave room for - * header! breaks if in and out - * (header stuff) overlap */ - u_long length; /* of in data */ - Key_schedule schedule; /* precomputed key schedule */ - C_Block key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender address */ - struct sockaddr_in *receiver; /* receiver address */ +long krb_mk_priv(u_char *in, u_char *out, u_long length, + des_key_schedule schedule, des_cblock key, struct sockaddr_in *sender, + struct sockaddr_in *receiver) { register u_char *p,*q; static u_char *c_length_ptr; @@ -196,7 +187,8 @@ long krb_mk_priv(in,out,length,schedule,key,sender,receiver) bcopy((char *) &c_length,(char *)c_length_ptr,sizeof(c_length)); #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)q,(C_Block *)q,(long)(p-q),schedule,key,ENCRYPT); + pcbc_encrypt((des_cblock *)q,(des_cblock *)q,(long)(p-q),schedule, + (des_cblock *)key,ENCRYPT); #endif /* NOENCRYPTION */ return (q - out + c_length); /* resulting size */ diff --git a/eBones/krb/mk_req.c b/eBones/krb/mk_req.c index fd31717..971e6a2 100644 --- a/eBones/krb/mk_req.c +++ b/eBones/krb/mk_req.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: der: mk_req.c,v 4.17 89/07/07 15:20:35 jtkohl Exp $ - * $Id: mk_req.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_req.c,v 1.3 1995/07/18 16:39:15 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: mk_req.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_req.c,v 1.3 1995/07/18 16:39:15 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> @@ -19,7 +21,6 @@ static char *rcsid = #include <sys/time.h> #include <strings.h> -extern int krb_ap_req_debug; static struct timeval tv_local = { 0, 0 }; static int lifetime = DEFAULT_TKT_LIFE; @@ -67,12 +68,8 @@ static int lifetime = DEFAULT_TKT_LIFE; * all rounded up to multiple of 8. */ -krb_mk_req(authent,service,instance,realm,checksum) - register KTEXT authent; /* Place to build the authenticator */ - char *service; /* Name of the service */ - char *instance; /* Service instance */ - char *realm; /* Authentication domain of service */ - long checksum; /* Checksum of data (optional) */ +int krb_mk_req(KTEXT authent, char *service, char *instance, char *realm, + long checksum) { static KTEXT_ST req_st; /* Temp storage for req id */ register KTEXT req_id = &req_st; @@ -106,9 +103,9 @@ krb_mk_req(authent,service,instance,realm,checksum) retval = krb_get_cred(service,instance,realm,&cr); if (retval == RET_NOTKT) { - if (retval = get_ad_tkt(service,instance,realm,lifetime)) + if ((retval = get_ad_tkt(service,instance,realm,lifetime))) return(retval); - if (retval = krb_get_cred(service,instance,realm,&cr)) + if ((retval = krb_get_cred(service,instance,realm,&cr))) return(retval); } @@ -126,7 +123,7 @@ krb_mk_req(authent,service,instance,realm,checksum) if (krb_ap_req_debug) printf("Ticket->length = %d\n",ticket->length); if (krb_ap_req_debug) - printf("Issue date: %d\n",cr.issue_date); + printf("Issue date: %ld\n",cr.issue_date); /* Build request id */ (void) strcpy((char *)(req_id->dat),cr.pname); /* Auth name */ @@ -154,9 +151,9 @@ krb_mk_req(authent,service,instance,realm,checksum) req_id->length = ((req_id->length+7)/8)*8; #ifndef NOENCRYPTION - key_sched(cr.session,key_s); - pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat, - (long)req_id->length,key_s,cr.session,ENCRYPT); + key_sched((des_cblock *)cr.session,key_s); + pcbc_encrypt((des_cblock *)req_id->dat,(des_cblock *)req_id->dat, + (long)req_id->length,key_s,(des_cblock *)cr.session,ENCRYPT); bzero((char *) key_s, sizeof(key_s)); #endif /* NOENCRYPTION */ @@ -184,9 +181,7 @@ krb_mk_req(authent,service,instance,realm,checksum) * It returns the previous value of the default lifetime. */ -int -krb_set_lifetime(newval) -int newval; +int krb_set_lifetime(int newval) { int olife = lifetime; diff --git a/eBones/krb/mk_safe.c b/eBones/krb/mk_safe.c index 46a80f7..f4aab32 100644 --- a/eBones/krb/mk_safe.c +++ b/eBones/krb/mk_safe.c @@ -15,16 +15,19 @@ * Steve Miller Project Athena MIT/DEC * * from: mk_safe.c,v 4.12 89/03/22 14:50:49 jtkohl Exp $ - * $Id: mk_safe.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $ + * $Id: mk_safe.c,v 1.3 1995/07/18 16:39:17 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: mk_safe.c,v 1.1.1.1 1994/09/30 14:50:02 csgr Exp $"; +"$Id: mk_safe.c,v 1.3 1995/07/18 16:39:17 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include <stdio.h> +#include <string.h> #include <errno.h> #include <sys/types.h> #include <netinet/in.h> @@ -80,17 +83,8 @@ static long msg_time_sec; * above using "key" */ -long krb_mk_safe(in,out,length,key,sender,receiver) - u_char *in; /* application data */ - u_char *out; /* - * put msg here, leave room for header! - * breaks if in and out (header stuff) - * overlap - */ - u_long length; /* of in data */ - C_Block *key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender address */ - struct sockaddr_in *receiver; /* receiver address */ +long krb_mk_safe(u_char *in, u_char *out, u_long length, des_cblock key, + struct sockaddr_in *sender, struct sockaddr_in *receiver) { register u_char *p,*q; @@ -154,10 +148,10 @@ long krb_mk_safe(in,out,length,key,sender,receiver) cksum = 0; bzero(big_cksum, sizeof(big_cksum)); #else - cksum=quad_cksum(q,big_cksum,p-q,2,key); + cksum=quad_cksum((des_cblock *)q,big_cksum,p-q,2,(des_cblock *)key); #endif if (krb_debug) - printf("\ncksum = %u",cksum); + printf("\ncksum = %lu",cksum); /* stuff checksum */ bcopy((char *)big_cksum,(char *)p,sizeof(big_cksum)); diff --git a/eBones/krb/month_sname.c b/eBones/krb/month_sname.c index e7a63ec..3443e41 100644 --- a/eBones/krb/month_sname.c +++ b/eBones/krb/month_sname.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: month_sname.c,v 4.4 88/11/15 16:39:32 jtkohl Exp $ - * $Id: month_sname.c,v 1.2 1994/07/19 19:26:00 g89r4222 Exp $ + * $Id: month_sname.c,v 1.3 1995/07/18 16:39:19 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: month_sname.c,v 1.2 1994/07/19 19:26:00 g89r4222 Exp $"; +"$Id: month_sname.c,v 1.3 1995/07/18 16:39:19 mark Exp $"; #endif /* lint */ +#endif /* @@ -20,8 +22,7 @@ static char *rcsid = * month. Returns 0 if the argument is out of range. */ -char *month_sname(n) - int n; +char *month_sname(int n) { static char *name[] = { "Jan","Feb","Mar","Apr","May","Jun", diff --git a/eBones/krb/netread.c b/eBones/krb/netread.c index eb86327..c773bc8 100644 --- a/eBones/krb/netread.c +++ b/eBones/krb/netread.c @@ -4,13 +4,19 @@ * <Copyright.MIT>. * * from: netread.c,v 4.1 88/11/15 16:47:21 jtkohl Exp $ - * $Id: netread.c,v 1.2 1994/07/19 19:26:03 g89r4222 Exp $ + * $Id: netread.c,v 1.3 1995/07/18 16:39:20 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: netread.c,v 1.2 1994/07/19 19:26:03 g89r4222 Exp $"; +"$Id: netread.c,v 1.3 1995/07/18 16:39:20 mark Exp $"; #endif lint +#endif + +#include <stdio.h> +#include <unistd.h> +#include <krb.h> /* * krb_net_read() reads from the file descriptor "fd" to the buffer @@ -22,11 +28,7 @@ static char rcsid[] = * XXX must not use non-blocking I/O */ -int -krb_net_read(fd, buf, len) -int fd; -register char *buf; -register int len; +int krb_net_read(int fd, char *buf, int len) { int cc, len2 = 0; diff --git a/eBones/krb/netwrite.c b/eBones/krb/netwrite.c index 5945ce0..7af91ff 100644 --- a/eBones/krb/netwrite.c +++ b/eBones/krb/netwrite.c @@ -4,13 +4,19 @@ * <Copyright.MIT>. * * from: netwrite.c,v 4.1 88/11/15 16:48:58 jtkohl Exp $"; - * $Id: netwrite.c,v 1.2 1994/07/19 19:26:04 g89r4222 Exp $ + * $Id: netwrite.c,v 1.3 1995/07/18 16:39:22 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: netwrite.c,v 1.2 1994/07/19 19:26:04 g89r4222 Exp $"; +"$Id: netwrite.c,v 1.3 1995/07/18 16:39:22 mark Exp $"; #endif lint +#endif + +#include <stdio.h> +#include <unistd.h> +#include <krb.h> /* * krb_net_write() writes "len" bytes from "buf" to the file @@ -21,11 +27,7 @@ static char rcsid[] = * XXX must not use non-blocking I/O */ -int -krb_net_write(fd, buf, len) -int fd; -register char *buf; -int len; +int krb_net_write(int fd, char *buf, int len) { int cc; register int wrlen = len; diff --git a/eBones/krb/one.c b/eBones/krb/one.c index c0e8bc6..ef02ae1 100644 --- a/eBones/krb/one.c +++ b/eBones/krb/one.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * form: one.c,v 4.1 88/11/15 16:51:41 jtkohl Exp $ - * $Id: one.c,v 1.2 1994/07/19 19:26:05 g89r4222 Exp $ + * $Id: one.c,v 1.3 1995/07/18 16:39:24 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: one.c,v 1.2 1994/07/19 19:26:05 g89r4222 Exp $"; +"$Id: one.c,v 1.3 1995/07/18 16:39:24 mark Exp $"; #endif lint +#endif /* * definition of variable set to 1. diff --git a/eBones/krb/pkt_cipher.c b/eBones/krb/pkt_cipher.c index 6ef870c..9c32b72 100644 --- a/eBones/krb/pkt_cipher.c +++ b/eBones/krb/pkt_cipher.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: pkt_cipher.c,v 4.8 89/01/13 17:46:14 steiner Exp $ - * $Id: pkt_cipher.c,v 1.2 1994/07/19 19:26:07 g89r4222 Exp $ + * $Id: pkt_cipher.c,v 1.3 1995/07/18 16:39:25 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: pkt_cipher.c,v 1.2 1994/07/19 19:26:07 g89r4222 Exp $"; +"$Id: pkt_cipher.c,v 1.3 1995/07/18 16:39:25 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> diff --git a/eBones/krb/pkt_clen.c b/eBones/krb/pkt_clen.c index 23ad4c3..17d46c2 100644 --- a/eBones/krb/pkt_clen.c +++ b/eBones/krb/pkt_clen.c @@ -5,18 +5,20 @@ * <Copyright.MIT>. * * 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 $ + * $Id: pkt_clen.c,v 1.3 1995/07/18 16:39:27 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: pkt_clen.c,v 1.2 1994/07/19 19:26:09 g89r4222 Exp $"; +"$Id: pkt_clen.c,v 1.3 1995/07/18 16:39:27 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> +#include <string.h> -extern int krb_debug; extern int swap_bytes; /* @@ -27,8 +29,7 @@ extern int swap_bytes; * ciphertext length out of the packet. */ -pkt_clen(pkt) - KTEXT pkt; +int pkt_clen(KTEXT pkt) { static unsigned short temp,temp2; int clen = 0; diff --git a/eBones/krb/rd_err.c b/eBones/krb/rd_err.c index e73c47b..8c5b8a2 100644 --- a/eBones/krb/rd_err.c +++ b/eBones/krb/rd_err.c @@ -13,16 +13,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_err.c,v 4.5 89/01/13 17:26:38 steiner Exp $ - * $Id: rd_err.c,v 1.2 1994/07/19 19:26:10 g89r4222 Exp $ + * $Id: rd_err.c,v 1.3 1995/07/18 16:39:29 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: rd_err.c,v 1.2 1994/07/19 19:26:10 g89r4222 Exp $"; +"$Id: rd_err.c,v 1.3 1995/07/18 16:39:29 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include <stdio.h> +#include <string.h> #include <errno.h> #include <sys/types.h> #include <netinet/in.h> @@ -47,12 +50,7 @@ static char rcsid[] = * The AUTH_MSG_APPL_ERR message format can be found in mk_err.c */ -int -krb_rd_err(in,in_length,code,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* of in msg */ - long *code; /* received error code */ - MSG_DAT *m_data; +int krb_rd_err(u_char *in, u_long in_length, long *code, MSG_DAT *m_data) { register u_char *p; int swap_bytes = 0; diff --git a/eBones/krb/rd_priv.c b/eBones/krb/rd_priv.c index 0e3d906..457352e 100644 --- a/eBones/krb/rd_priv.c +++ b/eBones/krb/rd_priv.c @@ -15,16 +15,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_priv.c,v 4.14 89/04/28 11:59:42 jtkohl Exp $ - * $Id: rd_priv.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: rd_priv.c,v 1.3 1995/07/18 16:39:31 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[]= -"$Id: rd_priv.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: rd_priv.c,v 1.3 1995/07/18 16:39:31 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include <stdio.h> +#include <string.h> #include <errno.h> #include <sys/types.h> #include <netinet/in.h> @@ -36,10 +39,6 @@ static char rcsid[]= #include <prot.h> #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ static u_long c_length; @@ -69,14 +68,9 @@ int private_msg_ver = KRB_PROT_VERSION; * information, MSG_DAT, is defined in "krb.h". */ -long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* length of "in" msg */ - Key_schedule schedule; /* precomputed key schedule */ - C_Block key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; - struct sockaddr_in *receiver; - MSG_DAT *m_data; /*various input/output data from msg */ +long krb_rd_priv(u_char *in, u_long in_length, des_key_schedule schedule, + des_cblock key, struct sockaddr_in *sender, struct sockaddr_in *receiver, + MSG_DAT *m_data) { register u_char *p,*q; static u_long src_addr; /* Can't send structs since no @@ -109,7 +103,8 @@ long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) q = p; /* mark start of encrypted stuff */ #ifndef NOENCRYPTION - pcbc_encrypt((C_Block *)q,(C_Block *)q,(long)c_length,schedule,key,DECRYPT); + pcbc_encrypt((des_cblock *)q,(des_cblock *)q,(long)c_length,schedule, + (des_cblock *)key,DECRYPT); #endif /* safely get application data length */ @@ -176,7 +171,7 @@ long krb_rd_priv(in,in_length,schedule,key,sender,receiver,m_data) if (delta_t > CLOCK_SKEW) return RD_AP_TIME; if (krb_debug) - printf("\ndelta_t = %d",delta_t); + printf("\ndelta_t = %ld",delta_t); /* * caller must check timestamps for proper order and diff --git a/eBones/krb/rd_req.c b/eBones/krb/rd_req.c index 22b6540..b77ec48 100644 --- a/eBones/krb/rd_req.c +++ b/eBones/krb/rd_req.c @@ -5,22 +5,23 @@ * <Copyright.MIT>. * * from: der: rd_req.c,v 4.16 89/03/22 14:52:06 jtkohl Exp $ - * $Id: rd_req.c,v 1.2 1994/07/19 19:26:13 g89r4222 Exp $ + * $Id: rd_req.c,v 1.3 1995/07/18 16:39:33 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: rd_req.c,v 1.2 1994/07/19 19:26:13 g89r4222 Exp $"; +"$Id: rd_req.c,v 1.3 1995/07/18 16:39:33 mark Exp $"; #endif /* lint */ +#endif +#include <stdio.h> #include <des.h> #include <krb.h> #include <prot.h> #include <sys/time.h> #include <strings.h> -extern int krb_ap_req_debug; - static struct timeval t_local = { 0, 0 }; /* @@ -64,20 +65,17 @@ static char st_inst[INST_SZ]; /* server's instance */ * krb_rd_req(). */ -int -krb_set_key(key,cvt) - char *key; - int cvt; +int krb_set_key(char *key, int cvt) { #ifdef NOENCRYPTION bzero(ky, sizeof(ky)); return KSUCCESS; #else if (cvt) - string_to_key(key,ky); + string_to_key(key,(des_cblock *)ky); else bcopy(key,(char *)ky,8); - return(des_key_sched(ky,serv_key)); + return(des_key_sched((des_cblock *)ky,serv_key)); #endif } @@ -123,13 +121,8 @@ krb_set_key(key,cvt) * Mutual authentication is not implemented. */ -krb_rd_req(authent,service,instance,from_addr,ad,fn) - register KTEXT authent; /* The received message */ - char *service; /* Service name */ - char *instance; /* Service instance */ - long from_addr; /* Net address of originating host */ - AUTH_DAT *ad; /* Structure to be filled in */ - char *fn; /* Filename to get keys from */ +int krb_rd_req (KTEXT authent, char *service, char *instance, long from_addr, + AUTH_DAT *ad, char *fn) { static KTEXT_ST ticket; /* Temp storage for ticket */ static KTEXT tkt = &ticket; @@ -208,7 +201,7 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn) #ifndef NOENCRYPTION if (read_service_key(service,instance,realm,s_kvno,fn,(char *)skey)) return(RD_AP_UNDEC); - if (status=krb_set_key((char *)skey,0)) return(status); + if ((status=krb_set_key((char *)skey,0))) return(status); #endif (void) strcpy(st_rlm,realm); (void) strcpy(st_nam,service); @@ -248,9 +241,10 @@ krb_rd_req(authent,service,instance,from_addr,ad,fn) bcopy(ptr + tkt->length, (char *)(req_id->dat),req_id->length); #ifndef NOENCRYPTION - key_sched(ad->session,seskey_sched); - pcbc_encrypt((C_Block *)req_id->dat,(C_Block *)req_id->dat, - (long)req_id->length,seskey_sched,ad->session,DES_DECRYPT); + key_sched((des_cblock *)ad->session,seskey_sched); + pcbc_encrypt((des_cblock *)req_id->dat,(des_cblock *)req_id->dat, + (long)req_id->length,seskey_sched,(des_cblock *)ad->session, + DES_DECRYPT); #endif /* NOENCRYPTION */ #define check_ptr() if ((ptr - (char *) req_id->dat) > req_id->length) return(RD_AP_MODIFIED); diff --git a/eBones/krb/rd_safe.c b/eBones/krb/rd_safe.c index 3bfc490..48d43c5 100644 --- a/eBones/krb/rd_safe.c +++ b/eBones/krb/rd_safe.c @@ -13,16 +13,19 @@ * Steve Miller Project Athena MIT/DEC * * from: rd_safe.c,v 4.12 89/01/23 15:16:16 steiner Exp $ - * $Id: rd_safe.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: rd_safe.c,v 1.3 1995/07/18 16:39:34 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: rd_safe.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: rd_safe.c,v 1.3 1995/07/18 16:39:34 mark Exp $"; #endif /* lint */ +#endif /* system include files */ #include <stdio.h> +#include <string.h> #include <errno.h> #include <sys/types.h> #include <netinet/in.h> @@ -34,10 +37,6 @@ static char rcsid[] = #include <prot.h> #include "lsb_addr_comp.h" -extern char *errmsg(); -extern int errno; -extern int krb_debug; - /* static storage */ static C_Block calc_cksum[2]; @@ -63,13 +62,9 @@ static u_long delta_t; * information, MSG_DAT, is defined in "krb.h". */ -long krb_rd_safe(in,in_length,key,sender,receiver,m_data) - u_char *in; /* pointer to the msg received */ - u_long in_length; /* length of "in" msg */ - C_Block *key; /* encryption key for seed and ivec */ - struct sockaddr_in *sender; /* sender's address */ - struct sockaddr_in *receiver; /* receiver's address -- me */ - MSG_DAT *m_data; /* where to put message information */ +long krb_rd_safe(u_char *in, u_long in_length, des_cblock key, + struct sockaddr_in *sender, struct sockaddr_in *receiver, + MSG_DAT *m_data) { register u_char *p,*q; static u_long src_addr; /* Can't send structs since no @@ -167,11 +162,11 @@ krb_rd_safe protocol err sizeof(u_long) != sizeof(struct in_addr)"); #ifdef NOENCRYPTION bzero(calc_cksum, sizeof(calc_cksum)); #else - quad_cksum(q,calc_cksum,p-q,2,key); + quad_cksum((des_cblock *)q,calc_cksum,p-q,2,(des_cblock *)key); #endif if (krb_debug) - printf("\ncalc_cksum = %u, received cksum = %u", + printf("\ncalc_cksum = %lu, received cksum = %lu", (long) calc_cksum[0], (long) big_cksum[0]); if (bcmp((char *)big_cksum,(char *)calc_cksum,sizeof(big_cksum))) return(RD_AP_MODIFIED); diff --git a/eBones/krb/read_service_key.c b/eBones/krb/read_service_key.c index c68a8fc..aa577fd 100644 --- a/eBones/krb/read_service_key.c +++ b/eBones/krb/read_service_key.c @@ -5,17 +5,20 @@ * <Copyright.MIT>. * * from: _service_key.c,v 4.10 90/03/10 19:06:56 jon Exp $ - * $Id: read_service_key.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: read_service_key.c,v 1.3 1995/07/18 16:39:36 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: read_service_key.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: read_service_key.c,v 1.3 1995/07/18 16:39:36 mark Exp $"; #endif /* lint */ +#endif #include <krb.h> #include <stdio.h> #include <strings.h> +#include <unistd.h> /* * The private keys for servers on a given host are stored in a @@ -51,13 +54,8 @@ static char *rcsid = /*ARGSUSED */ -read_service_key(service,instance,realm,kvno,file,key) - char *service; /* Service Name */ - char *instance; /* Instance name or "*" */ - char *realm; /* Realm */ - int kvno; /* Key version number */ - char *file; /* Filename */ - char *key; /* Pointer to key to be filled in */ +int read_service_key(char *service, char *instance, char *realm, int kvno, + char *file, char *key) { char serv[SNAME_SZ]; char inst[INST_SZ]; diff --git a/eBones/krb/recvauth.c b/eBones/krb/recvauth.c index 2ab364f..8e9a6bb 100644 --- a/eBones/krb/recvauth.c +++ b/eBones/krb/recvauth.c @@ -4,21 +4,25 @@ * <Copyright.MIT>. * * from: recvauth.c,v 4.4 90/03/10 19:03:08 jon Exp $"; - * $Id: recvauth.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $ + * $Id: recvauth.c,v 1.3 1995/07/18 16:39:38 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: recvauth.c,v 1.1.1.1 1994/09/30 14:50:03 csgr Exp $"; +"$Id: recvauth.c,v 1.3 1995/07/18 16:39:38 mark Exp $"; #endif lint +#endif -#include <krb.h> #include <sys/types.h> #include <netinet/in.h> #include <syslog.h> #include <errno.h> #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> #include <strings.h> +#include <krb.h> #define KRB_SENDAUTH_VERS "AUTHV0.1" /* MUST be KRB_SENDAUTH_VLEN @@ -30,8 +34,6 @@ static char rcsid[] = * be sure to support old versions of krb_sendauth! */ -extern int errno; - /* * krb_recvauth() reads (and optionally responds to) a message sent * using krb_sendauth(). The "options" argument is a bit-field of @@ -118,24 +120,14 @@ extern int errno; #endif /* max */ int -krb_recvauth(options, fd, ticket, service, instance, faddr, laddr, kdata, - filename, schedule, version) -long options; /* bit-pattern of options */ -int fd; /* file descr. to read from */ -KTEXT ticket; /* storage for client's ticket */ -char *service; /* service expected */ -char *instance; /* inst expected (may be filled in) */ -struct sockaddr_in *faddr; /* address of foreign host on fd */ -struct sockaddr_in *laddr; /* local address */ -AUTH_DAT *kdata; /* kerberos data (returned) */ -char *filename; /* name of file with service keys */ -Key_schedule schedule; /* key schedule (return) */ -char *version; /* version string (filled in) */ +krb_recvauth(long options, int fd, KTEXT ticket, char *service, char *instance, + struct sockaddr_in *faddr, struct sockaddr_in *laddr, AUTH_DAT *kdata, + char *filename, des_key_schedule schedule, char *version) { int i, cc, old_vers = 0; char krb_vers[KRB_SENDAUTH_VLEN + 1]; /* + 1 for the null terminator */ - char *cp; + char *cp = NULL; int rem; long tkt_len, priv_len; u_long cksum; @@ -250,7 +242,7 @@ char *version; /* version string (filled in) */ cksum = kdata->checksum + 1; cksum = htonl(cksum); #ifndef NOENCRYPTION - key_sched(kdata->session,schedule); + key_sched((des_cblock *)kdata->session,schedule); #endif priv_len = krb_mk_priv((unsigned char *)&cksum, tmp_buf, diff --git a/eBones/krb/save_credentials.c b/eBones/krb/save_credentials.c index 129c912..bec225f 100644 --- a/eBones/krb/save_credentials.c +++ b/eBones/krb/save_credentials.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: save_credentials.c,v 4.9 89/05/31 17:45:43 jtkohl Exp $ - * $Id: save_credentials.c,v 1.2 1994/07/19 19:26:19 g89r4222 Exp $ + * $Id: save_credentials.c,v 1.3 1995/07/18 16:39:40 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: save_credentials.c,v 1.2 1994/07/19 19:26:19 g89r4222 Exp $"; +"$Id: save_credentials.c,v 1.3 1995/07/18 16:39:40 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> #include <krb.h> @@ -28,16 +30,8 @@ static char *rcsid = * by the tf_init() or tf_save_cred() routines. */ -save_credentials(service, instance, realm, session, lifetime, kvno, - ticket, issue_date) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - C_Block session; /* Session key */ - int lifetime; /* Lifetime */ - int kvno; /* Key version number */ - KTEXT ticket; /* The ticket itself */ - long issue_date; /* The issue time */ +int save_credentials(char *service, char *instance, char *realm, + des_cblock session, int lifetime, int kvno, KTEXT ticket, long issue_date) { int tf_status; /* return values of the tf_util calls */ diff --git a/eBones/krb/send_to_kdc.c b/eBones/krb/send_to_kdc.c index 43f04a2..1e1da44 100644 --- a/eBones/krb/send_to_kdc.c +++ b/eBones/krb/send_to_kdc.c @@ -4,18 +4,22 @@ * <Copyright.MIT>. * * from: send_to_kdc.c,v 4.20 90/01/02 13:40:37 jtkohl Exp $ - * $Id: send_to_kdc.c,v 1.3 1995/01/25 06:37:33 gibbs Exp $ + * $Id: send_to_kdc.c,v 1.3 1995/07/18 16:39:42 mark Exp $ */ +#if 0 #ifndef lint static char rcsid_send_to_kdc_c[] = "$Id: send_to_kdc.c,v 1.1 1994/03/21 17:35:39 piero Exp "; #endif /* lint */ +#endif #include <krb.h> #include <prot.h> #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> #include <errno.h> #include <sys/time.h> #include <sys/types.h> @@ -24,16 +28,12 @@ static char rcsid_send_to_kdc_c[] = #endif /* lint */ #include <sys/socket.h> #include <netinet/in.h> +#include <arpa/inet.h> #include <netdb.h> #include <strings.h> #define S_AD_SZ sizeof(struct sockaddr_in) -extern int errno; -extern int krb_debug; - -extern char *malloc(), *calloc(), *realloc(); - int krb_udp_port = 0; /* CLIENT_KRB_TIMEOUT indicates the time to wait before @@ -41,7 +41,6 @@ int krb_udp_port = 0; */ static struct timeval timeout = { CLIENT_KRB_TIMEOUT, 0}; static char *prog = "send_to_kdc"; -static send_recv(); /* * This file contains two routines, send_to_kdc() and send_recv(). @@ -49,6 +48,85 @@ static send_recv(); */ /* + * try to send out and receive message. + * return 1 on success, 0 on failure + */ + +static int send_recv(KTEXT pkt, KTEXT rpkt, int f, struct sockaddr_in *_to, + struct hostent *addrs) +{ + fd_set readfds; + register struct hostent *hp; + struct sockaddr_in from; + int sin_size; + int numsent; + + if (krb_debug) { + if (_to->sin_family == AF_INET) + printf("Sending message to %s...", + inet_ntoa(_to->sin_addr)); + else + printf("Sending message..."); + (void) fflush(stdout); + } + if ((numsent = sendto(f,(char *)(pkt->dat), pkt->length, 0, + (struct sockaddr *)_to, + S_AD_SZ)) != pkt->length) { + if (krb_debug) + printf("sent only %d/%d\n",numsent, pkt->length); + return 0; + } + if (krb_debug) { + printf("Sent\nWaiting for reply..."); + (void) fflush(stdout); + } + FD_ZERO(&readfds); + FD_SET(f, &readfds); + errno = 0; + /* select - either recv is ready, or timeout */ + /* see if timeout or error or wrong descriptor */ + if (select(f + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout) < 1 + || !FD_ISSET(f, &readfds)) { + if (krb_debug) { + fprintf(stderr, "select failed: readfds=%lx", + (unsigned long)&readfds); + perror(""); + } + return 0; + } + sin_size = sizeof(from); + if (recvfrom(f, (char *)(rpkt->dat), sizeof(rpkt->dat), 0, + (struct sockaddr *)&from, &sin_size) + < 0) { + if (krb_debug) + perror("recvfrom"); + return 0; + } + if (krb_debug) { + printf("received packet from %s\n", inet_ntoa(from.sin_addr)); + fflush(stdout); + } + for (hp = addrs; hp->h_name != (char *)NULL; hp++) { + if (!bcmp(hp->h_addr, (char *)&from.sin_addr.s_addr, + hp->h_length)) { + if (krb_debug) { + printf("Received it\n"); + (void) fflush(stdout); + } + return 1; + } + if (krb_debug) + fprintf(stderr, + "packet not from %lx\n", + (unsigned long)hp->h_addr); + } + if (krb_debug) + fprintf(stderr, "%s: received packet from wrong host! (%lx)\n", + "send_to_kdc(send_rcv)", (unsigned long)from.sin_addr.s_addr); + return 0; +} + +/* * send_to_kdc() sends a message to the Kerberos authentication * server(s) in the given realm and returns the reply message. * The "pkt" argument points to the message to be sent to Kerberos; @@ -75,10 +153,7 @@ static send_recv(); * after several retries */ -send_to_kdc(pkt,rpkt,realm) - KTEXT pkt; - KTEXT rpkt; - char *realm; +int send_to_kdc(KTEXT pkt, KTEXT rpkt, char *realm) { int i, f; int no_host; /* was a kerberos host found? */ @@ -230,86 +305,3 @@ rtn: } return(retval); } - -/* - * try to send out and receive message. - * return 1 on success, 0 on failure - */ - -static send_recv(pkt,rpkt,f,_to,addrs) - KTEXT pkt; - KTEXT rpkt; - int f; - struct sockaddr_in *_to; - struct hostent *addrs; -{ - fd_set readfds; - register struct hostent *hp; - struct sockaddr_in from; - int sin_size; - int numsent; - - if (krb_debug) { - if (_to->sin_family == AF_INET) - printf("Sending message to %s...", - inet_ntoa(_to->sin_addr)); - else - printf("Sending message..."); - (void) fflush(stdout); - } - if ((numsent = sendto(f,(char *)(pkt->dat), pkt->length, 0, - (struct sockaddr *)_to, - S_AD_SZ)) != pkt->length) { - if (krb_debug) - printf("sent only %d/%d\n",numsent, pkt->length); - return 0; - } - if (krb_debug) { - printf("Sent\nWaiting for reply..."); - (void) fflush(stdout); - } - FD_ZERO(&readfds); - FD_SET(f, &readfds); - errno = 0; - /* select - either recv is ready, or timeout */ - /* see if timeout or error or wrong descriptor */ - if (select(f + 1, &readfds, (fd_set *)0, (fd_set *)0, &timeout) < 1 - || !FD_ISSET(f, &readfds)) { - if (krb_debug) { - fprintf(stderr, "select failed: readfds=%x", - readfds); - perror(""); - } - return 0; - } - sin_size = sizeof(from); - if (recvfrom(f, (char *)(rpkt->dat), sizeof(rpkt->dat), 0, - (struct sockaddr *)&from, &sin_size) - < 0) { - if (krb_debug) - perror("recvfrom"); - return 0; - } - if (krb_debug) { - printf("received packet from %s\n", inet_ntoa(from.sin_addr)); - fflush(stdout); - } - for (hp = addrs; hp->h_name != (char *)NULL; hp++) { - if (!bcmp(hp->h_addr, (char *)&from.sin_addr.s_addr, - hp->h_length)) { - if (krb_debug) { - printf("Received it\n"); - (void) fflush(stdout); - } - return 1; - } - if (krb_debug) - fprintf(stderr, - "packet not from %x\n", - hp->h_addr); - } - if (krb_debug) - fprintf(stderr, "%s: received packet from wrong host! (%x)\n", - "send_to_kdc(send_rcv)", from.sin_addr.s_addr); - return 0; -} diff --git a/eBones/krb/sendauth.c b/eBones/krb/sendauth.c index 7d798bb..add71d9 100644 --- a/eBones/krb/sendauth.c +++ b/eBones/krb/sendauth.c @@ -4,13 +4,15 @@ * <Copyright.MIT>. * * from: sendauth.c,v 4.6 90/03/10 23:18:28 jon Exp $ - * $Id: sendauth.c,v 1.2 1994/07/19 19:26:23 g89r4222 Exp $ + * $Id: sendauth.c,v 1.3 1995/07/18 16:39:44 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: sendauth.c,v 1.2 1994/07/19 19:26:23 g89r4222 Exp $"; +"$Id: sendauth.c,v 1.3 1995/07/18 16:39:44 mark Exp $"; #endif lint +#endif #include <krb.h> #include <sys/types.h> @@ -26,10 +28,6 @@ static char rcsid[] = * and make appropriate changes in krb_recvauth.c */ -extern int errno; - -extern char *krb_get_phost(); - /* * This file contains two routines: krb_sendauth() and krb_sendsrv(). * @@ -109,21 +107,10 @@ extern char *krb_get_phost(); * will disappear when krb_sendauth() returns. */ -int -krb_sendauth(options, fd, ticket, service, inst, realm, checksum, - msg_data, cred, schedule, laddr, faddr, version) -long options; /* bit-pattern of options */ -int fd; /* file descriptor to write onto */ -KTEXT ticket; /* where to put ticket (return); or - * supplied in case of KOPT_DONT_MK_REQ */ -char *service, *inst, *realm; /* service name, instance, realm */ -u_long checksum; /* checksum to include in request */ -MSG_DAT *msg_data; /* mutual auth MSG_DAT (return) */ -CREDENTIALS *cred; /* credentials (return) */ -Key_schedule schedule; /* key schedule (return) */ -struct sockaddr_in *laddr; /* local address */ -struct sockaddr_in *faddr; /* address of foreign host on fd */ -char *version; /* version string */ +int krb_sendauth(long options, int fd, KTEXT ticket, char *service, char *inst, + char *realm, u_long checksum, MSG_DAT *msg_data, CREDENTIALS *cred, + des_key_schedule schedule, struct sockaddr_in *laddr, + struct sockaddr_in *faddr, char *version) { int rem, i, cc; char srv_inst[INST_SZ]; @@ -168,7 +155,7 @@ char *version; /* version string */ /* if mutual auth, get credentials so we have service session keys for decryption below */ if (options & KOPT_DO_MUTUAL) - if (cc = krb_get_cred(service, srv_inst, realm, cred)) + if ((cc = krb_get_cred(service, srv_inst, realm, cred))) return(cc); /* zero the buffer */ @@ -211,10 +198,10 @@ char *version; /* version string */ /* ...and decrypt it */ #ifndef NOENCRYPTION - key_sched(cred->session,schedule); + key_sched((des_cblock *)cred->session,schedule); #endif - if (cc = krb_rd_priv(priv_buf,(unsigned long) tkt_len, schedule, - cred->session, faddr, laddr, msg_data)) + if ((cc = krb_rd_priv(priv_buf,(unsigned long) tkt_len, schedule, + cred->session, faddr, laddr, msg_data))) return(cc); /* fetch the (modified) checksum */ @@ -234,10 +221,7 @@ char *version; /* version string */ * krb_sendsvc */ -int -krb_sendsvc(fd, service) -int fd; -char *service; +int krb_sendsvc(int fd, char *service) { /* write the service name length and then the service name to the fd */ diff --git a/eBones/krb/stime.c b/eBones/krb/stime.c index c040374..f70c33d 100644 --- a/eBones/krb/stime.c +++ b/eBones/krb/stime.c @@ -5,13 +5,15 @@ * <Copyright.MIT>. * * from: stime.c,v 4.5 88/11/15 16:58:05 jtkohl Exp $ - * $Id: stime.c,v 1.2 1994/07/19 19:26:25 g89r4222 Exp $ + * $Id: stime.c,v 1.3 1995/07/18 16:39:46 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: stime.c,v 1.2 1994/07/19 19:26:25 g89r4222 Exp $"; +"$Id: stime.c,v 1.3 1995/07/18 16:39:46 mark Exp $"; #endif /* lint */ +#endif #include <sys/time.h> #include <stdio.h> /* for sprintf() */ diff --git a/eBones/krb/tf_shm.c b/eBones/krb/tf_shm.c index f2f97ab..ad6690a 100644 --- a/eBones/krb/tf_shm.c +++ b/eBones/krb/tf_shm.c @@ -7,13 +7,15 @@ * contributed by Dan Kolkowitz (kolk@jessica.stanford.edu). * * from: tf_shm.c,v 4.2 89/10/25 23:26:46 qjb Exp $ - * $Id: tf_shm.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ + * $Id: tf_shm.c,v 1.3 1995/07/18 16:39:48 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: tf_shm.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $"; +"$Id: tf_shm.c,v 1.3 1995/07/18 16:39:48 mark Exp $"; #endif lint +#endif #include <stdio.h> #include <sys/types.h> @@ -26,9 +28,6 @@ static char rcsid[] = #define MAX_BUFF sizeof(des_cblock)*1000 /* room for 1k keys */ -extern int errno; -extern int krb_debug; - /* * krb_create_shmtkt: * @@ -36,9 +35,7 @@ extern int krb_debug; * in the specified filename. */ -int -krb_shm_create(file_name) -char *file_name; +int krb_shm_create(char *file_name) { int retval; int shmid; @@ -136,8 +133,7 @@ int krb_is_diskless() * file pointing to it. */ -int krb_shm_dest(file) -char *file; +int krb_shm_dest(char *file) { int shmid; FILE *sfile; @@ -169,6 +165,3 @@ char *file; } else return(RET_TKFIL); /* XXX */ } - - - diff --git a/eBones/krb/tf_util.c b/eBones/krb/tf_util.c index cb4908e..ef91658 100644 --- a/eBones/krb/tf_util.c +++ b/eBones/krb/tf_util.c @@ -4,15 +4,19 @@ * <Copyright.MIT>. * * from: tf_util.c,v 4.9 90/03/10 19:19:45 jon Exp $ - * $Id: tf_util.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $ + * $Id: tf_util.c,v 1.3 1995/07/18 16:39:50 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: tf_util.c,v 1.1.1.1 1994/09/30 14:50:04 csgr Exp $"; +"$Id: tf_util.c,v 1.3 1995/07/18 16:39:50 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> +#include <string.h> +#include <unistd.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> @@ -29,9 +33,6 @@ static char rcsid[] = #define TF_LCK_RETRY ((unsigned)2) /* seconds to sleep before * retry if ticket file is * locked */ -extern errno; -extern int krb_debug; - #ifdef TKT_SHMEM char *krb_shm_addr = 0; static char *tmp_shm_addr = 0; @@ -53,9 +54,9 @@ char *shmat(); * c. In tf_close, be sure it gets reinitialized to a negative * number. */ -static fd = -1; -static curpos; /* Position in tfbfr */ -static lastpos; /* End of tfbfr */ +static int fd = -1; +static int curpos; /* Position in tfbfr */ +static int lastpos; /* End of tfbfr */ static char tfbfr[BUFSIZ]; /* Buffer for ticket data */ static tf_gets(), tf_read(); @@ -122,8 +123,7 @@ static tf_gets(), tf_read(); * TKT_FIL_LCK - couldn't lock the file, even after a retry */ -tf_init(tf_name, rw) - char *tf_name; +int tf_init(char *tf_name, int rw) { int wflag; uid_t me, getuid(); @@ -259,8 +259,7 @@ tf_init(tf_name, rw) * was longer than ANAME_SZ, TKT_FIL_FMT is returned. */ -tf_get_pname(p) - char *p; +int tf_get_pname(char *p) { if (fd < 0) { if (krb_debug) @@ -282,8 +281,7 @@ tf_get_pname(p) * instance may be null. */ -tf_get_pinst(inst) - char *inst; +int tf_get_pinst(char *inst) { if (fd < 0) { if (krb_debug) @@ -296,6 +294,33 @@ tf_get_pinst(inst) } /* + * tf_close() closes the ticket file and sets "fd" to -1. If "fd" is + * not a valid file descriptor, it just returns. It also clears the + * buffer used to read tickets. + * + * The return value is not defined. + */ + +void tf_close() +{ + if (!(fd < 0)) { +#ifdef TKT_SHMEM + if (shmdt(krb_shm_addr)) { + /* what kind of error? */ + if (krb_debug) + fprintf(stderr, "shmdt 0x%x: errno %d",krb_shm_addr, errno); + } else { + krb_shm_addr = 0; + } +#endif TKT_SHMEM + (void) flock(fd, LOCK_UN); + (void) close(fd); + fd = -1; /* see declaration of fd above */ + } + bzero(tfbfr, sizeof(tfbfr)); +} + +/* * tf_get_cred() reads a CREDENTIALS record from a ticket file and fills * in the given structure "c". It should only be called after tf_init(), * tf_get_pname(), and tf_get_pinst() have been called. If all goes well, @@ -306,8 +331,7 @@ tf_get_pinst(inst) * EOF - end of file encountered */ -tf_get_cred(c) - CREDENTIALS *c; +int tf_get_cred(CREDENTIALS *c) { KTEXT ticket = &c->ticket_st; /* pointer to ticket */ int k_errno; @@ -364,33 +388,6 @@ tf_get_cred(c) } /* - * tf_close() closes the ticket file and sets "fd" to -1. If "fd" is - * not a valid file descriptor, it just returns. It also clears the - * buffer used to read tickets. - * - * The return value is not defined. - */ - -tf_close() -{ - if (!(fd < 0)) { -#ifdef TKT_SHMEM - if (shmdt(krb_shm_addr)) { - /* what kind of error? */ - if (krb_debug) - fprintf(stderr, "shmdt 0x%x: errno %d",krb_shm_addr, errno); - } else { - krb_shm_addr = 0; - } -#endif TKT_SHMEM - (void) flock(fd, LOCK_UN); - (void) close(fd); - fd = -1; /* see declaration of fd above */ - } - bzero(tfbfr, sizeof(tfbfr)); -} - -/* * tf_gets() is an internal routine. It takes a string "s" and a count * "n", and reads from the file until either it has read "n" characters, * or until it reads a null byte. When finished, what has been read exists @@ -408,9 +405,7 @@ tf_close() * file is seriously ill. */ -static -tf_gets(s, n) - register char *s; +static int tf_gets(char *s, int n) { register count; @@ -449,12 +444,9 @@ tf_gets(s, n) * 0 on end of file or read error */ -static -tf_read(s, n) - register char *s; - register n; +static int tf_read(char *s, int n) { - register count; + int count; for (count = n; count > 0; --count) { if (curpos >= sizeof(tfbfr)) { @@ -486,16 +478,8 @@ char *tkt_string(); * called previously, and KFAILURE for anything else that went wrong. */ -tf_save_cred(service, instance, realm, session, lifetime, kvno, - ticket, issue_date) - char *service; /* Service name */ - char *instance; /* Instance */ - char *realm; /* Auth domain */ - C_Block session; /* Session key */ - int lifetime; /* Lifetime */ - int kvno; /* Key version number */ - KTEXT ticket; /* The ticket itself */ - long issue_date; /* The issue time */ +int tf_save_cred(char *service, char *instance, char *realm, + des_cblock session, int lifetime, int kvno, KTEXT ticket, long issue_date) { off_t lseek(); diff --git a/eBones/krb/tkt_string.c b/eBones/krb/tkt_string.c index ba22db8..bbbdbc5 100644 --- a/eBones/krb/tkt_string.c +++ b/eBones/krb/tkt_string.c @@ -5,22 +5,23 @@ * <Copyright.MIT>. * * from: tkt_string.c,v 4.6 89/01/05 12:31:51 raeburn Exp $ - * $Id: tkt_string.c,v 1.2 1994/07/19 19:26:29 g89r4222 Exp $ + * $Id: tkt_string.c,v 1.3 1995/07/18 16:39:52 mark Exp $ */ +#if 0 #ifndef lint static char *rcsid = -"$Id: tkt_string.c,v 1.2 1994/07/19 19:26:29 g89r4222 Exp $"; +"$Id: tkt_string.c,v 1.3 1995/07/18 16:39:52 mark Exp $"; #endif /* lint */ +#endif #include <stdio.h> +#include <stdlib.h> #include <sys/types.h> #include <krb.h> #include <string.h> #include <sys/param.h> -char *getenv(); - /* * This routine is used to generate the name of the file that holds * the user's cache of server tickets and associated session keys. @@ -43,14 +44,14 @@ char *tkt_string() uid_t getuid(); if (!*krb_ticket_string) { - if (env = getenv("KRBTKFILE")) { + if ((env = getenv("KRBTKFILE"))) { (void) strncpy(krb_ticket_string, env, sizeof(krb_ticket_string)-1); krb_ticket_string[sizeof(krb_ticket_string)-1] = '\0'; } else { /* 32 bits of signed integer will always fit in 11 characters (including the sign), so no need to worry about overflow */ - (void) sprintf(krb_ticket_string, "%s%d",TKT_ROOT,getuid()); + (void) sprintf(krb_ticket_string, "%s%ld",TKT_ROOT,getuid()); } } return krb_ticket_string; @@ -67,9 +68,7 @@ char *tkt_string() * and return an undesired ticket file name until this routine is called. */ -void -krb_set_tkt_string(val) -char *val; +void krb_set_tkt_string(char *val) { (void) strncpy(krb_ticket_string, val, sizeof(krb_ticket_string)-1); diff --git a/eBones/krb/util.c b/eBones/krb/util.c index 8e48557..8dca743 100644 --- a/eBones/krb/util.c +++ b/eBones/krb/util.c @@ -6,13 +6,15 @@ * Miscellaneous debug printing utilities * * from: util.c,v 4.8 89/01/17 22:02:08 wesommer Exp $ - * $Id: util.c,v 1.2 1994/07/19 19:26:31 g89r4222 Exp $ + * $Id: util.c,v 1.3 1995/07/18 16:39:54 mark Exp $ */ +#if 0 #ifndef lint static char rcsid[] = -"$Id: util.c,v 1.2 1994/07/19 19:26:31 g89r4222 Exp $"; +"$Id: util.c,v 1.3 1995/07/18 16:39:54 mark Exp $"; #endif lint +#endif #include <krb.h> #include <des.h> @@ -28,14 +30,13 @@ static char rcsid[] = * pname, pinst, prealm, netaddr, flags, cksum, timestamp, session */ -ad_print(x) -AUTH_DAT *x; +void ad_print(AUTH_DAT *x) { struct in_addr in; /* Print the contents of an auth_dat struct. */ in.s_addr = x->address; - printf("\n%s %s %s %s flags %u cksum 0x%X\n\ttkt_tm 0x%X sess_key", + printf("\n%s %s %s %s flags %u cksum 0x%lX\n\ttkt_tm 0x%lX sess_key", x->pname, x->pinst, x->prealm, inet_ntoa(in), x->k_flags, x->checksum, x->time_sec); @@ -43,7 +44,7 @@ AUTH_DAT *x; #ifdef NOENCRYPTION placebo_cblock_print(x->session); #else - des_cblock_print_file(x->session,stdout); + des_cblock_print_file((des_cblock *)x->session,stdout); #endif /* skip reply for now */ } |