diff options
author | gibbs <gibbs@FreeBSD.org> | 1995-09-14 21:29:08 +0000 |
---|---|---|
committer | gibbs <gibbs@FreeBSD.org> | 1995-09-14 21:29:08 +0000 |
commit | 684e425bda0966dfee94134b89a71a2ca3db6631 (patch) | |
tree | 392b2053f8817590b3bbee251cf1792c43fb7fc2 /secure/lib | |
parent | cf0a73f08e11842132e060354e87dc5c4dcce787 (diff) | |
download | FreeBSD-src-684e425bda0966dfee94134b89a71a2ca3db6631.zip FreeBSD-src-684e425bda0966dfee94134b89a71a2ca3db6631.tar.gz |
Enable kerberosIV authentication/encryption conditionalized on MAKE_EBONES.
Fix up some of the des calls to be compatible with eBones.
Diffstat (limited to 'secure/lib')
-rw-r--r-- | secure/lib/libtelnet/Makefile | 8 | ||||
-rw-r--r-- | secure/lib/libtelnet/enc-proto.h | 5 | ||||
-rw-r--r-- | secure/lib/libtelnet/kerberos.c | 31 |
3 files changed, 15 insertions, 29 deletions
diff --git a/secure/lib/libtelnet/Makefile b/secure/lib/libtelnet/Makefile index 46e4133..829a87a 100644 --- a/secure/lib/libtelnet/Makefile +++ b/secure/lib/libtelnet/Makefile @@ -1,9 +1,5 @@ # From: @(#)Makefile 8.2 (Berkeley) 12/15/93 -# $Id: Makefile,v 1.8 1995/07/24 22:55:35 ache Exp $ - -# This stuff need original libdes to run (new_rnd_key.c module), -# current eBones/des lib don't have it -# Kerberos4 stuff ifdefed by MAKE_KERBEROS (make.conf) because of it +# $Id: Makefile,v 1.9 1995/08/05 19:10:17 ache Exp $ LIB= telnet SRCS= auth.c encrypt.c genget.c getent.c misc.c @@ -15,7 +11,7 @@ CFLAGS+= -DHAS_CGETENT CFLAGS+= -DENCRYPTION -DAUTHENTICATION -.ifdef MAKE_KERBEROS +.ifdef MAKE_EBONES .if exists(/usr/lib/libkrb.a) CFLAGS+= -DKRB4 -I/usr/include/kerberosIV -DDES_ENCRYPTION # KRB4_ENCPWD not yet defined diff --git a/secure/lib/libtelnet/enc-proto.h b/secure/lib/libtelnet/enc-proto.h index 2e30908..0c0d89c 100644 --- a/secure/lib/libtelnet/enc-proto.h +++ b/secure/lib/libtelnet/enc-proto.h @@ -117,9 +117,4 @@ void ofb64_session P((Session_Key *, int)); int ofb64_keyid P((int, unsigned char *, int *)); void ofb64_printsub P((unsigned char *, int, unsigned char *, int)); -int des_new_random_key P((Block)); -void des_set_random_generator_seed P((Block)); -void des_key_sched P((Block, Schedule)); -void des_ecb_encrypt P((Block, Block, Schedule, int)); -int des_string_to_key P((char *, Block)); #endif /* ENCRYPTION */ diff --git a/secure/lib/libtelnet/kerberos.c b/secure/lib/libtelnet/kerberos.c index 33599b9..f0c8b8a 100644 --- a/secure/lib/libtelnet/kerberos.c +++ b/secure/lib/libtelnet/kerberos.c @@ -75,11 +75,6 @@ static char sccsid[] = "@(#)kerberos.c 8.3 (Berkeley) 5/30/95"; #include "misc.h" int kerberos4_cksum P((unsigned char *, int)); -int krb_mk_req P((KTEXT, char *, char *, char *, u_long)); -int krb_rd_req P((KTEXT, char *, char *, u_long, AUTH_DAT *, char *)); -int krb_kntoln P((AUTH_DAT *, char *)); -int krb_get_cred P((char *, char *, char *, CREDENTIALS *)); -int krb_get_lrealm P((char *, int)); int kuserok P((AUTH_DAT *, char *)); extern auth_debug_mode; @@ -102,7 +97,7 @@ static char name[ANAME_SZ]; static AUTH_DAT adat = { 0 }; #ifdef ENCRYPTION static Block session_key = { 0 }; -static Schedule sched; +static des_key_schedule sched; static Block challenge = { 0 }; #endif /* ENCRYPTION */ @@ -226,11 +221,11 @@ kerberos4_send(ap) if ((ap->way & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) { register int i; - des_key_sched(cred.session, sched); - des_init_random_number_generator(cred.session); - des_new_random_key(session_key); - des_ecb_encrypt(session_key, session_key, sched, 0); - des_ecb_encrypt(session_key, challenge, sched, 0); + des_key_sched(&cred.session, sched); + des_init_random_number_generator(&cred.session); + des_new_random_key(&session_key); + des_ecb_encrypt(&session_key, &session_key, sched, 0); + des_ecb_encrypt(&session_key, &challenge, sched, 0); /* * Increment the challenge by 1, and encrypt it for * later comparison. @@ -242,7 +237,7 @@ kerberos4_send(ap) if (x < 256) /* if no overflow, all done */ break; } - des_ecb_encrypt(challenge, challenge, sched, 1); + des_ecb_encrypt(&challenge, &challenge, sched, 1); } #endif /* ENCRYPTION */ @@ -327,15 +322,15 @@ kerberos4_is(ap, data, cnt) * Initialize the random number generator since it's * used later on by the encryption routine. */ - des_init_random_number_generator(session_key); - des_key_sched(session_key, sched); + des_init_random_number_generator(&session_key); + des_key_sched(&session_key, sched); memmove((void *)datablock, (void *)data, sizeof(Block)); /* * Take the received encrypted challenge, and encrypt * it again to get a unique session_key for the * ENCRYPT option. */ - des_ecb_encrypt(datablock, session_key, sched, 1); + des_ecb_encrypt(&datablock, &session_key, sched, 1); skey.type = SK_DES; skey.length = 8; skey.data = session_key; @@ -344,7 +339,7 @@ kerberos4_is(ap, data, cnt) * Now decrypt the received encrypted challenge, * increment by one, re-encrypt it and send it back. */ - des_ecb_encrypt(datablock, challenge, sched, 0); + des_ecb_encrypt(&datablock, &challenge, sched, 0); for (r = 7; r >= 0; r--) { register int t; t = (unsigned int)challenge[r] + 1; @@ -352,7 +347,7 @@ kerberos4_is(ap, data, cnt) if (t < 256) /* if no overflow, all done */ break; } - des_ecb_encrypt(challenge, challenge, sched, 1); + des_ecb_encrypt(&challenge, &challenge, sched, 1); Data(ap, KRB_RESPONSE, (void *)challenge, sizeof(challenge)); #endif /* ENCRYPTION */ break; @@ -397,7 +392,7 @@ kerberos4_reply(ap, data, cnt) #else /* ENCRYPTION */ Data(ap, KRB_CHALLENGE, (void *)session_key, sizeof(session_key)); - des_ecb_encrypt(session_key, session_key, sched, 1); + des_ecb_encrypt(&session_key, &session_key, sched, 1); skey.type = SK_DES; skey.length = 8; skey.data = session_key; |