Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src Update from trunk:



details:   https://anonhg.NetBSD.org/src/rev/f85246649f7a
branches:  netbsd-1-5
changeset: 488219:f85246649f7a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Jun 22 07:09:02 2000 +0000

description:
Update from trunk:
Bring the telnet situation back into better shape.  Specifically,
pull in just about all of the differences from the crypto-us telnet
suite (which includes Kerberos 4 and connection encryption support).
Also bring in the Kerberos 5 support from the Heimdal telnet, and
frob a little so that it can work with the non-Heimdal telnet suite.

There is still some work left to do, specifically:
- Add Heimdal's ticket forwarding support to the Berkeley Kerberos 4
  module.
- Add connection encryption support to the Heimdal Kerberos 5
  module.  Hints on this can be taken from the MIT Kerberos 5
  module which still exists in crypto-us.

However, even with the shortcomings listed above, this is a
better situation than using the stock Heimdal telnet suite,
which does not understand the IPSec policy stuff, and is also
based on much older code which contains bugs that we have already
fixed in the NetBSD sources.

diffstat:

 lib/libtelnet/Makefile     |   18 +
 lib/libtelnet/auth.c       |   33 +-
 lib/libtelnet/enc-proto.h  |  145 ++++++
 lib/libtelnet/enc_des.c    |  730 ++++++++++++++++++++++++++++++++++
 lib/libtelnet/encrypt.c    |  957 ++++++++++++++++++++++++++++++++++++++++++++-
 lib/libtelnet/encrypt.h    |   51 ++-
 lib/libtelnet/forward.c    |   71 +++
 lib/libtelnet/kerberos.c   |  564 ++++++++++++++++++++++++++
 lib/libtelnet/kerberos5.c  |  688 ++++++++++++++++++++++++++++++++
 lib/libtelnet/key-proto.h  |   68 +++
 lib/libtelnet/krb4encpwd.c |  455 +++++++++++++++++++++
 lib/libtelnet/misc.c       |    9 +-
 lib/libtelnet/spx.c        |  596 ++++++++++++++++++++++++++++
 libexec/telnetd/Makefile   |   25 +
 libexec/telnetd/authenc.c  |   15 +-
 libexec/telnetd/ext.h      |   10 +-
 libexec/telnetd/state.c    |  125 +++++-
 libexec/telnetd/telnetd.c  |   98 ++++-
 libexec/telnetd/termstat.c |   27 +-
 libexec/telnetd/utility.c  |  150 ++++++-
 usr.bin/telnet/Makefile    |   62 ++
 usr.bin/telnet/authenc.c   |   15 +-
 usr.bin/telnet/commands.c  |  174 +++++++-
 usr.bin/telnet/externs.h   |    8 +-
 usr.bin/telnet/main.c      |   18 +-
 usr.bin/telnet/network.c   |    8 +-
 usr.bin/telnet/ring.c      |   52 ++-
 usr.bin/telnet/ring.h      |   11 +-
 usr.bin/telnet/telnet.c    |  114 +++++-
 usr.bin/telnet/terminal.c  |   26 +-
 usr.bin/telnet/utilities.c |   85 +++-
 31 files changed, 5334 insertions(+), 74 deletions(-)

diffs (truncated from 6393 to 300 lines):

diff -r 5f789a786ae4 -r f85246649f7a lib/libtelnet/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libtelnet/Makefile    Thu Jun 22 07:09:02 2000 +0000
@@ -0,0 +1,18 @@
+#      from: @(#)Makefile      8.2 (Berkeley) 12/15/93
+#      $NetBSD: Makefile,v 1.10.2.2 2000/06/22 07:09:02 thorpej Exp $
+
+LIB=   telnet
+SRCS=  auth.c encrypt.c genget.c getent.c misc.c
+
+SRCS+= enc_des.c kerberos.c
+SRCS+= kerberos5.c
+
+CPPFLAGS+= -DHAS_CGETENT
+CPPFLAGS+= -DENCRYPTION -DAUTHENTICATION
+CPPFLAGS+= -DKRB4 -DDES_ENCRYPTION
+CPPFLAGS+= -DKRB5
+CPPFLAGS+= -I${DESTDIR}/usr/include/krb5
+CPPFLAGS+= -I${DESTDIR}/usr/include/kerberosIV
+CPPFLAGS+= -I${.CURDIR}
+
+.include <bsd.lib.mk>
diff -r 5f789a786ae4 -r f85246649f7a lib/libtelnet/auth.c
--- a/lib/libtelnet/auth.c      Thu Jun 22 06:59:53 2000 +0000
+++ b/lib/libtelnet/auth.c      Thu Jun 22 07:09:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: auth.c,v 1.10 2000/02/01 22:29:27 thorpej Exp $        */
+/*     $NetBSD: auth.c,v 1.10.4.1 2000/06/22 07:09:02 thorpej Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)auth.c     8.3 (Berkeley) 5/30/95"
 #else
-__RCSID("$NetBSD: auth.c,v 1.10 2000/02/01 22:29:27 thorpej Exp $");
+__RCSID("$NetBSD: auth.c,v 1.10.4.1 2000/06/22 07:09:02 thorpej Exp $");
 #endif
 #endif /* not lint */
 
@@ -71,6 +71,7 @@
 #include <arpa/telnet.h>
 #ifdef __STDC__
 #include <stdlib.h>
+#include <unistd.h>
 #endif
 #ifdef NO_STRING_H
 #include <strings.h>
@@ -113,6 +114,8 @@
 static unsigned char   *auth_send_data;
 static int     auth_send_cnt = 0;
 
+static void auth_intr P((int));
+
 /*
  * Authentication types supported.  Plese note that these are stored
  * in priority order, i.e. try the first one first.
@@ -135,6 +138,15 @@
                                spx_printsub },
 #endif
 #ifdef KRB5
+# ifdef        ENCRYPTION
+       { AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL,
+                               kerberos5_init,
+                               kerberos5_send,
+                               kerberos5_is,
+                               kerberos5_reply,
+                               kerberos5_status,
+                               kerberos5_printsub },
+# endif        /* ENCRYPTION */
        { AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
                                kerberos5_init,
                                kerberos5_send,
@@ -144,6 +156,15 @@
                                kerberos5_printsub },
 #endif
 #ifdef KRB4
+# ifdef        ENCRYPTION
+       { AUTHTYPE_KERBEROS_V4, AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL,
+                               kerberos4_init,
+                               kerberos4_send,
+                               kerberos4_is,
+                               kerberos4_reply,
+                               kerberos4_status,
+                               kerberos4_printsub },
+# endif        /* ENCRYPTION */
        { AUTHTYPE_KERBEROS_V4, AUTH_WHO_CLIENT|AUTH_HOW_ONE_WAY,
                                kerberos4_init,
                                kerberos4_send,
@@ -312,7 +333,8 @@
 }
 
        int
-auth_status()
+auth_status(s)
+       char *s;
 {
        Authenticator *ap;
        int i, mask;
@@ -489,7 +511,7 @@
                return;
        }
 
-       if (ap = findauthenticator(data[0], data[1])) {
+       if ((ap = findauthenticator(data[0], data[1])) != NULL) {
                if (ap->is)
                        (*ap->is)(ap, data+2, cnt-2);
        } else if (auth_debug_mode)
@@ -507,7 +529,7 @@
        if (cnt < 2)
                return;
 
-       if (ap = findauthenticator(data[0], data[1])) {
+       if ((ap = findauthenticator(data[0], data[1])) != NULL) {
                if (ap->reply)
                        (*ap->reply)(ap, data+2, cnt-2);
        } else if (auth_debug_mode)
@@ -520,7 +542,6 @@
        unsigned char *data;
        int cnt;
 {
-       Authenticator *ap;
        unsigned char savename[256];
 
        if (cnt < 1) {
diff -r 5f789a786ae4 -r f85246649f7a lib/libtelnet/enc-proto.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libtelnet/enc-proto.h Thu Jun 22 07:09:02 2000 +0000
@@ -0,0 +1,145 @@
+/*     $NetBSD: enc-proto.h,v 1.4.2.2 2000/06/22 07:09:02 thorpej Exp $        */
+
+/*-
+ * Copyright (c) 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     from: @(#)enc-proto.h   8.1 (Berkeley) 6/4/93
+ */
+
+/*
+ * Copyright (C) 1990 by the Massachusetts Institute of Technology
+ *
+ * Export of this software from the United States of America is assumed
+ * to require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission.  M.I.T. makes no representations about the suitability of
+ * this software for any purpose.  It is provided "as is" without express
+ * or implied warranty.
+ */
+
+#ifdef ENCRYPTION
+#include <sys/cdefs.h>
+#define P __P
+
+Encryptions *findencryption P((int));
+Encryptions *finddecryption P((int));
+void encrypt_init P((const char *, int));
+void encrypt_list_types P((void));
+int EncryptEnable P((char *, char *));
+int EncryptDisable P((char *, char *));
+int EncryptType P((char *, char *));
+int EncryptStart P((char *));
+int EncryptStartInput P((void));
+int EncryptStartOutput P((void));
+int EncryptStop P((char *));
+int EncryptStopInput P((void));
+int EncryptStopOutput P((void));
+int EncryptStatus P((void));
+void encrypt_send_support P((void));
+int EncryptDebug P((int));
+int EncryptVerbose P((int));
+int EncryptAutoEnc P((int));
+int EncryptAutoDec P((int));
+void encrypt_support P((unsigned char *, int));
+void encrypt_is P((unsigned char *, int));
+void encrypt_reply P((unsigned char *, int));
+void encrypt_start P((unsigned char *, int));
+void encrypt_session_key P((Session_Key *, int));
+void encrypt_end P((void));
+void encrypt_request_end P((void));
+void encrypt_request_start P((unsigned char *, int));
+void encrypt_enc_keyid P((unsigned char *, int));
+void encrypt_dec_keyid P((unsigned char *, int));
+struct key_info;
+void encrypt_keyid P((struct key_info *, unsigned char *, int));
+void encrypt_send_keyid P((int, unsigned char *, int, int));
+void encrypt_auto P((int));
+void decrypt_auto P((int));
+void encrypt_start_output P((int));
+void encrypt_send_end P((void));
+void encrypt_send_request_start P((void));
+void encrypt_send_request_end P((void));
+void encrypt_wait P((void));
+void encrypt_debug P((int));
+void encrypt_gen_printsub P((unsigned char *, int, unsigned char *, int ));
+void encrypt_printsub P((unsigned char *, int, unsigned char *, int ));
+
+#ifdef TELENTD
+void encrypt_wait P((void));
+#else
+void printsub P((int, unsigned char *, int));
+int encrypt_cmd P((int, char **));
+void encrypt_display P((void));
+#endif
+
+void krbdes_encrypt P((unsigned char *, int));
+int krbdes_decrypt P((int));
+int krbdes_is P((unsigned char *, int));
+int krbdes_reply P((unsigned char *, int));
+void krbdes_init P((int));
+int krbdes_start P((int, int));
+void krbdes_session P((Session_Key *, int));
+void krbdes_printsub P((unsigned char *, int, unsigned char *, int));
+
+void cfb64_encrypt P((unsigned char *, int));
+int cfb64_decrypt P((int));
+void cfb64_init P((int));
+int cfb64_start P((int, int));
+int cfb64_is P((unsigned char *, int));
+int cfb64_reply P((unsigned char *, int));
+void cfb64_session P((Session_Key *, int));
+int cfb64_keyid P((int, unsigned char *, int *));
+void cfb64_printsub P((unsigned char *, int, unsigned char *, int));
+
+void ofb64_encrypt P((unsigned char *, int));
+int ofb64_decrypt P((int));
+void ofb64_init P((int));
+int ofb64_start P((int, int));
+int ofb64_is P((unsigned char *, int));
+int ofb64_reply P((unsigned char *, int));
+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));
+
+void fb64_printsub P((unsigned char *, int, unsigned char *, int,
+    unsigned char *));
+
+#endif /* ENCRYPTION */
diff -r 5f789a786ae4 -r f85246649f7a lib/libtelnet/enc_des.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libtelnet/enc_des.c   Thu Jun 22 07:09:02 2000 +0000
@@ -0,0 +1,730 @@
+/*     $NetBSD: enc_des.c,v 1.4.2.2 2000/06/22 07:09:02 thorpej Exp $  */
+
+/*-
+ * Copyright (c) 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *



Home | Main Index | Thread Index | Old Index