diff options
author | markm <markm@FreeBSD.org> | 1997-09-07 07:02:53 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 1997-09-07 07:02:53 +0000 |
commit | cd2a6be22c3f5c010eb7ec63c77cd0699a832567 (patch) | |
tree | 316b7a514809054240510520a7e779098c17795e /contrib/telnet/libtelnet | |
parent | 2075d422d2e14fa0f55c71e4790fd46d0979a7a1 (diff) | |
download | FreeBSD-src-cd2a6be22c3f5c010eb7ec63c77cd0699a832567.zip FreeBSD-src-cd2a6be22c3f5c010eb7ec63c77cd0699a832567.tar.gz |
Bring the FreeBSD changes to the virgin sources.
Diffstat (limited to 'contrib/telnet/libtelnet')
-rw-r--r-- | contrib/telnet/libtelnet/auth-proto.h | 4 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/auth.c | 11 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/enc-proto.h | 17 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/enc_des.c | 30 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/encrypt.c | 36 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/encrypt.h | 2 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/genget.c | 7 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/kerberos.c | 48 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/krb4encpwd.c | 1 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/misc.c | 6 | ||||
-rw-r--r-- | contrib/telnet/libtelnet/spx.c | 1 |
11 files changed, 87 insertions, 76 deletions
diff --git a/contrib/telnet/libtelnet/auth-proto.h b/contrib/telnet/libtelnet/auth-proto.h index 06bba2b..a1e9aa4 100644 --- a/contrib/telnet/libtelnet/auth-proto.h +++ b/contrib/telnet/libtelnet/auth-proto.h @@ -75,6 +75,10 @@ void auth_finished P((Authenticator *, int)); int auth_wait P((char *)); void auth_disable_name P((char *)); void auth_gen_printsub P((unsigned char *, int, unsigned char *, int)); +void auth_name P((unsigned char *, int)); +void auth_printsub P((unsigned char *, int, unsigned char *, int)); +int auth_sendname P((unsigned char *, int)); +void auth_encrypt_user P((char *)); #ifdef KRB4 int kerberos4_init P((Authenticator *, int)); diff --git a/contrib/telnet/libtelnet/auth.c b/contrib/telnet/libtelnet/auth.c index a8b287c..4262b55 100644 --- a/contrib/telnet/libtelnet/auth.c +++ b/contrib/telnet/libtelnet/auth.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)auth.c 8.3 (Berkeley) 5/30/95"; +static const char sccsid[] = "@(#)auth.c 8.3 (Berkeley) 5/30/95"; #endif /* not lint */ /* @@ -64,6 +64,7 @@ static char sccsid[] = "@(#)auth.c 8.3 (Berkeley) 5/30/95"; #include <arpa/telnet.h> #ifdef __STDC__ #include <stdlib.h> +#include <unistd.h> #endif #ifdef NO_STRING_H #include <strings.h> @@ -106,6 +107,9 @@ static unsigned char _auth_send_data[256]; static unsigned char *auth_send_data; static int auth_send_cnt = 0; +int auth_onoff(char *type, int on); +void auth_encrypt_user(char *name); + /* * Authentication types supported. Plese note that these are stored * in priority order, i.e. try the first one first. @@ -500,7 +504,7 @@ auth_is(data, cnt) return; } - if (ap = findauthenticator(data[0], data[1])) { + if ((ap = findauthenticator(data[0], data[1]))) { if (ap->is) (*ap->is)(ap, data+2, cnt-2); } else if (auth_debug_mode) @@ -518,7 +522,7 @@ auth_reply(data, cnt) if (cnt < 2) return; - if (ap = findauthenticator(data[0], data[1])) { + if ((ap = findauthenticator(data[0], data[1]))) { if (ap->reply) (*ap->reply)(ap, data+2, cnt-2); } else if (auth_debug_mode) @@ -531,7 +535,6 @@ auth_name(data, cnt) unsigned char *data; int cnt; { - Authenticator *ap; unsigned char savename[256]; if (cnt < 1) { diff --git a/contrib/telnet/libtelnet/enc-proto.h b/contrib/telnet/libtelnet/enc-proto.h index 2e30908..8e15ffd 100644 --- a/contrib/telnet/libtelnet/enc-proto.h +++ b/contrib/telnet/libtelnet/enc-proto.h @@ -79,11 +79,17 @@ void encrypt_send_end P((void)); void encrypt_wait P((void)); void encrypt_send_support P((void)); void encrypt_send_keyid P((int, unsigned char *, int, int)); +void encrypt_start P((unsigned char *, int)); +void encrypt_end P((void)); +void encrypt_support P((unsigned char *, int)); +void encrypt_request_start P((unsigned char *, int)); +void encrypt_request_end P((void)); +void encrypt_enc_keyid P((unsigned char *, int)); +void encrypt_dec_keyid P((unsigned char *, int)); +void encrypt_printsub P((unsigned char *, int, unsigned char *, int)); int net_write P((unsigned char *, int)); -#ifdef TELENTD -void encrypt_wait P((void)); -#else +#ifndef TELENTD int encrypt_cmd P((int, char **)); void encrypt_display P((void)); #endif @@ -117,9 +123,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/contrib/telnet/libtelnet/enc_des.c b/contrib/telnet/libtelnet/enc_des.c index d6886fd..8e4b9a7 100644 --- a/contrib/telnet/libtelnet/enc_des.c +++ b/contrib/telnet/libtelnet/enc_des.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)enc_des.c 8.3 (Berkeley) 5/30/95"; +static const char sccsid[] = "@(#)enc_des.c 8.3 (Berkeley) 5/30/95"; #endif /* not lint */ #ifdef ENCRYPTION @@ -44,6 +44,8 @@ static char sccsid[] = "@(#)enc_des.c 8.3 (Berkeley) 5/30/95"; #include <stdlib.h> #endif +#include <des.h> +#include <string.h> #include "encrypt.h" #include "key-proto.h" #include "misc-proto.h" @@ -180,7 +182,6 @@ fb64_start(fbp, dir, server) int dir; int server; { - Block b; int x; unsigned char *p; register int state; @@ -215,8 +216,8 @@ fb64_start(fbp, dir, server) /* * Create a random feed and send it over. */ - des_new_random_key(fbp->temp_feed); - des_ecb_encrypt(fbp->temp_feed, fbp->temp_feed, + des_new_random_key((Block *)fbp->temp_feed); + des_ecb_encrypt((Block *)fbp->temp_feed, (Block *)fbp->temp_feed, fbp->krbdes_sched, 1); p = fbp->fb_feed + 3; *p++ = ENCRYPT_IS; @@ -264,9 +265,7 @@ fb64_is(data, cnt, fbp) int cnt; struct fb *fbp; { - int x; unsigned char *p; - Block b; register int state = fbp->state[DIR_DECRYPT-1]; if (cnt-- < 1) @@ -356,9 +355,6 @@ fb64_reply(data, cnt, fbp) int cnt; struct fb *fbp; { - int x; - unsigned char *p; - Block b; register int state = fbp->state[DIR_ENCRYPT-1]; if (cnt-- < 1) @@ -428,10 +424,10 @@ fb64_session(key, server, fbp) fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]); if (fbp->once == 0) { - des_set_random_generator_seed(fbp->krbdes_key); + des_set_random_generator_seed((Block *)fbp->krbdes_key); fbp->once = 1; } - des_key_sched(fbp->krbdes_key, fbp->krbdes_sched); + des_key_sched((Block *)fbp->krbdes_key, fbp->krbdes_sched); /* * Now look to see if krbdes_start() was was waiting for * the key to show up. If so, go ahead an call it now @@ -552,7 +548,7 @@ fb64_stream_iv(seed, stp) memmove((void *)stp->str_iv, (void *)seed, sizeof(Block)); memmove((void *)stp->str_output, (void *)seed, sizeof(Block)); - des_key_sched(stp->str_ikey, stp->str_sched); + des_key_sched((Block *)stp->str_ikey, stp->str_sched); stp->str_index = sizeof(Block); } @@ -563,7 +559,7 @@ fb64_stream_key(key, stp) register struct stinfo *stp; { memmove((void *)stp->str_ikey, (void *)key, sizeof(Block)); - des_key_sched(key, stp->str_sched); + des_key_sched((Block *)key, stp->str_sched); memmove((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block)); @@ -604,7 +600,7 @@ cfb64_encrypt(s, c) while (c-- > 0) { if (index == sizeof(Block)) { Block b; - des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1); + des_ecb_encrypt((Block *)stp->str_output, (Block *)b, stp->str_sched, 1); memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); index = 0; } @@ -638,7 +634,7 @@ cfb64_decrypt(data) index = stp->str_index++; if (index == sizeof(Block)) { Block b; - des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1); + des_ecb_encrypt((Block *)stp->str_output, (Block *)b, stp->str_sched, 1); memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); stp->str_index = 1; /* Next time will be 1 */ index = 0; /* But now use 0 */ @@ -680,7 +676,7 @@ ofb64_encrypt(s, c) while (c-- > 0) { if (index == sizeof(Block)) { Block b; - des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1); + des_ecb_encrypt((Block *)stp->str_feed, (Block *)b, stp->str_sched, 1); memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); index = 0; } @@ -711,7 +707,7 @@ ofb64_decrypt(data) index = stp->str_index++; if (index == sizeof(Block)) { Block b; - des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1); + des_ecb_encrypt((Block *)stp->str_feed, (Block *)b, stp->str_sched, 1); memmove((void *)stp->str_feed, (void *)b, sizeof(Block)); stp->str_index = 1; /* Next time will be 1 */ index = 0; /* But now use 0 */ diff --git a/contrib/telnet/libtelnet/encrypt.c b/contrib/telnet/libtelnet/encrypt.c index 432df0c..41dd5cc 100644 --- a/contrib/telnet/libtelnet/encrypt.c +++ b/contrib/telnet/libtelnet/encrypt.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)encrypt.c 8.2 (Berkeley) 5/30/95"; +static const char sccsid[] = "@(#)encrypt.c 8.2 (Berkeley) 5/30/95"; #endif /* not lint */ /* @@ -58,6 +58,7 @@ static char sccsid[] = "@(#)encrypt.c 8.2 (Berkeley) 5/30/95"; #ifdef ENCRYPTION #define ENCRYPT_NAMES +#include <stdio.h> #include <arpa/telnet.h> #include "encrypt.h" @@ -79,6 +80,18 @@ static char sccsid[] = "@(#)encrypt.c 8.2 (Berkeley) 5/30/95"; void (*encrypt_output) P((unsigned char *, int)); int (*decrypt_input) P((int)); +int EncryptType(char *type, char *mode); +int EncryptStart(char *mode); +int EncryptStop(char *mode); +int EncryptStartInput(void); +int EncryptStartOutput(void); +int EncryptStopInput(void); +int EncryptStopOutput(void); + +int Ambiguous(char **s); +int isprefix(char *s1, char *s2); +char **genget(char *name, char **table, int stlen); + int encrypt_debug_mode = 0; static int decrypt_mode = 0; static int encrypt_mode = 0; @@ -174,6 +187,8 @@ static struct key_info { { { 0 }, 0, DIR_DECRYPT, &decrypt_mode, finddecryption }, }; +static void encrypt_keyid(struct key_info *kp, unsigned char *keyid, int len); + void encrypt_init(name, server) char *name; @@ -248,10 +263,10 @@ EncryptDisable(type, mode) if (isprefix(type, "help") || isprefix(type, "?")) { printf("Usage: encrypt disable <type> [input|output]\n"); encrypt_list_types(); - } else if ((ep = (Encryptions *)genget(type, encryptions, + } else if ((ep = (Encryptions *)genget(type, (char **)encryptions, sizeof(Encryptions))) == 0) { printf("%s: invalid encryption type\n", type); - } else if (Ambiguous(ep)) { + } else if (Ambiguous((char **)ep)) { printf("Ambiguous type '%s'\n", type); } else { if ((mode == 0) || (isprefix(mode, "input") ? 1 : 0)) { @@ -283,10 +298,10 @@ EncryptType(type, mode) if (isprefix(type, "help") || isprefix(type, "?")) { printf("Usage: encrypt type <type> [input|output]\n"); encrypt_list_types(); - } else if ((ep = (Encryptions *)genget(type, encryptions, + } else if ((ep = (Encryptions *)genget(type, (char **)encryptions, sizeof(Encryptions))) == 0) { printf("%s: invalid encryption type\n", type); - } else if (Ambiguous(ep)) { + } else if (Ambiguous((char **)ep)) { printf("Ambiguous type '%s'\n", type); } else { if ((mode == 0) || isprefix(mode, "input")) { @@ -559,7 +574,7 @@ encrypt_is(data, cnt) } else { ret = (*ep->is)(data, cnt); if (encrypt_debug_mode) - printf("(*ep->is)(%x, %d) returned %s(%d)\n", data, cnt, + printf("(*ep->is)(%p, %d) returned %s(%d)\n", data, cnt, (ret < 0) ? "FAIL " : (ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret); } @@ -603,7 +618,7 @@ encrypt_reply(data, cnt) } else { ret = (*ep->reply)(data, cnt); if (encrypt_debug_mode) - printf("(*ep->reply)(%x, %d) returned %s(%d)\n", + printf("(*ep->reply)(%p, %d) returned %s(%d)\n", data, cnt, (ret < 0) ? "FAIL " : (ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret); @@ -641,7 +656,7 @@ encrypt_start(data, cnt) return; } - if (ep = finddecryption(decrypt_mode)) { + if ((ep = finddecryption(decrypt_mode))) { decrypt_input = ep->input; if (encrypt_verbose) printf("[ Input is now decrypted with type %s ]\r\n", @@ -725,6 +740,7 @@ encrypt_request_start(data, cnt) static unsigned char str_keyid[(MAXKEYLEN*2)+5] = { IAC, SB, TELOPT_ENCRYPT }; + void encrypt_enc_keyid(keyid, len) unsigned char *keyid; int len; @@ -732,6 +748,7 @@ encrypt_enc_keyid(keyid, len) encrypt_keyid(&ki[1], keyid, len); } + void encrypt_dec_keyid(keyid, len) unsigned char *keyid; int len; @@ -739,13 +756,13 @@ encrypt_dec_keyid(keyid, len) encrypt_keyid(&ki[0], keyid, len); } + void encrypt_keyid(kp, keyid, len) struct key_info *kp; unsigned char *keyid; int len; { Encryptions *ep; - unsigned char *strp, *cp; int dir = kp->dir; register int ret = 0; @@ -942,7 +959,6 @@ encrypt_send_request_end() void encrypt_wait() { - register int encrypt, decrypt; if (encrypt_debug_mode) printf(">>>%s: in encrypt_wait\r\n", Name); if (!havesessionkey || !(I_SUPPORT_ENCRYPT & remote_supports_decrypt)) diff --git a/contrib/telnet/libtelnet/encrypt.h b/contrib/telnet/libtelnet/encrypt.h index e0ae385..1c942dc 100644 --- a/contrib/telnet/libtelnet/encrypt.h +++ b/contrib/telnet/libtelnet/encrypt.h @@ -62,7 +62,7 @@ typedef unsigned char Block[8]; typedef unsigned char *BlockT; -typedef struct { Block _; } Schedule[16]; +typedef struct { Block __; } Schedule[16]; #define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | \ key[4] | key[5] | key[6] | key[7]) diff --git a/contrib/telnet/libtelnet/genget.c b/contrib/telnet/libtelnet/genget.c index 7be3846..8668db4 100644 --- a/contrib/telnet/libtelnet/genget.c +++ b/contrib/telnet/libtelnet/genget.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95"; +static const char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95"; #endif /* not lint */ @@ -49,7 +49,6 @@ static char sccsid[] = "@(#)genget.c 8.2 (Berkeley) 5/30/95"; isprefix(s1, s2) register char *s1, *s2; { - register int n = 0; char *os1; register char c1, c2; @@ -99,7 +98,7 @@ genget(name, table, stlen) */ int Ambiguous(s) - char *s; + char **s; { - return((char **)s == &ambiguous); + return(s == &ambiguous); } diff --git a/contrib/telnet/libtelnet/kerberos.c b/contrib/telnet/libtelnet/kerberos.c index dbf4956..738a57f 100644 --- a/contrib/telnet/libtelnet/kerberos.c +++ b/contrib/telnet/libtelnet/kerberos.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)kerberos.c 8.3 (Berkeley) 5/30/95"; +static const char sccsid[] = "@(#)kerberos.c 8.3 (Berkeley) 5/30/95"; #endif /* not lint */ /* @@ -75,19 +75,12 @@ 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; static unsigned char str_data[1024] = { IAC, SB, TELOPT_AUTHENTICATION, 0, AUTHTYPE_KERBEROS_V4, }; -static unsigned char str_name[1024] = { IAC, SB, TELOPT_AUTHENTICATION, - TELQUAL_NAME, }; #define KRB_AUTH 0 /* Authentication data follows */ #define KRB_REJECT 1 /* Rejected (reason might follow) */ @@ -102,7 +95,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 */ @@ -167,9 +160,6 @@ kerberos4_send(ap) Authenticator *ap; { KTEXT_ST auth; -#ifdef ENCRYPTION - Block enckey; -#endif /* ENCRYPTION */ char instance[INST_SZ]; char *realm; char *krb_realmofhost(); @@ -187,7 +177,7 @@ kerberos4_send(ap) memset(instance, 0, sizeof(instance)); - if (realm = krb_get_phost(RemoteHostName)) + if ((realm = krb_get_phost(RemoteHostName))) strncpy(instance, realm, sizeof(instance)); instance[sizeof(instance)-1] = '\0'; @@ -198,11 +188,11 @@ kerberos4_send(ap) printf("Kerberos V4: no realm for %s\r\n", RemoteHostName); return(0); } - if (r = krb_mk_req(&auth, KRB_SERVICE_NAME, instance, realm, 0L)) { + if ((r = krb_mk_req(&auth, KRB_SERVICE_NAME, instance, realm, 0L))) { printf("mk_req failed: %s\r\n", krb_err_txt[r]); return(0); } - if (r = krb_get_cred(KRB_SERVICE_NAME, instance, realm, &cred)) { + if ((r = krb_get_cred(KRB_SERVICE_NAME, instance, realm, &cred))) { printf("get_cred failed: %s\r\n", krb_err_txt[r]); return(0); } @@ -226,11 +216,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 +232,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 */ @@ -288,8 +278,8 @@ kerberos4_is(ap, data, cnt) printf("\r\n"); } instance[0] = '*'; instance[1] = 0; - if (r = krb_rd_req(&auth, KRB_SERVICE_NAME, - instance, 0, &adat, "")) { + if ((r = krb_rd_req(&auth, KRB_SERVICE_NAME, + instance, 0, &adat, ""))) { if (auth_debug_mode) printf("Kerberos failed him as %s\r\n", name); Data(ap, KRB_REJECT, (void *)krb_err_txt[r], -1); @@ -327,15 +317,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 +334,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 +342,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 +387,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; diff --git a/contrib/telnet/libtelnet/krb4encpwd.c b/contrib/telnet/libtelnet/krb4encpwd.c index 6148190..cb9523c 100644 --- a/contrib/telnet/libtelnet/krb4encpwd.c +++ b/contrib/telnet/libtelnet/krb4encpwd.c @@ -115,7 +115,6 @@ static AUTH_DAT adat = { 0 }; #ifdef ENCRYPTION static Block session_key = { 0 }; #endif /* ENCRYPTION */ -static Schedule sched; static char challenge[REALM_SZ]; static int diff --git a/contrib/telnet/libtelnet/misc.c b/contrib/telnet/libtelnet/misc.c index 9565900..4f8f8d5 100644 --- a/contrib/telnet/libtelnet/misc.c +++ b/contrib/telnet/libtelnet/misc.c @@ -32,10 +32,14 @@ */ #ifndef lint -static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93"; +static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93"; #endif /* not lint */ +#include <stdio.h> +#include <stdlib.h> #include "misc.h" +#include "auth.h" +#include "encrypt.h" char *RemoteHostName; char *LocalHostName; diff --git a/contrib/telnet/libtelnet/spx.c b/contrib/telnet/libtelnet/spx.c index 86c6197..90c37a4 100644 --- a/contrib/telnet/libtelnet/spx.c +++ b/contrib/telnet/libtelnet/spx.c @@ -101,7 +101,6 @@ static unsigned char str_name[1024] = { IAC, SB, TELOPT_AUTHENTICATION, #ifdef ENCRYPTION static Block session_key = { 0 }; #endif /* ENCRYPTION */ -static Schedule sched; static Block challenge = { 0 }; |