-# @(#)Makefile 5.1 (Berkeley) %G%
+# @(#)Makefile 5.2 (Berkeley) %G%
#
# TERMCAP Define this if your system is termcap based,
# otherwise a terminfo based system is assumed.
#
PROG= telnet
CFLAGS+=-DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO
+#CFLAGS+=-DTERMCAP -DSRCRT -DKLUDGELINEMODE -DUSE_TERMIO -DKERBEROS
LDADD= -ltermcap
+#LDADD= -ltermcap -ldes -lkrb
DPADD= ${LIBTERMCAP}
SRCS= commands.c main.c network.c ring.c sys_bsd.c telnet.c terminal.c \
*/
#ifndef lint
-static char sccsid[] = "@(#)telnet.c 5.48 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnet.c 5.49 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
case TELOPT_AUTHENTICATION:
if ((subbuffer[1] & 0xff) == TELQUAL_SEND) {
register char *cp = &subbuffer[2];
+ char tmp[256];
int dokrb4 = 0, unknowntypes = 0, noresponse = 1;
while (cp < subend) {
if (*ucp == IAC)
space++;
}
- if (NETROOM() < 6 + 1 + strlen(remotename) + 2 +
+ if (NETROOM() < 6 + 1 + 2 +
space + 2) {
fprintf(stderr,
"no room to send V4 ticket/authenticator\n");
exit(1);
} else {
#ifdef notdef
- printring(&netoring, "%c%c%c%c%c%c%c%s", IAC, SB,
+ printring(&netoring, "%c%c%c%c%c%c", IAC, SB,
TELOPT_AUTHENTICATION,
TELQUAL_IS, TELQUAL_AUTHTYPE_KERBEROS,
- TELQUAL_AUTHTYPE_KERBEROS_V4,
- strlen(remotename),
- remotename);
- sprintf(tmp, "%c%c%c%c%s%c%c", TELOPT_AUTHENTICATION,
+ TELQUAL_AUTHTYPE_KERBEROS_V4);
+ sprintf(tmp, "%c%c%c%c%c%c", TELOPT_AUTHENTICATION,
TELQUAL_IS, TELQUAL_AUTHTYPE_KERBEROS,
- TELQUAL_AUTHTYPE_KERBEROS_V4,
- remotename, IAC, SE);
+ TELQUAL_AUTHTYPE_KERBEROS_V4, IAC, SE);
#else
- printring(&netoring, "%c%c%c%c%c%c%s", IAC, SB,
+ printring(&netoring, "%c%c%c%c%c", IAC, SB,
TELOPT_AUTHENTICATION,
TELQUAL_IS,
- TELQUAL_AUTHTYPE_KERBEROS_V4,
- strlen(remotename),
- remotename);
- sprintf(tmp, "%c%c%c%s%c%c", TELOPT_AUTHENTICATION,
+ TELQUAL_AUTHTYPE_KERBEROS_V4);
+ sprintf(tmp, "%c%c%c%c%c", TELOPT_AUTHENTICATION,
TELQUAL_IS,
- TELQUAL_AUTHTYPE_KERBEROS_V4,
- remotename, IAC, SE);
+ TELQUAL_AUTHTYPE_KERBEROS_V4, IAC, SE);
#endif
- printsub(">", tmp, 4+strlen(remotename)+2-2-2);
+ printsub(">", tmp, 4+2-2-2);
ring_supply_bindata(&netoring,
(char *)authent_st.dat, authent_st.length, IAC);
printring(&netoring, "%c%c", IAC, SE);
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
*
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms are permitted
+ * provided that: (1) source distributions retain this entire copyright
+ * notice and comment, and (2) distributions including binaries display
+ * the following acknowledgement: ``This product includes software
+ * developed by the University of California, Berkeley and its contributors''
+ * in the documentation or other materials provided with the distribution
+ * and in all advertising materials mentioning features or use of this
+ * software. 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef lint
-static char sccsid[] = "@(#)utilities.c 1.17 (Berkeley) %G%";
+static char sccsid[] = "@(#)utilities.c 1.17 (Berkeley) 6/1/90";
#endif /* not lint */
#define TELOPTS
char *slcnames[] = { SLC_NAMES };
+#ifdef KERBEROS
+static char *authtypes[3] = { "NONE", "PRIVATE", "KERBEROS" };
+#else
+static char *authtypes[2] = { "NONE", "PRIVATE" };
+#endif
+
void
printsub(direction, pointer, length)
char direction; /* '<' or '>' */
fprintf(NetTrace, " ?%d?", pointer[i]);
break;
+#ifdef KERBEROS
+ case TELOPT_AUTHENTICATION:
+ fprintf(NetTrace, "Authentication information ");
+ switch (pointer[1]) {
+ case TELQUAL_IS:
+ switch (pointer[2]) {
+ case TELQUAL_AUTHTYPE_NONE:
+ case TELQUAL_AUTHTYPE_PRIVATE:
+ case TELQUAL_AUTHTYPE_KERBEROS:
+
+ fprintf(NetTrace, "is type %s\r\n", authtypes[pointer[2]]);
+ break;
+ default:
+ fprintf(NetTrace, "is type unknown\r\n");
+ break;
+ }
+
+ case TELQUAL_SEND:
+ {
+ int idx = 2;
+ fprintf(NetTrace, "- request to send, types");
+ for (idx = 2; idx < length - 1; idx++)
+ switch (pointer[idx]) {
+ case TELQUAL_AUTHTYPE_NONE:
+ case TELQUAL_AUTHTYPE_PRIVATE:
+ case TELQUAL_AUTHTYPE_KERBEROS:
+ fprintf(NetTrace, " %s",
+ authtypes[pointer[idx]]);
+ break;
+ default:
+ fprintf(NetTrace, " <unknown %u>",
+ pointer[idx]);
+ break;
+ }
+ fprintf(NetTrace, "\r\n");
+ }
+ break;
+
+ default:
+ fprintf(NetTrace, " - unknown qualifier %d (0x%x).\r\n",
+ pointer[1], pointer[1]);
+ }
+ break;
+#endif /* KERBEROS */
+
case TELOPT_LINEMODE:
fprintf(NetTrace, "LINEMODE ");
if (length < 2) {