CHANGES TO TELNET FUNCTIONALITY FOR C-KERMIT 7.0 AND KERMIT 95 1.1.18 Jeffrey Altman The Kermit Project Columbia University Most recent update: Fri Dec 31 14:20:57 1999 CONTENTS 1. INTRODUCTION 2. SUPPORTED TELNET OPTIONS 3. TELNET OPTION MANAGEMENT 4. TELNET COMMAND SUMMARY 5. DIAGNOSING AND FIXING PROBLEMS 1. INTRODUCTION Not so long ago the requirements for a Telnet client were fairly minimal: support echo management, window size notification, terminal type negotiation, and perhaps some environment variables. None of the negotiations were time-sensitive and none were required in any particular order. Everyone was happy as long as the specifications were followed and infinite negotiation loops were avoided. Then came the advanced telnet options that began to provide for mutual authentication, data encryption, transport layer security, and synchronization of remote processes. These make the original Telnet paradigm seem extremely simple by comparison. The new Telnet protocols have order and timing dependencies that require increased sophistication from both client and server. Prior to C-Kermit 7.0 and K95 1.1.18, Kermit implemented Telnet protocol by opening a connection to the host and then transmitting the options that it supported. What happened next was determined by how the connection was being used. If the user told Kermit to: TELNET then, immediately after the telnet options were transmitted, the terminal emulator started and began reading the incoming data. The rest of the Telnet protocol implementation was purely reactive (with minor exceptions such as window-size changes): when a Telnet option was received it would be processed and a response sent if necessary. However, if the user said: SET HOST then, after the telnet options were transmitted, Kermit would wait for the next command from the user. If a CONNECT command was next the behavior would be the same as for TELNET . However, if the script was made up of a series of INPUT and OUTPUT commands the incoming telnet option negotiations would be processed while waiting for INPUT. This was adequate when there were no ordering or timing requirements for the Telnet negotiations. But with the introduction of authentication, encryption, transport layer security, and the Kermit option for managing the states of the Kermit server on both the workstation and host (see iksd.txt) it is necessary for Telnet negotiations to take place before the TELNET command enters the terminal emulator or the SET HOST command completes and allows any subsequent INPUT and OUTPUT commands to execute. The new timing requirements are as follows: . START_TLS (Transport Layer Security) must be negotiated or refused before any other option. . AUTH (Authentication) must be negotiated or refused before ENCRYPT. . ENCRYPT (Encryption) must be negotiated/refused in both directions before it is safe to transmit any data that might be considered private, including Telnet options such as terminal type, location, xdisplay, or environment variables. . KERMIT (Internet Kermit Service) must wait for a response to any request for the peer to either turn on or off the Kermit Server capabilities in order to facilitate automatic uploading or downloading of files or processing of remote commands. The result is that Kermit must now, to the best of its ability, attempt to process all of the above options before TELNET enters connect mode or SET HOST completes to process the next command. It may therefore appear that Kermit is taking longer to make a connection to a host because it does take longer for the CONNECT mode to be entered or for the first script command to be executed. 2. SUPPORTED TELNET OPTIONS BINARY (Binary Transmission Mode) ECHO (Echo Mode) SUPPRESS GO AHEAD (Suppress Go Ahead commands) SEND LOCATION (Send Terminal Location) TERMINAL TYPE (Negotiate Terminal Type) NAWS (Negotiate About Window Size) XDISPLOC AUTHENTICATION ENCRYPTION NEW ENVIRONMENT START TLS KERMIT FORWARD X 3. TELNET OPTION MANAGEMENT One of the benefits of processing all the Telnet options during the SET HOST/TELNET command is that it is now possible to set policy requirements for a valid connection. This is especially true when the connection must be authenticated and encrypted or else fail. This is done with the new command: SET TELOPT [ ]