home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / archives / ck9196.zip / security.txt < prev    next >
Text File  |  2000-01-02  |  109KB  |  2,675 lines

  1.  
  2. SECURITY FEATURES FOR AUTHENTICATION AND ENCRYPTION OF TCP/IP CONNECTIONS
  3. IN C-KERMIT 7.0 AND KERMIT 95 1.1.18
  4.  
  5. 31 December 1999
  6.  
  7. CONTENTS
  8.  
  9.     1. INTRODUCTION
  10.     2. DISCLAIMERS
  11.     3. AVAILABILITY
  12.     3.1  Authentication and Encryption in Kermit 95
  13.     3.1.1  Kerberos in Kermit 95
  14.     3.1.2  Secure Remote Password (SRP) in Kermit 95
  15.     3.1.3  NTLM in Kermit 95
  16.     3.1.4  OpenSSL support for SSLv3 and TLSv1 in Kermit 95
  17.     3.2  Authentication and Encryption in C-Kermit
  18.     3.2.1  Kerberos in C-Kermit
  19.     3.2.2  Secure Remote Password (SRP) in C-Kermit
  20.     3.2.3  OpenSSL support for SSLv3 and TLSv1 in C-Kermit
  21.     3.2.4  Shadow Passwords in C-Kermit
  22.     3.2.5  Pluggable Authentication Modules (PAM) in C-Kermit
  23.     4. GLOSSARY
  24.     5. AUTHENTICATION PROTOCOL OVERVIEWS
  25.     5.1 KERBEROS
  26.     5.2 SECURE REMOTE PASSWORD (SRP)
  27.     5.3 NT LAN MANAGER (NTLM)
  28.     5.4 SSLv3 and TLSv1
  29.     6. AUTHENTICATION AND ENCRYPTION COMMANDS
  30.     6.1. TELNET-Related Commands
  31.     6.2. The SET AUTHENTICATION Command
  32.     6.2.1. Kerberos settings
  33.     6.2.2. SRP settings
  34.     6.2.3. SSL and TLS settings
  35.     6.3. The AUTHENTICATE Command
  36.     7. EFFECTS OF ENCRYPTION ON FILE TRANSFER PERFORMANCE
  37.     8. MULTI-HOMED HOSTS AND NETWORK ADDRESS TRANSLATORS
  38.     9. OTHER NOTES
  39.    10. VARIABLES
  40.    10.1 GENERAL AUTHENTICATION VARIABLES
  41.    10.2 KERBEROS VARIABLES
  42.    10.3 SSL/TLS VARIABLES
  43.    11. FUNCTIONS
  44.    12. SCRIPTING HINTS
  45.    12.1. Kerberos Autoget
  46.    12.2. Autodestruction of Kerberos credentials
  47.    12.3. Automated Prompting for Usernames
  48.    12.4. Password Inclusion in Script Files
  49.    12.5  Using Kermit Scripts to Produce Secure Telnet Services
  50.    13. USING OTHER SECURITY METHODS WITH KERMIT
  51.    13.1  Implementing other security methods for Kermit 95
  52.    14. AN INTRODUCTION TO CERTIFICATES AND CERTIFICATE AUTHORITIES WITH OPENSSL
  53.    14.1  What Are Certificates, Private Keys, CSRs, CAs, and CRLs?
  54.    14.2  RSA Certificates v. DSA Certificates
  55.    14.3  Should You Be Your own Certificate Authority?
  56.    14.4  Generating a DSA CA (self-signed) certificate
  57.    14.5  Generating a DSA CSR
  58.    14.6  Generating a RSA CA (self-signed) certificate
  59.    14.7  Generating a RSA CSR
  60.    14.8  Signing a CSR with your CA certificate
  61.    14.9  Revoking a Certificate
  62.    14.10 Generating a CRL
  63.  
  64.  
  65. 1. INTRODUCTION
  66.  
  67.   This document describes Kerberos(TM), Secure Remote Password (SRP)(TM)
  68.   protocol, Secure Sockets Layer (SSL)/Transport Layer Security (TLS), and
  69.   other security implementations in, or to be used with, current or
  70.   forthcoming releases of Kermit software.  All information presented here
  71.   is preliminary and subject to review, change, or withdrawal prior to final
  72.   release.  NOTE: The terms "Windows 95" and "Windows 9x" in this document
  73.   refer to both Windows 95 and Windows 98; the term "Windows NT" refers to
  74.   Windows NT 3.51 and later and to Windows 2000.
  75.  
  76. Security is a hot topic on the Internet, and security methods abound.  Secure
  77. connection methods are supported indirectly by the methods described in
  78. "Supplement to 'Using C-Kermit', Second Edition", file ckermit2.txt, Section
  79. 2.7.4.  This document describes authentication methods that can be built into
  80. Kermit 95 and C-Kermit.  Presently these are: Kerberos, Secure Remote Password
  81. (SRP), Secure Sockets Layer(SSL)/Transport Layer Security(TLS), and Microsoft
  82. NT LAN Manager (NTLM).
  83.  
  84. A secure connection is one that provides:
  85.  
  86.  . Authentication of the user to the host/service without the transmission
  87.    of the user's password;
  88.  
  89.  . Authentication of the host to the user; and:
  90.  
  91.  . A shared secret that can be used with an encryption algorithm to ensure
  92.    the data transmitted over the connection is understood by only the
  93.    client and host.
  94.  
  95. C-Kermit and Kermit 95 are capable of creating and accepting secure
  96. connections via a variety of methods:
  97.  
  98.  . Incoming and outgoing secure connections may be established using Telnet
  99.    protocol coupled with Kerberos(TM), Secure Remote Password (SRP)(TM),
  100.    Secure Sockets Layer (SSL)/Transport Layer Security (TLS), and Microsoft
  101.    NTLM.
  102.  
  103.  . Outgoing secure connections may be established using Rlogin protocol
  104.    coupled with Kerberos (TM).
  105.  
  106.  . Incoming and outgoing secure connections may be established using
  107.    Secure Sockets Layer (SSL)/Transport Layer Security (TLS) alone.
  108.  
  109. 1.1. Kerberos
  110.  
  111. Kerberos(TM) is a method, developed at Massachusetts Institute of Technology,
  112. by which two parties communicating over a TCP/IP connection can authenticate
  113. each other through a trusted third party without sending passwords or
  114. encryption keys in clear text over the network.  Kerberos protocols are
  115. defined in Internet RFCs 1510, 1964, and others.  You can read more about
  116. Kerberos at:
  117.  
  118.   http://web.mit.edu/kerberos/www/
  119.   http://nii.isi.edu/info/kerberos/
  120.   http://nii.isi.edu/publications/kerberos-neuman-tso.html
  121.  
  122. There are, in fact, two Kerberos protocols: Kerberos IV (4) and Kerberos V
  123. (5), the latter being the more flexible and secure protocol.  The two are
  124. totally separate and incompatible.  Any given site might support neither,
  125. either one, or both.
  126.  
  127. When both the client and server support the same version of Kerberos (4 or 5),
  128. then Kerberos authentication with or without encryption can be negotiated.
  129.  
  130. A "Kerberized" version of Kermit can make a connection to a non-Kerberized
  131. host, and a non-Kerberized host can accept a connection from a Kerberized
  132. version of Kermit, as long as neither side is configured to require Kerberos
  133. authentication.
  134.  
  135. 1.2. SRP
  136.  
  137. Secure Remote Password (SRP)(TM) protocol is a method, developed at Stanford
  138. University, by which two parties communicating over a TCP/IP connection can
  139. authenticate each other in a secure manner through a Zero Knowledge
  140. Identification system.  SRP protocols have not yet been accepted as RFCs.
  141. You can read more about SRP at:
  142.  
  143.   http://srp.stanford.edu/srp/
  144.  
  145. Once authentication has been achieved with either Kerberos or SRP, a shared
  146. secret is available which can be used to establish an encrypted session.
  147.  
  148. 1.3. NTLM
  149.  
  150. NT Lan Manager (NTLM) authentication is only implemented in Kermit 95.
  151. Its only use is to authenticate Kermit 95 to Microsoft's NT Services for
  152. Unix Telnetd.  NTLM does not negotiate a shared secret and therefore
  153. cannot be used to establish encrypted sessions.  Therefore, connections
  154. made with NTLM should not be considered secure.
  155.  
  156. 1.4. Encryption
  157.  
  158. Export of encryption software or algorithms is regulated by United States law
  159. (see Section 2).  United States and Canadian residents may contact the Kermit
  160. Project for encryption modules that can be used to provide secure
  161. communications using one of the following encryption algorithms via the Telnet
  162. Encryption Option:
  163.  
  164.    cast128_cfb64   cast5_40_cfb64   des_cfb64   des3_cfb64
  165.    cast128_ofb64   cast5_40_ofb64   des_ofb64   des3_ofb64
  166.  
  167. Netscape's Secure Sockets Layer (SSL) and its IETF-approved successor,
  168. Transport Layer Security (TLS), provide for authentication and encryption of
  169. TCP/IP communications using a combination of public key and symmetric
  170. cryptographic algorithms.  Authentication of the server (and optionally the
  171. client) is performed by exchanging ITU-T X.509 certificate chains (see Section
  172. 14 below), which are then verified by the receiver.  Unlike raw public keys,
  173. X.509 certificates may be revoked by issuing a certificate revocation list
  174. (CRL) which is to be checked by the receiver during verification of the
  175. certificate chain.
  176.  
  177. The encryption provided by SSL/TLS is more secure than the encryption
  178. negotiatied by the Telnet Encryption Option.  This additional security is
  179. provided by a combination of the use of longer encryption keys; the
  180. availability of stronger symmetric cryptographic algorithms; and the signing
  181. of each transmitted block with a message digest algorithm.
  182.  
  183. TLS may be used in conjunction wth Telnet Authentication methods such as
  184. Kerberos, Secure Remote Password, and NTLM to provide the highest level of
  185. data privacy with the strongest forms of mutual authentication.
  186.  
  187. The Kermit modules used to implement SSL/TLS are available only to residents
  188. of the United States and Canada due to the restrictions on the export of
  189. software that provides "crypto with a hole" functionality.
  190.  
  191.  
  192. 2. DISCLAIMERS
  193.  
  194. Current US law forbids export of strong encryption software from the USA to
  195. all countries except Canada.  Thus security modules are not included with
  196. Kermit; they must be obtained separately from the sources listed below, in
  197. compliance with the terms and conditions given at those sites and with United
  198. States and international law.  For an overview of this issue, see (for
  199. example):
  200.  
  201.   http://www.mozilla.org/crypto-faq.html
  202.  
  203. Kermit software, when combined with the security modules listed in this
  204. document, has been verified to negotiate and conduct authenticated and
  205. encrypted sessions with Kerberos and/or SRP services on Internet hosts at
  206. Columbia University and other test sites, with Kermit features such as
  207. interactive terminal access, file transfer, and scripting operating
  208. successfully over Kerberized connections, with any exceptions noted below.
  209.  
  210. The Kermit Project does not and can not claim or warrant the external
  211. Kerberos, SRP, OpenSSL or other third-party modules to be free of loopholes
  212. or bugs.  Authentication via Kerberos and/or SRP is not unbreakable.  Any
  213. encryption method can be broken.  Any software that is used for
  214. authentication or encryption should be analyzed for weaknesses, backdoors,
  215. bugs, and loopholes by the site and/or end user before use.
  216.  
  217. The Kermit Project and Columbia University make no claim or warranty as to any
  218. particular level of security achievable by Kermit software in conjunction with
  219. either Kerberos or Secure Remote Password protocol, and may on no account be
  220. held liable for any damage resulting from its use (a more complete statement
  221. to this effect is found in the C-Kermit 7.0 license).
  222.  
  223. Functional limitations:
  224.  
  225.  . Kerberos authentication is available only on Telnet and Rlogin connections.
  226.  
  227.  . Secure Remote Password authentication is available only on Telnet
  228.    connections.
  229.  
  230.  . NTLM authentication is available only on Windows 95/98 and NT and only
  231.    on Telnet connections.
  232.  
  233.  . SSL/TLS may be used as its own connection protocol or on Telnet
  234.    connections.
  235.  
  236.  . Kerberos support is not available in Kermit 95 for OS/2 due to lack
  237.    of Kerberos implementations for OS/2.
  238.  
  239.  
  240. 3. AVAILABILITY
  241.  
  242. 3.1 Authentication and Encryption in Kermit 95
  243.  
  244. Kermit 95 comes precompiled with support for Kerberos 4, Kerberos 5, Secure
  245. Remote Password, NT Lan Manager authentication, and OpenSSL's SSLv3 and TLSv1.
  246.  
  247. 3.1.1. Kerberos in Kermit 95
  248.  
  249. Beginning with version 1.1.16, Kermit 95 supports Kerberos Telnet
  250. Authentication when any of the following Kerberos IV or Kerberos V
  251. implementations are installed on a Windows 95 or Windows NT workstation:
  252.  
  253.   Kerberos version 4:
  254.     . MIT Leash distribution:
  255.         http://web.mit.edu/is/help/mink/
  256.  
  257.   For version 5:
  258.     . MIT distribution:
  259.         http://web.mit.edu/kerberos/www/
  260.     . Cygnus Solutions' KerbNet 1.2:
  261.         http://www.cygnus.com/techie/kerbnet/
  262.  
  263. Both Kerberos IV and Kerberos V may be installed on the same PC, and the same
  264. copy of Kermit 95 can use either Kerberos version to make Telnet connections.
  265. As of Kermit 95 1.1.18 Kerberized Rlogin connections are supported if the
  266. Kerberos DLLs export necessary functionality.
  267.  
  268. When Kerberos IV and/or Kerberos V are installed and the DLLs are located in
  269. the PATH, Kermit 95 attempts to negotiate authentication with the host's
  270. Telnet server if the host is Kerberized and if you have not instructed
  271. Kermit 95 to the contrary.
  272.  
  273. In addition, if the appropriate encryption patch (obtained from the Kermit
  274. Project) is installed, two-way encryption is also negotiated and used if
  275. authentication was negotiated.  The encryption patch is available WITH EXPORT
  276. RESTRICTIONS at:
  277.  
  278.   http://www.kermit-project.org/noexport.html
  279.  
  280. Due to the length of the shared secret negotiated by Kerberos only 56-bit DES
  281. encryption can be used.
  282.  
  283. Per-PC configuration files may or may not be necessary at your installation.
  284. If your site's DNS servers supply Kerberos realm information, no
  285. configuration files are needed and you can skip ahead to Section 3.1.2.
  286.  
  287. 3.1.1.1 Notes on the Kerberos IV configuration files:
  288.  
  289. MIT's Leash uses three configuration files which are placed into the \WINDOWS
  290. directory: LEASH.INI (user settings), KRB.CON and KRBREALM.CON.  KRB.CON and
  291. KRBREALM.CON are used by Kerberos IV to map your host's domain name to a
  292. realm and then to determine the name of the Kerberos server for that realm.
  293. As distributed from MIT, these files are set up for MIT's realm, domain,
  294. and host information, so if you are not at MIT you'll need to substitute the
  295. information for your own site; for example:
  296.  
  297. KRB.CON:
  298.   CC.COLUMBIA.EDU
  299.   CC.COLUMBIA.EDU kerberos.cc.columbia.edu
  300.   KERMIT.COLUMBIA.EDU kerberos.cc.columbia.edu
  301.   COLUMBIA.EDU kerberos.cc.columbia.edu
  302.   .KERBEROS.OPTION. dns
  303.  
  304. The first line is the default Kerberos IV realm to be used.  The subsequent
  305. lines list realms and the hostnames to be used to contact the KDC for that
  306. realm.
  307.  
  308. KRBREALM.CON:
  309.   .CC.COLUMBIA.EDU CC.COLUMBIA.EDU
  310.   CC.COLUMBIA.EDU CC.COLUMBIA.EDU
  311.   .COLUMBIA.EDU CC.COLUMBIA.EDU
  312.   COLUMBIA.EDU CC.COLUMBIA.EDU
  313.   .KERMIT.COLUMBIA.EDU CC.COLUMBIA.EDU
  314.   KERMIT.COLUMBIA.EDU CC.COLUMBIA.EDU
  315.  
  316. Each line specifies either a domain name prefaced with a '.' or a host name
  317. and the Kerberos IV realm to which it belongs.
  318.  
  319. The Leash Kerberos IV implementation does not contain support for server
  320. side functionality.  Therefore, K95 cannot authenticate incoming connections
  321. with Kerberos IV.  It also does not include support for pre-authenticated
  322. ticket granting ticket requests.
  323.  
  324. 3.1.1.2. Notes on the Kerberos V configuration file
  325.  
  326. Kerberos V uses a single configuration file, KRB5.CONF (or KRB5.INI on
  327. Windows).  This file must be customized for the domains, realms, and hosts
  328. used in your network environment.  For example:
  329.  
  330. [libdefaults]
  331.         default_realm = CC.COLUMBIA.EDU
  332.         default_tkt_enctypes = des-cbc-crc
  333.         default_tgs_enctypes = des-cbc-crc
  334.         ticket_lifetime = 600
  335.         dns_fallback = true
  336.  
  337. [domain_realm]
  338.         .cc.columbia.edu = CC.COLUMBIA.EDU
  339.         cc.columbia.edu = CC.COLUMBIA.EDU
  340.         .columbia.edu = CC.COLUMBIA.EDU
  341.         columbia.edu = CC.COLUMBIA.EDU
  342.  
  343. [realms]
  344.         CC.COLUMBIA.EDU = {
  345.                 kdc = kerberos.columbia.edu:88
  346.                 admin_server = kerberos.columbia.edu:749
  347.                 default_domain = cc.columbia.edu
  348.                 supported_enctypes = des-cbc-crc:normal des-cbc-crc:v4
  349.                 supported_keytypes = des:normal des-cbc-crc:v4
  350.         }
  351.  
  352. 3.1.2. Secure Remote Password protocol in Kermit 95
  353.  
  354. Beginning with version 1.1.16, Kermit 95 supports Telnet Authentication via
  355. Secure Remote Password protocol without any additional software.
  356.  
  357. In addition, if the appropriate encryption patch (obtained from the Kermit
  358. Project) is installed, two-way encryption is also negotiated and used if
  359. authentication was negotiated.  The encryption patch is available WITH EXPORT
  360. RESTRICTIONS at:
  361.  
  362.   http://www.kermit-project.org/noexport.html
  363.  
  364. Kermit 95 contains support for authenticating incoming connections using SRP.
  365. Unfortunately, there are no Windows based tools for creating the SRP password
  366. file.  However, once a password and config file are created on Unix they can
  367. be copied to Windows.  Use the SRP_ETC or ETC environment variables to specify
  368. where the "tpasswd" and "tpasswd.conf" files are stored.
  369.  
  370. 3.1.3. NT LAN Manager Authentication in Kermit 95
  371.  
  372. NTLM authentication is a feature of Windows 95/98, NT, and Windows 2000.  It
  373. is used to authenticate Windows clients to Windows services.  Telnet Auth
  374. NTLM is implemented in the Microsoft Telnet Daemon that ships with NT
  375. Services for Unix and with Windows 2000.
  376.  
  377. Windows 95/98 only contains support for the client whereas NT contains
  378. support for both client and server.  Kermit 95 can authenticate incoming
  379. connections with NTLM when it is executing on NT.
  380.  
  381. 3.1.4. OpenSSL support for SSLv3 and TLSv1 in Kermit 95
  382.  
  383. OpenSSL security is available in Kermit 95 1.1.18 and later.  OpenSSL sources
  384. may be retrieved from the web site http://www.openssl.org/.  As of this
  385. writing the current release of OpenSSL is 0.9.4 and 0.9.5 is under
  386. development.  Kermit 95 works with the binaries produced by compiling either
  387. 0.9.4 or 0.9.5.  Patches to enable OpenSSL to be compiled for OS/2 are
  388. located at:
  389.  
  390.   http://www.geocities.com/SiliconValley/Hills/8057/files/openssl.html
  391.  
  392. On Windows, OpenSSL must be compiled and linked to use the NT DLL option
  393. without Debug information.  Compiling the DLLs with support for debugging
  394. links the DLLs to an incompatible C Run Time Library DLL.
  395.  
  396. On OS/2, OpenSSL must be compiled to use the DLL version of the run time
  397. library.
  398.  
  399. For proper operation of OpenSSL and Kermit 95, the OpenSSL DLLs must be
  400. available in the PATH.  In addition, the OPENSSL_CONF environment variable
  401. should also be defined appropriately.
  402.  
  403. OpenSSL does not define default locations for certificates and revocation
  404. lists therefore the appropriate SET AUTH { SSL, TLS } commands must be
  405. specified in the K95CUSTOM.INI (or IKSD.KSC) file in order for certificate
  406. verification to be performed.
  407.  
  408. Due to patent licensing restrictions on RSA and IDEA algorithms within the
  409. United States, any binaries that the Kermit Project might distribute to
  410. provide SSL/TLS support for Kermit 95 do not contain RSA key exchange;
  411. RSA authentication; or RC2, RC4, and IDEA ciphers.
  412.  
  413. If you wish to provide support for authentication of clients using public
  414. key certificates you must provide a custom X509_to_user() function to
  415. provide the certificate to local userid mapping.  An example function which
  416. uses the /UID field of the Certificate Subject name follows:
  417.  
  418.   int
  419.   X509_to_user(X509 *peer_cert, char *userid, int len)
  420.   {
  421.       int err;
  422.  
  423.       if (!(peer_cert && userid) || len <= 0)
  424.           return -1;
  425.  
  426.       /* userid is in cert subject /UID */
  427.       err = X509_NAME_get_text_by_NID(X509_get_subject_name(peer_cert),
  428.                                        NID_uniqueIdentifier, userid, len);
  429.       if (err > 0)
  430.           return 0;
  431.       return -1;
  432.   }
  433.  
  434. This function must be compiled into a DLL called "X5092UID.DLL".  It should
  435. be linked to the OpenSSL libraries and the DLL version of the run time
  436. library.
  437.  
  438.  
  439. 3.2. Authentication and Encryption in C-Kermit 7.0
  440.  
  441. C-Kermit 7.0 may be compiled with support Kerberos 4, Kerberos 5, Secure
  442. Remote Password, and OpenSSL's SSLv3 and TLSv1.
  443.  
  444. 3.2.1. Kerberos in C-Kermit 7.0
  445.  
  446. This section is current as of C-Kermit 7.0.196 Beta.11.
  447.  
  448. Kerberos IV and Kerberos V support is available for Unix versions of C-Kermit
  449. 7.0.  Kerberos support in C-Kermit is provided for both outgoing and incoming
  450. connections (SET HOST /SERVER * <port> /TELNET or the Internet Kermit
  451. Service).
  452.  
  453. Kerberized C-Kermit binaries are not available due to export restrictions (see
  454. Section 2); you must build your own binary from a combination of Columbia
  455. source code and Kerberos libraries from other sources.
  456.  
  457.  1a. Retrieve a Kerberos 5 1.1 source code kit from the appropriate site:
  458.  
  459.        http://web.mit.edu/kerberos/www/ or
  460.        http://web.mit.edu/network/kerberos-form.html
  461.  
  462.  1b. Choose a Kerberos 4 installation (from MIT) and retrieve a source code
  463.      kit from the appropriate site:
  464.  
  465.        http://web.mit.edu/kerberos/www/ or
  466.        http://web.mit.edu/network/kerberos-form.html
  467.  
  468.  2. Obtain the C-Kermit Authentication and Encryption support modules from
  469.     Columbia University.  These are not available by FTP due to export
  470.     restrictions.  Contact kermit-support@columbia.edu for details.
  471.  
  472.  3. Build and install Kerberos on your system according to the instructions
  473.     that come with the Kerberos distribution you have chosen.
  474.  
  475.  4. Add a new entry to the C-Kermit makefile for your platform, that adds the
  476.     following CFLAGS:
  477.  
  478.       -DCK_AUTHENTICATION -DCK_KERBEROS
  479.  
  480.     For Kerberos 4 include:
  481.  
  482.       -DKRB4
  483.  
  484.     For Kerberos 5 include:
  485.  
  486.       -DKRB5
  487.  
  488.     For Kerberos 4 compatibility mode with Kerberos 5:
  489.  
  490.       -DKRB5 -DKRB524 -DKRB4
  491.  
  492.     If you have the source file ck_crp.c and desire DES encryption include:
  493.  
  494.       -DCK_ENCRYPTION -DCK_DES
  495.  
  496.     Use "krbmit" as the target for builds with ck_crp.c and "krbmit-export"
  497.     for builds without ck_crp.c.
  498.  
  499.     Add the path to the Kerberos header files using the -I switch.  The
  500.     location of these files are host specific.  For example:
  501.  
  502.       -I/usr/kerberos/include
  503.  
  504.     Add the path to the Kerberos libraries using the -L switch.  The
  505.     location of these files are host specific.  For example:
  506.  
  507.       -L/usr/kerberos/lib
  508.  
  509.     Add the appropriate libraries.  For Kerberos 4 include:
  510.  
  511.       -lkrb
  512.  
  513.     For Kerberos 5 include:
  514.  
  515.       -lkrb5 -lcom_err -lcrypto
  516.  
  517.     For Kerberos 4 compatibility mode with Kerberos 5 include:
  518.  
  519.       -ldes425 -lkrb5 -lcom_err -lcrypto
  520.  
  521.     Make sure the new entry points to the appropriate include files, and links
  522.     with the appropriate libraries.  Use the "linux+krb5", "linux+krb5+krb4",
  523.     and "sunos41gcc+krb4" makefile entries as models.
  524.  
  525. Note that the select() version of the CONNECT-command module (ckucns.c) must
  526. be used rather than the older fork() based (ckucon.c) version.
  527.  
  528. Keep the Kerberos support modules private, and put the C-Kermit binary where
  529. it can be used, but not where it can be accessed by anonymous ftp or by anyone
  530. who is outside the USA or Canada.
  531.  
  532. When C-Kermit 7.0 is built with Kerberos support and installed as an Internet
  533. Kermit Service Daemon (IKSD), Kerberos is offered for authenticating incoming
  534. connections.  To authenticate incoming connections there must be a valid
  535. keytab file providing local access to the key necessary for decrypting
  536. meesages encoded in the server's key.
  537.  
  538. 3.2.2. Secure Remote Password protocol in C-Kermit
  539.  
  540. This section is current as of C-Kermit 7.0.196 Beta.11.
  541.  
  542. Secure Remote Password (SRP) support is available for Unix versions of
  543. C-Kermit 7.0.  SRP support in C-Kermit is provided for both outgoing and
  544. incoming connections (SET HOST /SERVER * <port> /TELNET or the Internet Kermit
  545. Service).
  546.  
  547. SRP C-Kermit binaries are not available due to export restrictions (see
  548. Section 2); you must build your own binary from a combination of Columbia
  549. source code and SRP libraries from other sources.
  550.  
  551.  1. Retrieve the SRP 1.5.0 source code kit from:
  552.  
  553.       http://srp.stanford.edu/srp/
  554.  
  555.  2. Obtain the C-Kermit Authentication and Encryption support modules from
  556.     Columbia University.  These are not available by FTP due to export
  557.     restrictions.  Contact kermit-support@columbia.edu for details.
  558.  
  559.  3. Build SRP with the GMP math library.  Be sure to read the installation
  560.     instructions before installing because SRP replaces many standard Unix
  561.     system files and failure to follow the procedures may leave you locked
  562.     out of your system.
  563.  
  564.  4. Add a new entry to the C-Kermit makefile for your platform, that adds
  565.     the following CFLAGS:
  566.  
  567.       -DCK_AUTHENTICATION -DCK_SRP
  568.  
  569.     If you have the source file ck_crp.c include:
  570.  
  571.       -DCK_ENCRYPTION
  572.  
  573.     For CAST encryption (requires ck_crp.c) add:
  574.  
  575.       -DCK_CAST
  576.  
  577.     If using the Eric A. Young DES encryption library (available separately
  578.     and as a part of the OpenSSL project <http://www.openssl.org>)
  579.     (requires ck_crp.c) add:
  580.  
  581.       -DCK_DES -DLIBDES
  582.  
  583.     Use "srpmit" as the target for builds with ck_crp.c and "srpmit-export"
  584.     for builds without ck_crp.c.
  585.  
  586.     Add the path to the SRP header files using the -I switch.  The
  587.     location of these files are host specific.  For example:
  588.  
  589.       -I/usr/srp/include
  590.  
  591.     Add the path to the SRP libraries using the -L switch.  The
  592.     location of these files are host specific.  For example:
  593.  
  594.       -L/usr/srp/lib
  595.  
  596.     Add the appropriate libraries.  (Include des only if you have the
  597.     Eric A. Young library):
  598.  
  599.       -lsrp -lgmp -ldes
  600.  
  601.     Make sure the new entry points to the appropriate include files, and
  602.     links with the appropriate libraries.  Use the "linux+srp" and
  603.     "linux+krb5+krb4+srp" makefile entries as models.
  604.  
  605. Note that the select() version of the CONNECT-command module (ckucns.c) must
  606. be used rather than the older fork() based (ckucon.c) version.
  607.  
  608. Keep the SRP support modules private, and put the C-Kermit binary where
  609. it can be used, but not where it can be accessed by anonymous ftp or by anyone
  610. who is outside the USA or Canada.
  611.  
  612. When C-Kermit 7.0 is installed as an Internet Kermit Service (IKSD), SRP
  613. is offered for authenticating incoming connections.
  614.  
  615. 3.2.3   OpenSSL support for SSLv3 and TLSv1 in C-Kermit 7.0.
  616.  
  617. This section is current as of C-Kermit 7.0.196 Beta.11.
  618.  
  619. OpenSSL support is available for Unix versions of C-Kermit 7.0.  SSLv3 and
  620. TLSv1 support in C-Kermit is provided for both outgoing and incoming
  621. connections (SET HOST /SERVER * <port> /TELNET or the Internet Kermit Service).
  622.  
  623. OpenSSL C-Kermit binaries are not available due to export restrictions (see
  624. Section 2); you must build your own binary from a combination of Columbia
  625. source code and the OpenSSL libraries from other sources.
  626.  
  627.  1. Retrieve the OpenSSL 0.9.4 source code kit from:
  628.  
  629.       http://www.openssl.org/
  630.  
  631.  2. Obtain the C-Kermit Authentication and Encryption support modules from
  632.     Columbia University.  These are not available by FTP due to export
  633.     restrictions.  Contact kermit-support@columbia.edu for details.
  634.  
  635.  3. Build OpenSSL according to the installation instructions.  Be aware that
  636.     OpenSSL includes support for algorithms which are covered by patents
  637.     or claimed as intellectual property in the United States (and perhaps
  638.     some other countries.)  Use of these algorithms without the proper
  639.     licenses can make you liable to legal action.  Be sure to read the
  640.     entire README file before building and installing OpenSSL.
  641.  
  642.     If you wish to support ADH ciphers you must define SSL_ALLOW_ADH when
  643.     building OpenSSL.
  644.  
  645.  4. Add a new entry to the C-Kermit makefile for your platform, that adds
  646.     the following CFLAGS:
  647.  
  648.       -DCK_AUTHENTICATION -DCK_SSL
  649.  
  650.     Use "krbmit" as the target for builds.
  651.  
  652.     Add the path to the OpenSSL header files using the -I switch.  The
  653.     location of these files is host-specific.  For example:
  654.  
  655.       -I/usr/local/ssl/include
  656.  
  657.     Add the path to the OpenSSL libraries using the -L switch.  The
  658.     location of these files is host-specific.  For example:
  659.  
  660.       -L/usr/local/ssl/lib
  661.  
  662.     Add the appropriate libraries:
  663.  
  664.       -lssl -lcrypto
  665.  
  666.     Make sure the new entry points to the appropriate include files, and
  667.     links with the appropriate libraries.  Use the "linux+openssl" and
  668.     "linux+krb5+krb4+srp+openssl" makefile entries as models.
  669.  
  670. Note that the select() version of the CONNECT-command module (ckucns.c) must
  671. be used rather than the older fork() based (ckucon.c) version.
  672.  
  673. Keep the OpenSSL support modules private, and put the C-Kermit binary where
  674. it can be used, but not where it can be accessed by anonymous ftp or by anyone
  675. who is outside the USA or Canada.
  676.  
  677. When C-Kermit 7.0 is installed as an Internet Kermit Service (IKSD), TLSv1
  678. is offered for authenticating incoming connections via the Telnet START_TLS
  679. option.
  680.  
  681. If you wish to provide support for authentication of clients using public
  682. key certificates you must provide a custom X509_to_user() function to
  683. provide the certificate to local userid mapping.  An example function which
  684. uses the /UID field of the Certificate Subject name may be activated by
  685. specifying
  686.  
  687.    make <entry> KFLAGS=-DX509_UID_TO_USER
  688.  
  689. when compiling C-Kermit.  The X509_to_user() function is the last function
  690. in the ck_ssl.c module.
  691.  
  692. 3.2.4.  Shadow Passwords in C-Kermit 7.0.
  693.  
  694. Shadow password files are used in many versions of Unix to provide a greater
  695. level of security for user passwords stored on the local disk.  The standard
  696. Unix password file must be world readable in order to processes to determine
  697. the location of the user's shell, home directory, and other permissions.  By
  698. moving the passwords into a separate file that only stores passwords, access
  699. to the file can be restricted to only those processes that are authorized to
  700. perform authentication.
  701.  
  702. When C-Kermit 7.0 is used as the Internet Kermit Service on systems that are
  703. configured to use shadow passwords the following CFLAG must be added to the
  704. makefile entry:
  705.  
  706.   -DCK_SHADOW
  707.  
  708. 3.2.5.  Pluggable Authentication Module (PAM) support in C-Kermit 7.0
  709.  
  710. PAM is implemented in many versions of Unix so system administrators can
  711. add new forms of authentication for interactive login (console, telnet,
  712. rlogin, ...) without requiring recompilation of each service.
  713.  
  714. When C-Kermit 7.0 is used as the Internet Kermit Service on systems that are
  715. configured to use PAM the following CFLAG must be added to the makefile
  716. entry:
  717.  
  718.   -DCK_PAM
  719.  
  720. and the following libraries may have to be included:
  721.  
  722.   -lpam -ldl
  723.  
  724. C-Kermit 7.0's support for PAM is limited to Interactive Login.  PAM is
  725. not compatible with the Kermit Protocol's REMOTE LOGIN mechanism.
  726.  
  727. 4. KERBEROS GLOSSARY
  728.  
  729. Listed alphabetically, not topologically.
  730.  
  731. Entity
  732.   In this document, a user, host, or service.
  733.  
  734. Authentication
  735.   The process by which one entity proves its identity to another
  736.   entity on the Internet.
  737.  
  738. Client
  739.   An entity that can obtain a ticket (see Ticket).
  740.  
  741. Credentials Cache
  742.   The location where Kerberos stores tickets.  The credentials cache
  743.   can be a file or a buffer in memory.
  744.  
  745. Expiration
  746.   Invalidation of a ticket after a certain period of time.  A ticket's
  747.   lifetime is chosen by the user when obtaining the ticket; the maximum
  748.   allowable lifetime for different kinds of tickets is set by the site
  749.   administrator.
  750.  
  751. Forwardable Tickets
  752.   Kerberos tickets that can be forwarded (copied) to a remote machine,
  753.   where they can be used, eliminating the need to obtain new Ticket Granting
  754.   Tickets (q.v.) on that machine, e.g. for Telnetting from machine A to
  755.   machine B and then from machine B to machine C.
  756.  
  757. Host
  758.   A computer that can be accessed over a network.
  759.  
  760. KDC
  761.   Key Distribution Center, a machine that issues Kerberos tickets.
  762.  
  763. Preauthenticated Ticket Granting Ticket Request
  764.   The client must include a time stamp encrypted with the user's password
  765.    when requesting the TGT from the KDC.  This allows the KDC to only
  766.    deliver a TGT to a valid user.  When preauthentication is not used
  767.    the TGT may be attacked offline to determine the user's password.
  768.  
  769. Postdated Ticket
  770.   A ticket that does not become valid until after a specified time.
  771.   This allows for secure unattended operations.
  772.  
  773. Principal
  774.   A string that names a specific entity to which a set of credentials may
  775.   be assigned.  It generally has three parts, primary/instance@REALM:
  776.    1. Primary:  Identifies the user or service.
  777.    2. Instance: Usually a hostname or REALM.
  778.    3. REALM:    Logical network served by a single Kerberos database and KDC.
  779.  
  780. Proxiable Ticket
  781.   A ticket that may be given to a service to allow the service to impersonate
  782.   the user for whom the ticket has been issued.
  783.  
  784. Ticket
  785.   A temporary set of electronic credentials that verifies the identity of
  786.   its owner to a particular service.
  787.  
  788. TGT
  789.   Ticket Granting Ticket.  A special ticket that lets its owner obtain
  790.   additional tickets within the same realm.  A TGT is obtained during the
  791.   initial authentication process.
  792.  
  793.  
  794. 5. OVERVIEW OF AUTHENTICATION PROTOCOLS
  795.  
  796. The following sections attempt to provide an overview of how each of the
  797. supported authentication protocols operates.
  798.  
  799. 5.1 KERBEROS OVERVIEW
  800.  
  801. Before making a Kerberized connection, you have to know which Kerberos
  802. version, 4 or 5, is supported by the host or service you want to connect
  803. to, and you must be registered in the Kerberos database at the host's
  804. site.  Contact the site administrator for details.
  805.  
  806. Before authentication to a specific service (such as Telnet) can succeed, you
  807. must login to the site's Kerberos Ticket Granting Server.  Depending on the
  808. Kerberos implementation and installation options this may be done
  809. automatically when you log in to your operating system.  Otherwise you can
  810. do it with external utilities from MIT or Cygnus (such as Leash, KRB5, or
  811. KerbNet), or with Kermit's built-in functionality, explained below.
  812.  
  813. Once a Ticket Granting Ticket (TGT) is retrieved, Kermit can use it to retrieve
  814. additional tickets for each host (service) you wish to connect to.  These
  815. service tickets may be used to authenticate you with the host automatically
  816. during a specified time interval.  When authentication is successful, you are
  817. logged in to the host and no Login: or Password: prompt does appear when
  818. connecting.
  819.  
  820. Besides providing credentials for use during authentication, the service
  821. ticket also contains a session key to be used for encrypting the
  822. communications.  After the connection is authenticated, Kermit (if the
  823. necessary encryption capabilities are available) attempts to negotiate
  824. bidirectional encryption using either the DES-CFB64 or DES-OFB64 algorithms.
  825. If one of these is negotiated, it is used in one or both directions,
  826. depending on what the server agreed to.
  827.  
  828. When Kerberos V authentication is used, Kermit supports credential forwarding
  829. by transferring your Ticket Granting Tickets to the host that you are
  830. connecting to, so you can make additional authenticated connections from that
  831. host to any others that accept those tickets.  This provides a single sign-on
  832. capability to the network.
  833.  
  834. Successful operation of Kerberos requires that all machines have their dates
  835. and times synchronized.  Be aware that PC clocks can drift, and this can
  836. cause authentication failures.
  837.  
  838.  
  839. 5.2 SECURE REMOTE PASSWORD (SRP) OVERVIEW
  840.  
  841. SRP requires no special configuration of the client.  When Kermit is used to
  842. connect to a host that supports SRP, the user name is transmitted
  843. automatically to the host and then a Password prompt is displayed in the
  844. Kermit command screen.  This indicates that the password will not be sent to
  845. the host over the communication channel.  Instead the password is used as part
  846. of a negotiation in which authentication is either mutual or none at all.
  847.  
  848. The result of a mutual authentication is a shared secret which is used to
  849. generate two different keys for encrypting the incoming and outgoing data.
  850. SRP hosts support CAST-128-CFB64, CAST-128-OFB64, CAST-40-CFB64,
  851. CAST-40-OFB64, DES-CFB64, DES-OFB64, DES3-CFB64, DES3-OFB64 encryption
  852. algorithms.
  853.  
  854.  
  855. 5.3 NT LAN MANAGER (NTLM) OVERVIEW
  856.  
  857. Microsoft's native authentication method is NTLM.  It is implemented in
  858. Windows 9x and NT and requires no configuration on the part of the user.
  859. When K95 is used on either Win9x or NT it can be used as an NTLM Telnet
  860. client to authenticate to Microsoft's NT Services for Unix Telnet Server
  861. or to a K95 configured to accept incoming connections.
  862.  
  863. When K95 is used on NT it can be configured to accept incoming connections
  864. and authenticate NTLM Telnet clients.
  865.  
  866. NTLM is a weak form of authentication.  It provides no shared secret
  867. and cannot be used as a means of securing a connection with encryption.
  868.  
  869.  
  870. 5.4 SSLv3 and TLSv1 OVERVIEW
  871.  
  872. (Also see Section 14 for an introduction to the concept of certificates.)
  873.  
  874. Secure Sockets Layer Version 3 (SSLv3) and its successor Transport Layer
  875. Security Version 1 (TLSv1) were originally designed for use by Web browsers.
  876. They provide a framework for using public-key certificates to negotiate
  877. server and (optionally) client authentication and bidirectional encryption.
  878. The encryption provided by SSLv3 and TLSv1 is stronger than that provided
  879. by the Telnet Encryption option.
  880.  
  881. SSLv3 and TLSv1 connections may be negotiated in two different ways.  First,
  882. the connection may be SSL/TLS-only, which is used when connecting to HTTPS
  883. services or SSL/TLS tunnels.  SSL/TLS may also be negotiatied after the
  884. connection is established via negotiations performed in some other protocol
  885. (such as Telnet.)
  886.  
  887. Kermit supports both kinds of connections:
  888.  
  889.  . Pure SSLv3 connections via SET HOST <host> <port> /SSL
  890.  
  891.  . Pure TLSv1 connections via SET HOST <host> <port> /TLS
  892.  
  893.  . SSLv3 connections negotiated by Tim Hudson's Telnet AUTH SSL option
  894.  
  895.  . TLSv1 connections negotiated by the IETF TN3270E Working Group's
  896.    TELNET START_TLS option
  897.  
  898. The SSL and TLS negotations provide the client with authentication of the
  899. host computer when the host's X.509 certificate is verified.  Authentication
  900. of the client may be performed by the use of an X.509 certificate issued to
  901. the end user, or via one of the supported Telnet Authentication methods.
  902. Even though the data channel is encrypted, the transmission of passwords to
  903. the host should still be avoided to prevent theft by a compromised host.
  904.  
  905. For verification of certificates to be performed, the root certificates of
  906. the certificate authorities (CAs) must be available.  If you are not acting
  907. as your own CA you might want to use the file of root certificates at
  908. http://www.e-softinc.com/cacerts.txt.  This file is produced by E-Soft, Inc.,
  909. as part of its monthly survey on secure server usage.  After downloading,
  910. this file can be used by Kermit via the command:
  911.  
  912.   SET AUTH SSL VERIFY-FILE <path>/cacerts.txt
  913.  
  914. When Kermit is used as an IKSD, client certificates can be used for automatic
  915. login.  If a certificate-to-userid mapping function is provided, the IKSD
  916. logs the user in automatically if the certificate is verified and the
  917. specified userid exists on the system.  Kermit also supports the use of a
  918. ".tlslogin" file that allows a certificate to be used to login automatically
  919. to an account without a certificate-to-userid mapping function.  When Kermit
  920. receives a username via the Telnet New-Environment variable after it has
  921. received and verified a client certificate, it looks in the home directory
  922. corresponding to the username for a file called ".tlslogin".  If the file
  923. contains the certificate presented by the client, the client is logged in as
  924. the requested user without a password.
  925.  
  926. The method for negotiating Tim Hudson's Telnet AUTH SSL option is open to a
  927. man-in-the-middle attack which is capable of disabling the use of SSL before
  928. the negotiation is begun.  It should only be used in conjunction with:
  929.  
  930.    SET TELNET AUTHENTICATION TYPE SSL
  931.    SET TELOPT AUTHENTICATION REQUIRED
  932.  
  933. When using IKSD with START_TLS you should create an /etc/iksd.conf file
  934. and place within it commands pointing to the certificate and key files:
  935.  
  936.   set auth tls rsa-cert-file /usr/local/ssl/certs/telnetd-rsa.pem
  937.   set auth tls rsa-key-file  /usr/local/ssl/certs/telnetd-rsa-key.pem
  938.   set auth tls dsa-cert-file /usr/local/ssl/certs/telnetd-dsa.pem
  939.   set auth tls dsa-key-file  /usr/local/ssl/certs/telnetd-dsa-key.pem
  940.  
  941. as well as the list of ciphers that you are willing to accept:
  942.  
  943.   set auth tls cipher 3DES:DSS
  944.  
  945. Note: A Unix telnetd that supports START_TLS is available from
  946.  
  947.   ftp://ftp.runestig.com/pub/starttls/inetutils-1.3.2-tls.tar.gz
  948.  
  949. This telnetd supports verification of certificate chains for both client and
  950. server including support for certificate revocation lists.
  951.  
  952.  
  953. 6. AUTHENTICATION AND ENCRYPTION COMMANDS
  954.  
  955. Kermit has a full repertoire of commands for selecting and controlling
  956. security.  Bear in mind that these are targeted primarily at the network
  957. or site manager and not at the "ordinary" user.  In a typical application,
  958. a university that has a site license for Kermit 95 creates a customized
  959. installation CD for its user community that contains all the appropriate
  960. security (and other) setups, so end users get secure connections without
  961. doing anything special or even knowning that they have them.
  962.  
  963. In all Kermit commands:
  964.  
  965.   KERBEROS4 can be abbreviated KRB4 or K4
  966.   KERBEROS5 can be abbreviated KRB5 or K5
  967.  
  968. Some of Kermit's Kerberos-related commands are rather complex, but remember
  969. that you don't have to memorize them, or any other Kermit commands.  Use "?"
  970. at any point to feel your way through the command, or type HELP for the
  971. desired command to see a brief explanation.
  972.  
  973. The CHECK KERBEROS command tells whether your version of Kermit has been built
  974. to include the Kerberos support even if it cannot function on your system.
  975.  
  976. The CHECK NTLM command tells whether your version of Kermit has been built
  977. to include the NTLM support even if it cannot function on your system.
  978.  
  979. The CHECK SRP command tells whether your version of Kermit has been built
  980. to include the SRP support even if it cannot function on your system.
  981.  
  982. The CHECK SSL/TLS command tells whether your version of Kermit has been built
  983. to include the SSL/TLS support even if it cannot function on your system.
  984.  
  985. IF AVAILABLE KERBEROS4 (or KRB4, or K4) tells whether Kerberos 4 is actually
  986. available in your version of Kermit (e.g. if the Kerberos 4 DLLs are installed
  987. on your Windows 95 PC).
  988.  
  989. IF AVAILABLE KERBEROS5 (KRB5, K5) tells whether Kerberos 5 is available in
  990. your version of Kermit.
  991.  
  992. IF AVAILABLE NTLM tells whether NT Lan Manager protocol is available in your
  993. version of Kermit.
  994.  
  995. IF AVAILABLE SRP tells whether Secure Remote Password protocol is available
  996. in your version of Kermit.
  997.  
  998. IF AVAILABLE { SSL, TLS } tells whether SSL/TLS protocol is available in your
  999. version of Kermit.
  1000.  
  1001.  
  1002. 6.1. TELNET-Related Security Commands
  1003.  
  1004. SET TELOPT [{ /CLIENT, /SERVER }] AUTHENTICATION
  1005.         { ACCEPTED, REFUSED, REQUESTED, REQUIRED }
  1006.   ACCEPT or REFUSE authentication bids, or actively REQUEST authentication.
  1007.   REQUIRED refuses and closes the connection if authentication is not
  1008.   successfully negotiated when either making or accepting connections.
  1009.   ACCEPTED by default.
  1010.  
  1011. SET TELNET AUTHENTICATION TYPE { AUTOMATIC, KERBEROS4, KERBEROS5, NTLM, SRP,
  1012.                                  SSL, NONE }
  1013.   AUTOMATIC allows the host to choose the preferred type of authentication.
  1014.   Other values allow a specific authentication method to be specified.
  1015.   AUTOMATIC is the default.  The list of options varies depending on the
  1016.   authentication types selected at compilation time.  When combined with SET
  1017.   TELOPT AUTH REQUIRED, a specific authentication method can be required.
  1018.  
  1019. SET TELNET AUTHENTICATION FORWARDING { ON, OFF }
  1020.   When Kermit is the client, set this to ON to forward forwardable Kerberos V
  1021.   Ticket Granting Tickets to the host after authentication is complete, so you
  1022.   can make additional authenticated connections from there.  When Kermit is
  1023.   the server, set this to ON to accept forwardable Kerberos V TGTs from the
  1024.   client.  OFF by default.
  1025.  
  1026. SET TELNET AUTHENTICATION HOW-FLAG { ANY, MUTUAL, ONE-WAY }
  1027.   Specifies which values for the HOW-FLAG should be accepted as a client
  1028.   or offered as a server.  The default is ANY.
  1029.  
  1030. SET TELNET AUTHENTICATION ENCRYPT-FLAG { ANY, NONE, TELOPT }
  1031.   Specifies which values for the ENCRYPT-FLAG should be accepted as a client
  1032.   or offered as a server.  The default is ANY.
  1033.  
  1034. SET TELOPT [{ /CLIENT, /SERVER }] ENCRYPTION
  1035.         { ACCEPTED, REFUSED, REQUESTED, REQUIRED }
  1036.         { ACCEPTED, REFUSED, REQUESTED, REQUIRED }
  1037.   The first parameter specifies the Kermit to peer state.  The second
  1038.   parameter specifies the peer to Kermit state.  The default is ACCEPTED
  1039.   ACCEPTED.
  1040.  
  1041. SET TELNET ENCRYPTION TYPE { AUTOMATIC, CAST128_CFB64, CAST128_OFB64,
  1042.   CAST5_40_CFB64, CAST5_40_OFB64, DES_CFB64, DES_OFB64,
  1043.   DES3_CFB64, DES3_OFB64, NONE }
  1044.   AUTOMATIC allows the host to choose the preferred type of encryption.
  1045.   Other values allow a specific encryption method to be specified.
  1046.   AUTOMATIC is the default.  The list of options varies depending
  1047.   on the encryption types selected at compilation time.  An encryption
  1048.   method can only be used if there is enough key data available.
  1049.   Kerberos can use only DES encryption because it provides a shared
  1050.   secret only 56 bits in length.
  1051.  
  1052. SET TELOPT [{ /CLIENT, /SERVER }] START_TLS
  1053.         { ACCEPTED, REFUSED, REQUESTED, REQUIRED }
  1054.   ACCEPT or REFUSE a request to negotiate TLS, or actively REQUEST
  1055.   that TLS be negotiated.  REQUIRED refuses and closes the connection if
  1056.   the peer refuses to negotiate TLS or the TLS negotiations end in failure.
  1057.   ACCEPTED by default when a client.  REQUESTED by default when a server.
  1058.  
  1059. SET TELNET ENVIRONMENT USER <name>
  1060. SET LOGIN USERID <name>
  1061.   If a <name> is given, it sent to host during Telnet negotiations; if this
  1062.   switch is given but the string is omitted, no user ID is sent to the host.
  1063.   If this command is not given, your current USERID value, \v(userid), is
  1064.   sent.  When a userid is sent to the host it is a request to login as the
  1065.   specified user.
  1066.  
  1067. SET LOGIN PASSWORD <password>
  1068.   If a <password> is given, it is treated as the password to be used (if
  1069.   required) by any Telnet Authentication protocol (Kerberos Ticket retrieval,
  1070.   Secure Remote Password (SRP), or X.509 certificate private key decryption.)
  1071.   If no password is specified a prompt is issued to request the password if
  1072.   one is required for the negotiated authentication method.
  1073.  
  1074. SET TELNET DEBUG ON
  1075.   Displays all TELNET negotiations in full detail.
  1076.  
  1077. TELNET /AUTH:<type> /ENCRYPT:<type> /USERID:[<name>] /PASSWORD:[<string>]
  1078.        <host> <port>
  1079.   The TELNET command is a shortcut for making interactive connections.
  1080.   It is the equivalent of specifying:
  1081.  
  1082.     SET TELOPT AUTH ...
  1083.     SET TELNET AUTH TYPE ...
  1084.     SET TELOPT ENCRYPT ...
  1085.     SET TELNET ENCRYPT TYPE ...
  1086.     SET LOGIN USERID ...
  1087.     SET LOGIN PASSWORD ...
  1088.     SET HOST /CONNECT <host> <port> /TELNET
  1089.  
  1090.   /AUTH:<type> is equivalent to SET TELNET AUTH TYPE <type> and
  1091.   SET TELOPT AUTH REQUIRED with the following exceptions.  If the type
  1092.   is AUTO, then SET TELOPT AUTH REQUESTED is executed and if the type
  1093.   is NONE, then SET TELOPT AUTH REFUSED is executed.
  1094.  
  1095.   /ENCRYPT:<type> is equivalent to SET TELNET ENCRYPT TYPE <type>
  1096.   and SET TELOPT ENCRYPT REQUIRED REQUIRED with the following exceptions.
  1097.   If the type is AUTO then SET TELOPT AUTH REQUESTED REQUESTED is executed
  1098.   and if the type is NONE then SET TELOPT ENCRYPT REFUSED REFUSED is
  1099.   executed.
  1100.  
  1101.   /USERID:[<name>]
  1102.   This switch is equivalent to SET LOGIN USERID <name> or SET TELNET
  1103.   ENVIRONMENT USER <name>.  If a string is given, it sent to host during
  1104.   Telnet negotiations; if this switch is given but the string is omitted, no
  1105.   user ID is sent to the host.  If this switch is not given, your current
  1106.   USERID value, \v(userid), is sent.  When a userid is sent to the host
  1107.   it is a request to login as the specified user.
  1108.  
  1109.   /PASSWORD:[<string>]
  1110.   This switch is equivalent to SET LOGIN PASSWORD.  If a string is given,
  1111.   it is treated as the password to be used (if required) by any Telnet
  1112.   Authentication protocol (Kerberos Ticket retrieval, Secure Remote
  1113.   Password, or X.509 certificate private key decryption.)  If no password
  1114.   switch is specified a prompt is issued to request the password if one
  1115.   is required for the negotiated authentication method.
  1116.  
  1117. SHOW TELNET
  1118.   Displays current TELNET settings, including authentication and
  1119.   encryption.
  1120.  
  1121. 6.2. The SET AUTHENTICATION Command
  1122.  
  1123. The SET AUTHENTICATION command lets you configure the behavior of Kermit's
  1124. authentication methods and set defaults for the AUTHENTICATE commands so you
  1125. don't always have to include all the switches if you give more than one
  1126. AUTHENTICATE command in one Kermit session:
  1127.  
  1128. If you always use the same setup, you can put the appropropriate SET
  1129. AUTHENTICATION commands in your Kermit customization file: k95custom.ini
  1130. (Windows) or .mykermrc (UNIX).
  1131.  
  1132. 6.2.1 Kerberos Set Commands
  1133.  
  1134. SET AUTHENTICATION { KERBEROS4, KERBEROS5 } AUTODESTROY
  1135.   { ON-CLOSE, ON-EXIT, NEVER }
  1136.   When ON, Kermit destroys all credentials in the default
  1137.   credentials cache upon Kermit termination.  Default is NEVER.
  1138.  
  1139. SET AUTHENTICATION { KERBEROS4, KERBEROS5 } AUTOGET { ON, OFF }
  1140.   When ON, if the host offers Kerberos 4 or Kerberos 5 authentication and
  1141.   Kermit is configured to use that authentication method and there is no
  1142.   TGT, Kermit automatically attempts to retrieve one by prompting for the
  1143.   password (and principal if needed.)  Default is ON.
  1144.  
  1145. SET AUTHENTICATION KERBEROS5 CREDENTIALS-CACHE <filename>
  1146.   Specifies an alternative credentials cache.  This is useful when you need
  1147.   to maintain two or more sets of credentials for different realms or
  1148.   roles.  The default is specified by the environment variable KRB5CCNAME
  1149.   or as reported by the Kerberos 5 library.
  1150.  
  1151. SET AUTHENTICATION KERBEROS5 FORWARDABLE { ON, OFF }
  1152.   ON specifies that Kerberos 5 credentials should be forwardable to the
  1153.   host.  If SET TELNET AUTHENTICATION FORWARDING is ON, forwardable
  1154.   credentials are sent to the host.  Default is OFF.
  1155.  
  1156. SET AUTHENTICATION KERBEROS5 GET-K4-TGT { ON, OFF }
  1157.   ON specifies that Kerberos 4 credentials should be requested each
  1158.   time Kerberos 5 credentials are requested with AUTH KERBEROS5 INIT.
  1159.   The default is OFF.
  1160.  
  1161. SET AUTHENTICATION KERBEROS4 INSTANCE <instance>
  1162.   Allows a Kerberos 4 instance to be specified as a default (if needed).
  1163.  
  1164. SET AUTHENTICATION { KERBEROS4, KERBEROS5 } LIFETIME <minutes>
  1165.   Specifies the lifetime of the TGTs requested from the KDC.  The default
  1166.   is 600 minutes (10 hours).
  1167.  
  1168. SET AUTHENTICATION KERBEROS4 PREAUTH { ON, OFF }
  1169.   Allows Kerberos 4 preauthenticated TGT requests to be turned off.  The
  1170.   default is ON.  Only use if absolutely necessary.  We recommend that
  1171.   preauthenticated requests be required for all tickets returned by a KDC
  1172.   to a requestor.
  1173.  
  1174. SET AUTHENTICATION { KERBEROS4, KERBEROS5 } PRINCIPAL <name>
  1175.   When Kermit starts, it attempts to set the principal name to that stored
  1176.   in the current credentials cache.  If no credential cache exists, the
  1177.   current SET LOGIN USERID value is used.  SET LOGIN USERID is set to the
  1178.   operating systems current username when Kermit is started.  To force
  1179.   Kermit to prompt the user for the principal name when requesting TGTs,
  1180.   place
  1181.  
  1182.     SET AUTH K4 PRINCIPAL {}
  1183.     SET AUTH K5 PRINCIPAL {}
  1184.  
  1185.   in the Kermit initialization file or connection script.
  1186.  
  1187. SET AUTHENTICATION { KERBEROS4, KERBEROS5 } PROMPT PASSWORD <prompt>
  1188.   Specifies a custom prompt to be used when prompting for a password.  The
  1189.   Kerberos prompt strings may contain two "%s" replacement fields.  The
  1190.   first %s is replaced by the principal name; the second by the realm.
  1191.  
  1192. SET AUTHENTICATION { KERBEROS4, KERBEROS5 } PROMPT PRINCIPAL <prompt>
  1193.   Specifies a custom prompt to be used when prompting for the Kerberos
  1194.   principal name.  No %s replacement fields may be included.  Kermit
  1195.   prompts for a principal name when retrieving a TGT if the command:
  1196.  
  1197.     SET AUTHENTICATION { KERBEROS4, KERBEROS5 } PRINCIPAL {}
  1198.  
  1199.   has been issued.
  1200.  
  1201. SET AUTHENTICATION KERBEROS5 PROXIABLE { ON, OFF }
  1202.   When ON, specifies that Kerberos 5 credentials should be proxiable.
  1203.   The default is OFF.
  1204.  
  1205. SET AUTHENTICATION KERBEROS5 RENEWABLE <minutes>
  1206.   When <minutes> is greater than the ticket lifetime a TGT may be
  1207.   renewed with AUTH K5 INIT /RENEW instead of granting a new ticket
  1208.   as long as the ticket is not expired and it's within the renewable
  1209.   lifetime.  Default is 0 (zero) minutes.
  1210.  
  1211. SET AUTHENTICATION { KERBEROS4, KERBEROS5 } REALM <name>
  1212.   If no default is set, the default realm configured for the Kerberos
  1213.   libraries is used.  Abbreviations are accepted.
  1214.  
  1215. SET AUTHENTICATION { KERBEROS4, KERBEROS5 } SERVICE-NAME <name>
  1216.   This command specifies the service ticket name used to authenticate
  1217.   to the host when Kermit is used as a client; or the service ticket
  1218.   name accepted by Kermit when it is acting as the host.
  1219.   If no default is set, the default service name for Kerberos 4 is
  1220.   "rcmd" and for Kerberos 5 is "host".
  1221.  
  1222. 6.2.2 SRP Set Commands
  1223.  
  1224. SET AUTHENTICATE SRP PROMPT PASSWORD <text>
  1225.   Specifies a custom prompt to be used when prompting for a password.
  1226.   <prompt> may contain a single instance of "%s" which is replaced
  1227.   by the user's login name.
  1228.  
  1229. 6.2.3 SSL and TLS (OpenSSL) Set Commands
  1230.  
  1231. In all of the following commands "SSL" and "TLS" are aliases.
  1232.  
  1233. SET AUTHENTICATE { SSL, TLS } CIPHER-LIST <list of ciphers>
  1234.   This command applies to both SSL and TLS.  A colon-separated list of any
  1235.   of the following (case-sensitive) options is accepted, depending on the
  1236.   options chosen when OpenSSL was compiled (without the doublequotes):
  1237.  
  1238.   Key Exchange Algorithms:
  1239.     "kRSA"      RSA key exchange
  1240.     "kDHr"      Diffie-Hellman key exchange (key from RSA cert)
  1241.     "kDHd"      Diffie-Hellman key exchange (key from DSA cert)
  1242.     "kEDH'      Ephemeral Diffie-Hellman key exchange (temporary key)
  1243.  
  1244.   Authentication Algorithm:
  1245.     "aNULL"     No authentication
  1246.     "aRSA"      RSA authentication
  1247.     "aDSS"      DSS authentication
  1248.     "aDH"       Diffie-Hellman authentication
  1249.  
  1250.   Cipher Encoding Algorithm:
  1251.     "eNULL"     No encodiing
  1252.     "DES"       DES encoding
  1253.     "3DES"      Triple DES encoding
  1254.     "RC4"       RC4 encoding
  1255.     "RC2"       RC2 encoding
  1256.     "IDEA"      IDEA encoding
  1257.  
  1258.   MAC Digest Algorithm:
  1259.     "MD5"       MD5 hash function
  1260.     "SHA1"      SHA1 hash function
  1261.     "SHA"       SHA hash function (should not be used)
  1262.  
  1263.   Aliases:
  1264.     "ALL"       all ciphers
  1265.     "SSLv2"     all SSL version 2.0 ciphers (should not be used)
  1266.     "SSLv3"     all SSL version 3.0 ciphers
  1267.     "EXP"       all export ciphers (40-bit)
  1268.     "EXPORT56"  all export ciphers (56-bit)
  1269.     "LOW"       all low strength ciphers (no export)
  1270.     "MEDIUM"    all ciphers with 128-bit encryption
  1271.     "HIGH"      all ciphers using greater than 128-bit encryption
  1272.     "RSA"       all ciphers using RSA key exchange
  1273.     "DH"        all ciphers using Diffie-Hellman key exchange
  1274.     "EDH"       all ciphers using Ephemeral Diffie-Hellman key exchange
  1275.     "ADH"       all ciphers using Anonymous Diffie-Hellman key exchange
  1276.     "DSS"       all ciphers using DSS authentication
  1277.     "NULL"      all ciphers using no encryption
  1278.  
  1279. Each item in the list may include a prefix modifier:
  1280.  
  1281.     "+"         move cipher(s) to the current location in the list
  1282.     "-"         remove cipher(s) from the list (may be added again by
  1283.                 a subsequent list entry)
  1284.     "!"         kill cipher from the list (it may not be added again
  1285.                 by a subsequent list entry)
  1286.  
  1287. If no modifier is specified the entry is added to the list at the current
  1288. position.  "+" may also be used to combine tags to specify entries such as
  1289. "RSA+RC4" describes all ciphers that use both RSA and RC4.
  1290.  
  1291. For example, all available ciphers not including ADH key exchange:
  1292.  
  1293.   ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
  1294.  
  1295. All algorithms including ADH and export but excluding patented algorithms:
  1296.  
  1297.   HIGH:MEDIUM:LOW:EXPORT56:EXP:ADH:!kRSA:!aRSA:!RC4:!RC2:!IDEA
  1298.  
  1299. The OpenSSL command
  1300.  
  1301.   openssl ciphers -v <list of ciphers>
  1302.  
  1303. may be used to list all of the ciphers and the order described by a specific
  1304. <list of ciphers>.
  1305.  
  1306. SET AUTHENTICATE { SSL, TLS } CRL-DIR <directory>
  1307.   Specifies a directory that contains certificate revocation files, where
  1308.   each file is named by the hash of the certificate issuer name.
  1309.  
  1310.   OpenSSL expects the hash symlinks to be made like this:
  1311.  
  1312.     ln -s crl.pem `openssl crl -hash -noout -in crl.pem`.r0
  1313.  
  1314.   Since all file systems do not have symlinks you can use the following
  1315.   command in Kermit to copy the crl.pem file to the hash file name:
  1316.  
  1317.      copy crl.pem {\fcommand(openssl crl -hash -noout -in crl.pem).r0}
  1318.  
  1319.   This produces a hash based on the issuer field in the CRL such
  1320.   that the issuer field of a Cert may be quickly mapped to the
  1321.   correct CRL.
  1322.  
  1323. SET AUTHENTICATE { SSL, TLS } CRL-FILE <filename>
  1324.   Specifies a file that contains a list of certificate revocations.
  1325.  
  1326. SET AUTHENTICATE { SSL, TLS } DEBUG { ON, OFF }
  1327.   Tells whether debug information should be displayed about the SSL/TLS
  1328.   connection.  When DEBUG is ON, the VERIFY command does not terminate
  1329.   connections when set to FAIL-IF-NO-PEER-CERT and a certificate is
  1330.   presented that cannot be successfully verified; instead each error is
  1331.   displayed but the connection automatically continues.
  1332.  
  1333. SET AUTHENTICATE { SSL, TLS } DH-PARAM-FILE <filename>
  1334.   Specifies a file containing DH parameters which are used to generate
  1335.   temporary DH keys.  If a DH parameter file is not provided Kermit uses a
  1336.   fixed set of parameters depending on the negotiated key length.  Kermit
  1337.   provides DH parameters for key lengths of 512, 768, 1024, 1536, and 2048
  1338.   bits.
  1339.  
  1340. SET AUTHENTICATE { SSL, TLS } DSA-CERT-FILE <filename>
  1341.   Specifies a file containing a DSA certificate to be sent to the peer to
  1342.   authenticate the host or end user.  The file may contain the matching DH
  1343.   private key instead of using the DSA-KEY-FILE command.
  1344.  
  1345. SET AUTHENTICATE { SSL, TLS } DSA-KEY-FILE <filename>
  1346.   Specifies a file containing the private DH key that matches the DSA
  1347.   certificate specified with DSA-CERT-FILE.  This command is only necessary
  1348.   if the private key is not appended to the certificate in the file
  1349.   specified by DSA-CERT-FILE.
  1350.  
  1351. Note: When Kermit is running as an IKSD it cannot support encrypted private
  1352. keys.  If your private key file is encrypted you can use the following command
  1353. to unencrypted (provided you know that pass phrase):
  1354.  
  1355.   openssl dsa -in <encrypted-key-file> -out <unencrypted-key-file>
  1356.  
  1357. SET AUTHENTICATE { SSL, TLS } RSA-CERT-FILE <filename>
  1358.   Specifies a file containing a RSA certificate to be sent to the peer to
  1359.   authenticate the host or end user.  The file may contain the matching RSA
  1360.   private key instead of using the RSA-KEY-FILE command.
  1361.  
  1362. SET AUTHENTICATE { SSL, TLS } RSA-KEY-FILE <filename>
  1363.   Specifies a file containing the private RSA key that matches the RSA
  1364.   certificate specified with RSA-CERT-FILE.  This command is only necessary
  1365.   if the private key is not appended to the certificate in the file
  1366.   specified by RSA-CERT-FILE.
  1367.  
  1368. Note: When Kermit is running as an IKSD it cannot support encrypted private
  1369. keys.  If your private key file is encrypted you can use the following command
  1370. to unencrypted (provided you know that pass phrase):
  1371.  
  1372.   openssl rsa -in <encrypted-key-file> -out <unencrypted-key-file>
  1373.  
  1374. SET AUTHENTICATE { SSL, TLS } VERBOSE { ON, OFF }
  1375.   Specifies whether information about the authentication (the certificate
  1376.   chain) should be displayed upon making a connection.
  1377.  
  1378. SET AUTHENTICATE { SSL, TLS } VERIFY { NO, PEER-CERT, FAIL-IF-NO-PEER-CERT }
  1379.   Specifies whether certificates should be requested from the peer; whether
  1380.   they should be verified when they are presented; and whether they should
  1381.   be required.  When set to NO (the default for IKSD), Kermit does not
  1382.   request that the peer send a certificate and if one is presented it is
  1383.   ignored.  When set to PEER-CERT (the default when not IKSD), Kermit
  1384.   requests a certificate be sent by the peer.  If the certificate is
  1385.   presented, it is verified.  Any errors during the verification process
  1386.   result in queries to the end user.  When set to FAIL-IF-NO-PEER-CERT,
  1387.   Kermit asks the peer to send a certificate.  If the certificate is not
  1388.   presented or fails to verify successfully, the connection is terminated
  1389.   without querying the user.
  1390.  
  1391.   If an anonymous cipher (i.e., ADH) is desired the NO setting must be
  1392.   used; otherwise the receipt of the peer certificate request is
  1393.   interpreted as a protocol error and the negotiation fails.
  1394.  
  1395.   If you wish to allow the peer to authenticate using either an X.509
  1396.   certificate to userid mapping function or via use of a ~/.tlslogin file,
  1397.   you must use either PEER-CERT or FAIL-IF-NO-PEER-CERT.  Otherwise, any
  1398.   certificates that are presented are ignored.  In other words, use NO if
  1399.   you want to disable the ability to use certificates to authenticate a
  1400.   peer.
  1401.  
  1402. SET AUTHENTICATE { SSL, TLS } VERIFY-DIR <directory>
  1403.   Specifies a directory that contains root CA certificate files used to
  1404.   verify the certificate chains presented by the peer.  Each file is named
  1405.   by a hash of the certificate.
  1406.  
  1407.   OpenSSL expects the hash symlinks to be made like this:
  1408.  
  1409.     ln -s cert.pem `openssl x509 -hash -noout -in cert.pem`.0
  1410.  
  1411.   Since all file systems do not have symlinks you can use the following
  1412.   command in Kermit to copy the cert.pem file to the hash file name:
  1413.  
  1414.      copy cert.pem {\fcommand(openssl x509 -hash -noout -in cert.pem).0}
  1415.  
  1416.   This produces a hash based on the subject field in the cert such that the
  1417.   certificate may be quickly found.
  1418.  
  1419. SET AUTHENTICATE { SSL, TLS } VERIFY-FILE <file>
  1420.   Specifies a file that contains root CA certificates to be used for
  1421.   verifying certificate chains.
  1422.  
  1423.  
  1424. 6.3. The AUTHENTICATE Command (Kerberos Only)
  1425.  
  1426. The AUTHENTICATE command obtains or destroys Kerberos tickets and lists
  1427. information about them.  The general format is:
  1428.  
  1429.   AUTHENTICATE { KERBEROS4, KERBEROS5 [ switches ] } <action> [ switches ]
  1430.  
  1431. The use of command switches is described in ckermit2.txt, section 1.5.
  1432. The actions are INITIALIZE, DESTROY, and LIST-CREDENTIALS:
  1433.  
  1434.   AUTH {K4,K5} { INITIALIZE [switches], DESTROY, LIST-CREDENTIALS [switches] }
  1435.  
  1436. The INITIALIZE command is the most complex, and its format is different for
  1437. Kerberos 4 and Kerberos 5.  For Kerberos 4, the format is:
  1438.  
  1439. AUTH K4 INITIALIZE [ /INSTANCE:<name> /LIFETIME:<minutes> -
  1440.   /PASSWORD:<password> /PREAUTH /REALM:<name> <principal> ]
  1441.  
  1442. All switches are optional.  Kerberos 4 INITIALIZE switches are as follows:
  1443.  
  1444. /INSTANCE:<name>
  1445.   Allows an Instance to be specified (see Glossary).
  1446.  
  1447. /LIFETIME:<number>
  1448.   Specifies the requested lifetime in minutes for the ticket.  If no lifetime
  1449.   is specified, 600 minutes is used.  If the lifetime is greater than the
  1450.   maximum supported by the ticket granting service, the resulting lifetime
  1451.   is shortened accordingly.
  1452.  
  1453. /NOT-PREAUTH
  1454.   Instructs Kermit to send a ticket granting ticket (TGT) request to the KDC
  1455.   without any preauthentication data.
  1456.  
  1457. /PASSWORD:<string>
  1458.   Allows the inclusion of a password in a script file.  If no /PASSWORD switch
  1459.   is included, you are prompted on a separate line.  The password switch is
  1460.   provided for use by automated scripts.  However, we strongly recommend that
  1461.   it not be used because clear text passwords can be easily compromised.
  1462.  
  1463. /PREAUTH
  1464.   Instructs Kermit to send a preauthenticated ticket granting ticket (TGT)
  1465.   request to the KDC instead of a plaintext request.  The default when
  1466.   supported by the Kerberos libraries.
  1467.  
  1468. /REALM:<name>
  1469.   Allows an alternative Realm to be specified (see Glossary).
  1470.  
  1471. <principal>
  1472.   may be of the form:
  1473.   userid[.instance[.instance]]@[realm]
  1474.   Can be omitted if it is the same as your username or SET LOGIN USERID
  1475.   value on the client system.
  1476.  
  1477. The format for Kerberos 5 is as follows:
  1478.  
  1479. AUTH K5 [ /CACHE:<filename> ] { INITIALIZE ..., DESTROY, LIST-CREDENTIALS ...}
  1480.  
  1481. The INITIALIZE command for Kerberos 5 can include a number of switches;
  1482. all are optional:
  1483.  
  1484. AUTH K5 [ /CACHE:<filename> ] INITITIALIZE [ /ADDRESSES:<addr-list>
  1485.   /FORWARDABLE /KERBEROS4 /LIFETIME:<minutes> /PASSWORD:<password>
  1486.   /POSTDATE:<date-time> /PROXIABLE /REALM:<name> /RENEW /RENEWABLE:<minutes>
  1487.   /SERVICE:<name> /VALIDATE <principal> ]
  1488.  
  1489. Kerberos 5 INITIALIZE switches are:
  1490.  
  1491. /ADDRESSES:{list of ip-addresses}
  1492.   Specifies a list of IP addresses that should be placed in the Ticket
  1493.   Granting Ticket in addition to the local machine addresses.
  1494.  
  1495. /FORWARDABLE
  1496.   Requests forwardable tickets.
  1497.  
  1498. /KERBEROS4
  1499.   Instructs Kermit to get Kerberos 4 tickets in addition to Kerberos 5
  1500.   tickets.  If Kerberos 5 tickets are not supported by the server, a mild
  1501.   warning is printed and Kerberos 4 tickets are requested.
  1502.  
  1503. /LIFETIME:<number>
  1504.   Specifies the requested lifetime in minutes for the ticket.  If no
  1505.   lifetime is specified, 600 minutes is used.  If the lifetime is greater
  1506.   than the maximum supported by the ticket granting service, the resulting
  1507.   lifetime is shortened.
  1508.  
  1509. /NO-KERBEROS4
  1510.   Instructs Kermit to not attempt to retrieve Kerberos 4 credentials.
  1511.  
  1512. /NOT-FORWARDABLE
  1513.   Requests non-forwardable tickets.
  1514.  
  1515. /NOT-PROXIABLE
  1516.   Requests non-proxiable tickets.
  1517.  
  1518. /PASSWORD:<string>
  1519.   Allows the inclusion of a password in a script.  If no password is
  1520.   specified you are prompted for one.  The password switch is provided for
  1521.   use by automated scripts.  However, we strongly recommend that it not be
  1522.   used because clear-text passwords can be easily compromised.  See Chapter
  1523.   19 of "Using C-Kermit".
  1524.  
  1525. /POSTDATE:<date-time>
  1526.   Requests a postdated ticket, valid starting at <date-time>.  Postdated
  1527.   tickets are issued with the invalid flag set, and need to be fed back to
  1528.   the KDC before use with the /VALIDATE switch.  See ckermit2.txt section
  1529.   1.6 for acceptable date-time formats.
  1530.  
  1531. /PROXIABLE
  1532.   Requests proxiable tickets.
  1533.  
  1534. /REALM:<string>
  1535.   Allows an alternative realm to be specified.
  1536.  
  1537. /RENEW
  1538.   Requests renewal of a renewable Ticket Granting Ticket.  Note that
  1539.   an expired ticket cannot be renewed even if it is within its renewable
  1540.   lifetime.
  1541.  
  1542. /RENEWABLE:<number>
  1543.   Requests renewable tickets, with a total lifetime of <number> minutes.
  1544.  
  1545. /SERVICE:<string>
  1546.   Allows a service other than the ticket granting service to be specified.
  1547.  
  1548. /VALIDATE
  1549.   Requests that the Ticket Granting Ticket in the cache (with the invalid
  1550.   flag set) be passed to the KDC for validation.  If the ticket is within
  1551.   its requested time range, the cache is replaced with the validated
  1552.   ticket.
  1553.  
  1554. <principal>
  1555.   May be of the form:
  1556.     userid[/instance][@realm]
  1557.   Can be omitted if it is the same principal as stored in the current ticket
  1558.   cache at the time Kermit started; or the current username if a ticket
  1559.   cache did not exist.
  1560.  
  1561. Note: Kerberos 5 always attempts to retrieve a Ticket Granting Ticket (TGT)
  1562. using the preauthenticated TGT request.
  1563.  
  1564. AUTHORIZE K5 LIST-CREDENTIALS [ /ADDRESSES /ENCRYPTION /FLAGS ]
  1565.   Shows start time, expiration time, service or principal name, plus
  1566.   the following additional information depending the switches:
  1567.  
  1568. /ADDRESSES
  1569.   Displays the hostnames and/or IP addresses embedded within the
  1570.   tickets.
  1571.  
  1572. /ENCRYPTION displays the encryption used by each ticket (if applicable):
  1573.   DES-CBC-CRC
  1574.   DES-CBC-MD4
  1575.   DES-CBC-MD5
  1576.   DES3-CBC-SHA
  1577.  
  1578. /FLAGS provides the following information (if applicable) for each ticket:
  1579.   F - Ticket is Forwardable
  1580.   f - Ticket was Forwarded
  1581.   P - Ticket is Proxiable
  1582.   p - Ticket is a Proxy
  1583.   D - Ticket may be Postdated
  1584.   d - Ticket has been Postdated
  1585.   i - Ticket is Invalid
  1586.   R - Ticket is Renewable
  1587.   I - Ticket is the Initial Ticket
  1588.   H - Ticket has been authenticated by Hardware
  1589.   A - Ticket has been Pre-authenticated
  1590.  
  1591. 6.4. OTHER SECURITY-RELATED COMMANDS
  1592.  
  1593. SET TCP ADDRESS [ <ip-address> ]
  1594.   Specify the IP address of the computer that C-Kermit is running on.
  1595.   Normally this is not necessary.  The exceptions would be if the host is
  1596.   multihomed (e.g. one host pointed to by many IP addresses, or one of many
  1597.   hosts pointed to by a "common" IP address) or has multiple physical network
  1598.   adapters, with a different address for each adapter, AND you want C-Kermit
  1599.   to either (a) accept an incoming TCP connection ("set host *") or (b) get a
  1600.   Kerberos ticket.
  1601.  
  1602. SET TCP REVERSE-DNS-LOOKUP { ON, OFF }
  1603.   Specifies whether or not a Reverse DNS Lookup should be performed to
  1604.   determine the hostname assigned to the IP address used to connect to the
  1605.   host.
  1606.  
  1607.   In order for mutual authentication to succeed, the client and the server
  1608.   must agree on the name to be used for the server.  It is common for servers
  1609.   to have more than one name.  This is especially true for clusters of servers
  1610.   that provide the same function and are referenced by an alias.  For instance
  1611.   www.foo.com might be an alias for three machines www-1.foo.com,
  1612.   www-2.foo.com, and www-3.foo.com.  If the hosts are configured to use
  1613.   separate credentials for authentication it will be necessary to know which
  1614.   host is actually in use since "www.foo.com" is not equal to "www-1.foo.com".
  1615.  
  1616.   On the other hand, since DNS is not a secure service, using an additional
  1617.   lookup to verify the name associated with a particular IP address increases
  1618.   the susceptibility that the authentication may be forged by an attacker.
  1619.  
  1620.   For the highest level of security, Reverse DNS Lookups should be turned OFF.
  1621.  
  1622.  
  1623. 7. EFFECTS OF ENCRYPTION ON FILE TRANSFER PERFORMANCE
  1624.  
  1625. Encryption and the subsequent decryption of a data stream can result in 10%
  1626. to 60% reduction in file transfer performance depending on the encryption
  1627. algorithm.  Encrypted data streams are uncompressible, thus reducing
  1628. throughput on PPP connections.
  1629.  
  1630.  
  1631. 8. MULTI-HOMED HOSTS AND NETWORK ADDRESS TRANSLATORS
  1632.  
  1633. Kermit is designed to allow authentication with hosts whose names resolve to
  1634. multiple (randomized) IP addresses.
  1635.  
  1636. However, this does not always work on Windows 95 or Windows NT 3.5x due to
  1637. their caching of DNS information.  For instance, at Columbia University the
  1638. CUNIX name resolves to one of six machines, each with a different name, such
  1639. as HOSTA, HOSTB, etc.  When telneting to CUNIX, you might be given IP address
  1640. 128.59.35.136.  But even though the DNS servers are properly configured to
  1641. return the proper name (e.g. HOSTB) for that IP address, Windows 95 returns
  1642. CUNIX because it retrieves the information from its internal cache instead of
  1643. performing another network call.  This means that instead of retrieving a
  1644. ticket for the service:
  1645.  
  1646.   rcmd.hostb@CC.COLUMBIA.EDU
  1647.  
  1648. we get a ticket for:
  1649.  
  1650.   rcmd.cunix@CC.COLUMBIA.EDU
  1651.  
  1652. This use of the wrong ticket produces the following error: "Can't decode
  1653. authenticator (krb_rd_req)".
  1654.  
  1655. Kerberos 4 has no problems with NATs but fails with Multihomed systems.  Why?
  1656. A K4 ticket has room for only a single IP address and that IP address is
  1657. assigned not by the client but by the KDC.  The result is that when K4 is
  1658. used from behind a NAT the IP address that is placed into the ticket is the
  1659. IP address of the NAT, not the IP address of the client machine.  This means
  1660. the ticket is good only on the far side of the NAT and not on the near side.
  1661. It also means that when a K4 ticket is used with a multihomed host that the
  1662. ticket is good only on the interface that was used to acquire the ticket in
  1663. the first place.
  1664.  
  1665. Kerberos 5 has no problems with multihomed hosts because the ticket supports
  1666. multiple IP addresses and those IP addresses are inserted into the ticket by
  1667. the client, not by the KDC.  However, this also means that K5 fails when it
  1668. is used through a NAT.  The address in the ticket is the private IP address
  1669. and not the address that the KDC sees.  This can be worked around if the
  1670. client uses a kinit that allows a list of additional IP addresses to be
  1671. specified for inclusion in the TGT.  Kermit supports this capability with the
  1672.  
  1673.   AUTH K5 INIT /ADDRESSES:{list of addresses}
  1674.  
  1675. command.  The only problem is that in most cases the end user does not
  1676. know what the IP addresses is on the far side of the NAT.
  1677.  
  1678. 9. OTHER NOTES
  1679.  
  1680. In Kermit 95, the authentication type and encryption levels are displayed in
  1681. the terminal-screen status Line as follows:
  1682.  
  1683.   K4  - Kerberos IV
  1684.   K5  - Kerberos V
  1685.   NTLM- NT Lan Manager
  1686.   SRP - Secure Remote Password
  1687.  
  1688.   pp  - No encryption
  1689.   Ep  - Encryption to host, plaintext from host
  1690.   pD  - Plaintext to host, encryption from host
  1691.   ED  - Encryption both directions
  1692.   SSL - Secure Sockets Layer (both directions)
  1693.   TLS - Transport Layer Security (both directions)
  1694.  
  1695. Encrypted sessions become unreadable if even one bit of data is inserted into
  1696. or deleted from the data stream.  One damaged bit results in nine damaged
  1697. bytes but subsequent bytes remain readable.  But since TCP/IP is a reliable
  1698. transport by definition, none of this should occur.
  1699.  
  1700. Windows login names are not case-sensitive.  However, Unix login names are.
  1701. If the Unix login name is "fred" but Windows was logged in using the name
  1702. "Fred", authentication appears to succeed but telnetd closes the connection
  1703. after Telnet negotiations are complete.  There are several solutions to this
  1704. problem:
  1705.  
  1706.  . Make sure the Windows login name is case identical to the Unix login name.
  1707.    (If Windows has recorded the login in the registry as "Fred" it won't
  1708.    matter if you login to Windows using "fred".  The only way to correct
  1709.    this problem is to edit the Registry.)
  1710.  
  1711.  . Use the SET LOGIN USERID <name> command to set the proper login name
  1712.    before connecting to the telnet server.
  1713.  
  1714.  . Use the SET AUTHENTICATE { KERBEROS4, KERBEROS5 } PRINCIPAL <name> command
  1715.    to set the proper principal name before connecting to the telnet server.
  1716.  
  1717.  . Specify the remote username in the <principal> of your AUTHENTICATE Kxxx
  1718.    INITIALIZE command.
  1719.  
  1720. Kermit adjusts the case of the name if and only if a case insensitive
  1721. comparison of the SET LOGIN USERID name and the name in the authentication
  1722. ticket shows no differences.
  1723.  
  1724.  
  1725. 10. VARIABLES
  1726.  
  1727. 10.1 GENERAL AUTHENTICATION VARIABLES
  1728.  
  1729. \v(authname)  - Only valid when Kermit is accepting a connection.  This
  1730.                 variable contains the name of the user that has been
  1731.                 authenticated as opposed to \v(userid) which contains the
  1732.                 name the user chose to login as.  This distinction is
  1733.                 important for \v(authstate) = "user" since this means that
  1734.                 although we were able to authenticate the user as \v(authname)
  1735.                 we could not verify that she has authorization to access
  1736.                 the account of \v(userid).
  1737.  
  1738. \v(authstate) - String indicating current state of authentication:
  1739.                 "rejected" - Rejected or otherwise not authenticated
  1740.                 "unknown"  - Anonymous connection
  1741.                 "other"    - We know him, but not his name
  1742.                 "user"     - We know his name
  1743.                 "valid"    - We know him, and he needs no password
  1744.  
  1745. \v(authtype) - String indicating which telnet (or other) authentication method
  1746.                is in use.
  1747.                "NULL"              - No authentication
  1748.                "KERBEROS_V4"       - Kerberos 4
  1749.                "KERBEROS_V5"       - Kerberos 5
  1750.                "SRP"               - Secure Remote Password
  1751.                "NTLM"              - NT Lan Manager
  1752.                "X_509_CERTIFICATE" - X.509 certificate
  1753.  
  1754.  
  1755. 10.2 KERBEROS VARIABLES
  1756.  
  1757. \v(krb5cc)    - Current kerberos V credentials cache.
  1758. \v(krb5princ) - Current kerberos V principal name.
  1759. \v(krb5realm) - Current kerberos V realm name.
  1760. \v(krb5errno) - Last Kerberos V errno
  1761. \v(krb5errmsg)- Last Kerberos V error message
  1762.  
  1763. \v(krb4princ) - Current kerberos IV principal name.
  1764. \v(krb4realm) - Current kerberos IV realm name.
  1765. \v(krb4errno) - Last Kerberos IV errno
  1766. \v(krb4errmsg)- Last Kerberos IV error message
  1767.  
  1768. 10.3 SSL/TLS VARIABLES
  1769.  
  1770. \v(x509_issuer)  - The issuer string from the peer's X.509 certificate
  1771. \v(x509_subject) - The subject string from the peer's X.509 certificate
  1772.  
  1773.  
  1774. 11. FUNCTIONS
  1775.  
  1776. All Kerberos functions require the Kerberos version number, 4 or 5, as the
  1777. first argument (n).
  1778.  
  1779. \fkrbtickets(n)
  1780.   The number of active Kerberos n (4 or 5) tickets.  This resets the
  1781.   ticket list used by \fkrbnextticket(n).
  1782.  
  1783. \fkrbnextticket(n)
  1784.   The next ticket in the Kerberos n (4 or 5) ticket list that was set up by
  1785.   the most recent invocation of \fkrbtickets(n).
  1786.  
  1787. \fkrbisvalid(n,name)
  1788.   The name is a ticket name, as returned by \fkrbnextticket(n).  Returns
  1789.   1 if the ticket is valid, 0 if not valid.  A ticket is valid if all the
  1790.   following conditions are true:
  1791.  
  1792.     (i)   it exists in the current cache file;
  1793.     (ii)  it is not expired;
  1794.     (iii) it is not marked invalid (K5 only);
  1795.     (iv)  it was issued from the current IP address
  1796.  
  1797.   This value can be used in an IF statement, e.g.:
  1798.  
  1799.     if \fkrbisvalid(4,krbtgt.FOO.BAR.EDU@FOO.BAR.EDU) ...
  1800.  
  1801. \fkrbtimeleft(n,name)
  1802.   The name is a ticket name, as returned by \fkrbnextticket(n).  Returns
  1803.   the number of seconds remaining in the ticket's lifetime.
  1804.  
  1805. \fkrbflags(n,name)
  1806.   The name is a ticket name, as returned by \fkrbnextticket(n).  Returns
  1807.   the flags string as reported with AUTH K5 LIST /FLAGS.  This string can
  1808.   be searched for a particular flag using the \findex() function when
  1809.   SET CASE is ON (for case sensitive searches).  Flag strings are only
  1810.   available for K5 tickets.
  1811.  
  1812. Kerberos 5 functions operate against the current credential-cache file as set
  1813. by SET AUTHORIZATION K5 CREDENTIALS-FILE <filename>.
  1814.  
  1815.  
  1816. 12. SCRIPTING HINTS
  1817.  
  1818. 12.1.  Kerberos Autoget
  1819.  
  1820. When developing scripts to be used without user interaction you should turn
  1821. off the Kerberos AutoGet TGT feature with
  1822.  
  1823.   SET AUTHENTICATION KERBEROS4 AUTOGET OFF
  1824.   SET AUTHENTICATION KERBEROS5 AUTOGET OFF
  1825.  
  1826. When autoget mode is disabled, Kermit does not automatically perform the
  1827. function of KINIT. Instead this automation can be scripted; for example:
  1828.  
  1829.   SET TELOPT AUTHENTICATION REQUIRED
  1830.   SET HOST <host>:<port> /TELNET
  1831.   IF FAILURE {
  1832.       AUTHENTICATE K4 INIT ; (or K5)
  1833.       SET HOST <host>:<port>
  1834.       IF FAILURE { do whatever on failure }
  1835.   }
  1836.  
  1837. or place the following in your K95CUSTOM.INI file to insure a valid
  1838. Ticket Granting Ticket each time you start K95:
  1839.  
  1840.   IF AVAILABLE KERBEROS4 {
  1841.     IF NOT \Fkrbisvalid(4,krbtgt.\v(krb4realm)@\v(krb4realm)) {
  1842.       echo Kerberos 4 Ticket Granting Ticket is invalid!
  1843.       AUTH K4 INIT
  1844.     }
  1845.   }
  1846.  
  1847.   IF AVAILABLE KERBEROS5 {
  1848.     IF NOT \Fkrbisvalid(5,krbtgt/\v(krb5realm)@\v(krb5realm)) {
  1849.       echo Kerberos 5 Ticket Granting Ticket is invalid!
  1850.       AUTH K5 INIT
  1851.     }
  1852.   }
  1853.  
  1854.  
  1855. 12.2. Autodestruction of Kerberos Credentials
  1856.  
  1857. When Kermit is used on a machine in a public lab and Kerberos is used for
  1858. authentication it is often desireable to not have the Kerberos credentials
  1859. survive the current session.  To automate the destruction of Kerberos
  1860. credentials use:
  1861.  
  1862.    SET AUTH {K4, K5} AUTODESTROY { ON-CLOSE, ON-EXIT }
  1863.  
  1864. 12.3.  Automated prompting for usernames
  1865.  
  1866. To prevent Kermit from using the username reported by the local operating
  1867. system for the remote userid and kerberos principal use:
  1868.  
  1869.   SET LOGIN USERID {}
  1870.   SET AUTHENTICATION KERBEROS4 PRINCIPAL {}
  1871.   SET AUTHENTICATION KERBEROS5 PRINCIPAL {}
  1872.  
  1873. This forces Kermit to prompt the user for the userid and principal
  1874. when requesting credentials.
  1875.  
  1876. 12.4.  Password Inclusion in Script Files
  1877.  
  1878. Although it is not recommended (since storing passwords openly in a file,
  1879. especially on a PC, is a serious security risk), connections may be scripted
  1880. without user interaction:
  1881.  
  1882.   SET HOST /PASSWORD:<password> /USERID:<user> <host> <port> /TELNET
  1883.  
  1884. The security risk can be avoided if the script prompts for the password:
  1885.  
  1886.   ASKQ \%p Password:
  1887.   SET HOST PASSWORD:\%p /USERID:<user> <host> <port> /TELNET
  1888.   UNDEF \%p
  1889.  
  1890. Of course, if the /PASSWORD switch is not specified Kermit prompts for the
  1891. password automatically when the host requests the use of authentication.
  1892.  
  1893. 12.5   Using Kermit Scripts to Produce Secure Telnet Services
  1894.  
  1895. The following series of commands causes a Kermit script to accept only
  1896. authenticated and encrypted connections:
  1897.  
  1898.   SET TELOPT /SERVER AUTH REQUIRE
  1899.   SET TELOPT /SERVER ENCRYPT REQUIRE REQUIRE
  1900.   SET HOST * <port> /TELNET
  1901.   IF FAILURE { do appropriate error handling }
  1902.  
  1903. The \v(authstate) variable tells the script which level of authentication has
  1904. been achieved.  If the value is "valid" that means that the account specified
  1905. by \v(userid) has been authenticated and authorized for use by \v(authname).
  1906. If the value of \v(authstate) is "user" then \v(authname) has been
  1907. authenticated but she does not have known authorization to access the account
  1908. \v(userid).  This usually means that some additional verification is needed.
  1909.  
  1910.   IF EQ "\v(authstate)" "valid" {
  1911.     proceed without further authorization
  1912.   }
  1913.   IF EQ "\v(authstate)" "user" {
  1914.     perform further authorization before providing service
  1915.   }
  1916.  
  1917. It is important to realize that when a Kermit script is used in this manner,
  1918. the Telnet negotiations provide authentication of the user and potentially
  1919. encryption of the data communication.  There is no facility in a Kermit script
  1920. to change the ownership of the currently running process from the user that
  1921. started it to the user ID of the authenticated user.  This means that the
  1922. script the authenticated user is accessing has all of the privileges of the
  1923. process executer and not the authenticated user.
  1924.  
  1925. Another important fact to remember is that secure access to an insecure
  1926. environment is not secure.  If you are using Windows 95 or 98 to run scripts,
  1927. while it is possible to use Kerberos or SRP to authenticate the incoming
  1928. clients, the insecure nature of the Windows environment means that it is
  1929. impossible for the Kerberos service key tables and SRP password databases to
  1930. be protected from tampering; the security in this case is no stronger than
  1931. than the security of Windows 9x.
  1932.  
  1933. 13. USING OTHER SECURITY METHODS WITH KERMIT
  1934.  
  1935. Other protocols can be used to create secure connections that are not
  1936. currently implemented in Kermit, such as Secure Shell (SSH).  The fact that
  1937. SSH is not integrated into Kermit software does not mean that Kermit cannot
  1938. be used in conjunction with it.  SSH provides for tunneling, which allows a
  1939. localhost proxy to be configured to take insecure connections on the local
  1940. machine and connect them via secure connections to remote hosts.
  1941.  
  1942. Secure connection clients can be used as the communication channel in C-Kermit
  1943. 7.0 and Kermit 95 1.1.16 via the PTY (Unix only) and PIPE commands.
  1944. See Section 2.7 of ckermit2.txt for details.
  1945.  
  1946. Firewalls based on access lists, proxies, and SOCKS do not provide secure
  1947. connections.  However, they do restrict the ports that may be used to
  1948. communicate between the Internet and the Intranet which makes it more
  1949. difficult for someone to break into the Intranet from outside.  They do not
  1950. protect the network from internal attacks nor do they protect a connection,
  1951. once made, from eavesdropping or hijacking.  They may be used in conjunction
  1952. with secure connection systems but should not be used as a replacement for
  1953. them.  (The Windows 95 and NT versions of Kermit 95 do not support SOCKS; the
  1954. OS/2 version has built-in support for SOCKS4.  C-Kermit can be built as a
  1955. SOCKS client if you have a SOCKS library; otherwise you can run SOCKSified
  1956. Telnet or Rlogin clients through C-Kermit with the PIPE command.)
  1957.  
  1958. NEC distributes a SOCKS5 Winsock shim for Windows 9x/NT at
  1959.  
  1960.   ftp://ftp.nec.co.jp/pub/packages/sotools/
  1961.  
  1962. 13.1  Implementing Other Security Methods for Kermit 95
  1963.  
  1964. Kermit 95 provides an interface that allows it to use a DLL to provide an
  1965. alternative mechanism for implementing secure communication methods.  The DLL
  1966. is loaded via a network type command:
  1967.  
  1968.   SET NETWORK TYPE DLL <dll-file>
  1969.  
  1970. The connection is then made with a SET HOST command
  1971.  
  1972.   SET HOST <command line>
  1973.  
  1974. where the <command line> is passed to the DLL after the normal Kermit quoting
  1975. rules are applied.
  1976.  
  1977. /* Kermit 95 - External Network DLL specification
  1978.  * July 16 1998
  1979.  * Jeffrey Altman <jaltman@columbia.edu>
  1980.  *
  1981.  * The following specification defines a set of functions to be exported from
  1982.  * a DLL in order for the DLL to work with Kermit 95 version 1.1.17 or higher.
  1983.  *
  1984.  * The DLL is loaded by Kermit 95 via use of the command:
  1985.  *   SET NETWORK TYPE DLL <dllname>
  1986.  *
  1987.  * Notes:
  1988.  *   The functions specified here must be thread safe.  It is possible
  1989.  *   for multiple threads to be calling any combination of functions
  1990.  *   simultaneously.
  1991.  *
  1992.  *   The 1.1.17 interface does not provide for the ability of the
  1993.  *   DLL to query the user with echoing input, nor is the a method
  1994.  *   for querying the values of Kermit variables such as 'userid'
  1995.  *   or Kermit version number.  This will be added in a later release.
  1996.  */
  1997.  
  1998.  
  1999. /*
  2000.  * N E T O P E N - Network Open
  2001.  *
  2002.  * The network open function is called by Kermit 95 when a new connection
  2003.  * is desired.  Usually in response to:
  2004.  *    SET HOST <command_line>
  2005.  *
  2006.  * Parameters:
  2007.  *   command_line - the command line specified in the SET HOST command
  2008.  *                  after quoting rules and variables have been applied.
  2009.  *   termtype     - a string representing either the currently selected
  2010.  *                  terminal type or a user specified string as per
  2011.  *                  SET TELNET TERMINAL <string>
  2012.  *   height       - initial height of the terminal window (chars)
  2013.  *   width        - initial width of the terminal window (chars)
  2014.  *   readpass     - a pointer to a function to be used to read a password
  2015.  *                  without echoing
  2016.  *
  2017.  * Return values:
  2018.  *   0   on success
  2019.  *   < 0 on failure
  2020.  *
  2021.  *   return codes should be defined such that they can be passed to
  2022.  *   errorstr() to retrieve an appropriate error message for the user.
  2023.  */
  2024.  
  2025. int
  2026. netopen(char * command_line, char * termtype, int height, int width,
  2027.         int (* readpass)(char * prompt,char * buffer, int length));
  2028.  
  2029. /*
  2030.  * N E T C L O S - Network Close
  2031.  *
  2032.  * The network close function is called by Kermit 95 when the user requests
  2033.  * a disconnect or in response to fatal error.
  2034.  *
  2035.  * Parameters: None
  2036.  *
  2037.  * Return values:
  2038.  *   0   on success
  2039.  *   < 0 on failure
  2040.  *
  2041.  *   return codes should be defined such that they can be passed to
  2042.  *   errorstr() to retrieve an appropriate error message for the user.
  2043.  */
  2044.  
  2045. int
  2046. netclos(void) ;
  2047.  
  2048. /*
  2049.  * N E T T C H K - Network Terminal I/O Check
  2050.  *
  2051.  * The network terminal i/o check function is called regularly by Kermit 95
  2052.  * to poll the status of the connection and to retrieve the number of input
  2053.  * characters waiting to be processed.  Because it is called frequently this
  2054.  * function should be designed to be low cost.
  2055.  *
  2056.  * Parameters: None
  2057.  *
  2058.  * Return values:
  2059.  *   >= 0 number of characters waiting in the input queue
  2060.  *   < 0  indicates a fatal error on the connection and the connection
  2061.  *        should be closed.
  2062.  *
  2063.  *   return codes should be defined such that they can be passed to
  2064.  *   errorstr() to retrieve an appropriate error message for the user.
  2065.  */
  2066.  
  2067. int
  2068. nettchk(void);
  2069.  
  2070. /*
  2071.  * N E T F L U I - Network Flush Input
  2072.  *
  2073.  * The network flush input function should clear the connection's input
  2074.  * queue.
  2075.  *
  2076.  * Parameters: None
  2077.  *
  2078.  * Return values:
  2079.  *   0    indicates success
  2080.  *   < 0  indicates an error
  2081.  *
  2082.  *   return codes should be defined such that they can be passed to
  2083.  *   errorstr() to retrieve an appropriate error message for the user.
  2084.  */
  2085.  
  2086. int
  2087. netflui(void);
  2088.  
  2089.  
  2090. /*
  2091.  * N E T B R E A K - Network Break
  2092.  *
  2093.  * The network break signal is called in response to a user initiated
  2094.  * break command.  For example, on a serial device this should result in
  2095.  * a Break signal and on a Telnet connection a Break Command is sent.
  2096.  * For connection types without an equivalent simply return 0.
  2097.  *
  2098.  * Parameters: None
  2099.  *
  2100.  * Return values:
  2101.  *   0    indicates success
  2102.  *   < 0  indicates an error
  2103.  *
  2104.  *   return codes should be defined such that they can be passed to
  2105.  *   errorstr() to retrieve an appropriate error message for the user.
  2106.  */
  2107.  
  2108. int
  2109. netbreak(void);
  2110.  
  2111.  
  2112. /*
  2113.  * N E T I N C - Network Input Character
  2114.  *
  2115.  * The network input character is used to read the next character from
  2116.  * the input queue.
  2117.  *
  2118.  * Parameters:
  2119.  *   timeout - 0   indicates no timeout, block until the next character
  2120.  *                 is available;
  2121.  *             > 0 indicates a timeout value in seconds;
  2122.  *             < 0 indicates a timeout value in milliseconds;
  2123.  *
  2124.  * Return values:
  2125.  *   >= 0 is interpreted as a valid character
  2126.  *   -1   is a timeout [errorstr() is not called]
  2127.  *   < -1 is a fatal error
  2128.  *
  2129.  *   return codes < -1 should be defined such that they can be passed to
  2130.  *   errorstr() to retrieve an appropriate error message for the user.
  2131.  */
  2132.  
  2133. int
  2134. netinc(int timeout);
  2135.  
  2136.  
  2137. /*
  2138.  * N E T X I N - Network Extended Input
  2139.  *
  2140.  * The network extended input is called to read a large number of waiting
  2141.  * input characters.  It will never be called with a number larger than
  2142.  * reported as available and waiting by nettchk().  The function may return
  2143.  * fewer characters than is requested.  This function should not block.
  2144.  *
  2145.  * Parameters:
  2146.  *   count  - number of characters to be read
  2147.  *   buffer - buffer of length count to be used to store the data
  2148.  *
  2149.  * Return values:
  2150.  *   >= 0  the number of characters actually returned by the function
  2151.  *   < 0  indicates an error
  2152.  *
  2153.  *   return codes should be defined such that they can be passed to
  2154.  *   errorstr() to retrieve an appropriate error message for the user.
  2155.  */
  2156.  
  2157. int
  2158. netxin(int count, char * buffer);
  2159.  
  2160. /*
  2161.  * N E T T O C - Network Terminal Output Character
  2162.  *
  2163.  * The network terminal output character transmits a single character
  2164.  *
  2165.  * Parameters:
  2166.  *   c - a single character to be output
  2167.  *
  2168.  * Return values:
  2169.  *   0    indicates success
  2170.  *   < 0  indicates an error
  2171.  *
  2172.  *   return codes should be defined such that they can be passed to
  2173.  *   errorstr() to retrieve an appropriate error message for the user.
  2174.  */
  2175.  
  2176. int
  2177. nettoc(int c);
  2178.  
  2179. /*
  2180.  * N E T T O L - Network Terminal Output Line
  2181.  *
  2182.  * The network terminal output line is used to output one or more
  2183.  * characters.
  2184.  *
  2185.  * Parameters:
  2186.  *   buffer - contains the characters to be output
  2187.  *   count  - the number of characters to be output from buffer
  2188.  *
  2189.  * Return values:
  2190.  *   >= 0 the number of characters actually output.  The function
  2191.  *        should make its best attempt to transmit all 'count'
  2192.  *        characters.
  2193.  *   < 0  indicates a fatal error
  2194.  *
  2195.  *   return codes should be defined such that they can be passed to
  2196.  *   errorstr() to retrieve an appropriate error message for the user.
  2197.  */
  2198.  
  2199. int
  2200. nettol(char * buffer, int count);
  2201.  
  2202. /*
  2203.  * T T V T - Terminal to Virtual Terminal Mode
  2204.  *
  2205.  * Terminal to Virtual Terminal Mode is called to notify the DLL that
  2206.  * Kermit 95 is about to enter terminal mode communications.  This means
  2207.  * either the CONNECT or DIAL commands will be sending output.  In most
  2208.  * cases, this will be either printable text or escape sequences.
  2209.  *
  2210.  * Parameters: None
  2211.  *
  2212.  * Return values:
  2213.  *   0    indicates success
  2214.  *   < 0  indicates an error
  2215.  *
  2216.  *   return codes should be defined such that they can be passed to
  2217.  *   errorstr() to retrieve an appropriate error message for the user.
  2218.  */
  2219.  
  2220. int
  2221. ttvt(void);
  2222.  
  2223. /*
  2224.  * T T P K T - Terminal to Packet Mode
  2225.  *
  2226.  * Terminal to Packet Mode is called to notify the DLL that
  2227.  * Kermit 95 is about to enter file transfer operations.
  2228.  *
  2229.  * Parameters: None
  2230.  *
  2231.  * Return values:
  2232.  *   0    indicates success
  2233.  *   < 0  indicates an error
  2234.  *
  2235.  *   return codes should be defined such that they can be passed to
  2236.  *   errorstr() to retrieve an appropriate error message for the user.
  2237.  */
  2238.  
  2239. int
  2240. ttpkt(void);
  2241.  
  2242. /*
  2243.  * T T R E S - Terminal Restore Mode
  2244.  *
  2245.  * Terminal Restore Mode is called to notify the DLL that it should
  2246.  * Kermit 95 restore to default settings.
  2247.  *
  2248.  * Parameters: None
  2249.  *
  2250.  * Return values:
  2251.  *   0    indicates success
  2252.  *   < 0  indicates an error
  2253.  *
  2254.  *   return codes should be defined such that they can be passed to
  2255.  *   errorstr() to retrieve an appropriate error message for the user.
  2256.  */
  2257.  
  2258. int
  2259. ttres(void);
  2260.  
  2261.  
  2262. /*
  2263.  * T E R M I N F O - Terminal Information
  2264.  *
  2265.  * The terminal information function is called whenever the terminal
  2266.  * type or window size is changed.
  2267.  *
  2268.  * Parameters:
  2269.  *   termtype     - a string representing either the currently selected
  2270.  *                  terminal type or a user specified string as per
  2271.  *                  SET TELNET TERMINAL <string>
  2272.  *   height       - initial height of the terminal window (chars)
  2273.  *   width        - initial width of the terminal window (chars)
  2274.  *
  2275.  * Return values: None
  2276.  */
  2277.  
  2278. void
  2279. terminfo(char * termtype, int height, int width);
  2280.  
  2281. /*
  2282.  * V E R S I O N - Version String
  2283.  *
  2284.  * Version is called to get a user displayable version string for use
  2285.  * as part of the SHOW NETWORK command.
  2286.  *
  2287.  * Parameters: None
  2288.  *
  2289.  * Return values:
  2290.  *   a string which will not be deleted by the caller.
  2291.  */
  2292.  
  2293. const char *
  2294. version(void);
  2295.  
  2296. /*
  2297.  * E R R O R S T R - Error String
  2298.  *
  2299.  * Error string is called to retrieve a user displayable error message
  2300.  * describing the type of error being reported by the function.
  2301.  *
  2302.  * Parameters:
  2303.  *   error - the error value reported by the DLL function.
  2304.  *
  2305.  * Return values:
  2306.  *   a string which will not be deleted by the caller.
  2307.  */
  2308.  
  2309. const char *
  2310. errorstr(int error);
  2311.  
  2312.  
  2313. 14. AN INTRODUCTION TO CERTIFICATES AND CERTIFICATE AUTHORITIES WITH OPENSSL
  2314.  
  2315. This is a brief introduction to certificates, certificate authorities and how
  2316. to use them.  RSA Security, Inc., has a very good Frequently Asked Questions
  2317. list:
  2318.  
  2319.   http://www.rsasecurity.com/rsalabs/faq/questions.html
  2320.  
  2321. The FAQ covers many topics related to cryptography as well as how public key
  2322. certificates work and how they are to be used.
  2323.  
  2324. 14.1  What Are Certificates, Private Keys, CSRs, CAs, and CRLs?
  2325.  
  2326. Public key (asymetric) cryptography defines a class of algorithms for key
  2327. exchange that include RSA and Diffie-Hellman (DH).  These algorithms provide a
  2328. mechanism to create a shared secret that can be used for encrypting future
  2329. communications.  Anyone listening to the exchange would be no closer to
  2330. figuring out the value of the shared secret than if they were to take a guess.
  2331.  
  2332. There are two parts to the exchange.  A private key that is never disclosed,
  2333. and a public key that may be viewed by all.  A X.509 certificate is a standard
  2334. package for distributing a public key with identifying features such that the
  2335. authenticity and validity of the public key may be verified by a recipient.
  2336.  
  2337. The authenticity and validity of a certificate is provided by a combination of
  2338. information provided within the certificates (the subject, the issuer, dates
  2339. of validity, ...) as well as the trust that is placed in the certificate
  2340. issuer (the Certificate Authority, or CA).  The CA signs each of the
  2341. certificates that it issues with its own certificate.  With a copy of the CA's
  2342. certificate it is possible to validate all of the certificates that were
  2343. signed by the CA's private key.
  2344.  
  2345. A user who wants to have a certificate signed by a CA creates a Certificate
  2346. Signing Request (CSR).  The CSR is an unsigned certificate which is presented
  2347. to the CA along with information verifying the identity and desired use for
  2348. the certificate.  The CA signs the CSR producing a certificate that is valid
  2349. for a specific time frame which is then returned to the user.
  2350.  
  2351. If the private key of the certificate were to be compromised the CA may revoke
  2352. the certificate.  The CA publishes a Certificate Revocation List (CRL) on a
  2353. periodic basis containing a list of all certificates that would otherwise be
  2354. valid if they were not revoked.  It is the responsibility of the verifier to
  2355. check not only the authenticity of the certificate but also whether or not it
  2356. has been revoked by the issuer.
  2357.  
  2358. 14.2  RSA certificates vs. DSA Certificates
  2359.  
  2360. The important differences between RSA and DSA certificates are:
  2361.  
  2362.  . The RSA algorithms are faster than DSA.
  2363.  
  2364.  . The RSA algorithms are supported by all the major browsers whereas DSA
  2365.     are not.
  2366.  
  2367.  . The RSA algorithms are patented in the United States (until Sept 29, 2000)
  2368.    which requires payments of licensing fees for producers of software
  2369.    utilizing them, whereas DSA is free.
  2370.  
  2371.  . The RSA private and public key pairs may be used for encrypting data as
  2372.    well as signing.  DSA private and public key pairs may only be used for
  2373.    signing.  Therefore, products incorporating DSA algorithms are easier to
  2374.    export from the United States.
  2375.  
  2376. Due to the patent issues surrounding the RSA algorithms, the Kermit Project
  2377. does not maintain a library or distribute any binaries that are built with the
  2378. RSA algorithms.  This policy can change when the RSA patent expires.
  2379.  
  2380. 14.3  Should You Be Your Own Certificate Authority?
  2381.  
  2382. There are many companies that believe that providing CA services is big
  2383. business.  These include but are not limited to:
  2384.  
  2385.    Verisign <http://www.verisign.com>
  2386.    Thawte Consulting <http://www.thawte.com>
  2387.    CertiSign Cerificadora Digital Ltda. <http://www.certisign.com.br>
  2388.    IKS CmbH <http://www.iks-jena.de>
  2389.    Uptime Commerce Ltd. <http://www.uptimecommerce.com>
  2390.    BelSign NV/SA <http://www.belsign.be>
  2391.  
  2392. The root CA certificates of these companies certificates are included most of
  2393. the popular browsers.  This provides an ease-of-use advantage to the
  2394. recipients of certificates they sign since the root certificates do not need
  2395. to be otherwise distributed in order to authenticate the signed certificates.
  2396.  
  2397. On the other hand, as is pointed out by C. Ellison and B. Schneier in their
  2398. paper, "Ten Risks of PKI: What You're Not Being Told About Public Key
  2399. Infrastructure" <http://www.counterpane.com/pki-risks.html>, using the
  2400. commercial CA services it makes it difficult to decide whether or not a
  2401. certificate should be trusted for a particular purpose, especially if you want
  2402. to use certificates to authenticate an end user to a system for remote access.
  2403. In this situation it is necessary to not only be able to authenticate a
  2404. certificate but be able to know that the information within the certificate,
  2405. such as the uniqueIdentifier used for the User ID, is tightly controlled and
  2406. in fact unique in your environment.
  2407.  
  2408. If you choose to be your own CA you will need to configure your environment.
  2409. Create the following directory trees to store the DSA and RSA CAs.
  2410.  
  2411.    openssl/dsaCA/certs/
  2412.    openssl/dsaCA/crl/
  2413.    openssl/dsaCA/private/
  2414.    openssl/dsaCA/newcerts/
  2415.    openssl/dsaCA/requests/
  2416.  
  2417.    openssl/rsaCA/certs/
  2418.    openssl/rsaCA/crl/
  2419.    openssl/rsaCA/private/
  2420.    openssl/rsaCA/newcerts/
  2421.    openssl/rsaCA/requests/
  2422.  
  2423. Place the openssl.cnf file into the openssl directory.  Edit it to meet the
  2424. requirements of your organization.    Create two sections [ CA_DSA ] and
  2425. [ CA_RSA ]:
  2426.  
  2427.   [ CA_DSA ]
  2428.  
  2429.   dir             = <openssl_path>/dsaCA/  # Where everything is kept
  2430.   certs           = $dir/certs             # Where the issued certs are kept
  2431.   crl_dir         = $dir/crl               # Where the issued crl are kept
  2432.   database        = $dir/index.txt         # database index file.
  2433.   new_certs_dir   = $dir/newcerts          # default place for new certs.
  2434.  
  2435.   certificate     = $dir/certs/cacert.pem  # The CA certificate
  2436.   serial          = $dir/ca.srl            # The current serial number
  2437.   crl             = $dir/crl.pem           # The current CRL
  2438.   private_key     = $dir/private/cakey.pem # The private key
  2439.   RANDFILE        = $dir/private/.rand     # private random number file
  2440.  
  2441.   x509_extensions = x509v3_extensions      # The extentions to add to the cert
  2442.   default_days    = 365                    # how long to certify for
  2443.   default_crl_days= 30                     # how long before next CRL
  2444.   default_md      = sha1                   # which md to use.
  2445.   preserve        = no                     # keep passed DN ordering
  2446.  
  2447.  
  2448.   [ CA_RSA ]
  2449.  
  2450.   dir             = <openssl_path>/rsaCA/  # Where everything is kept
  2451.   certs           = $dir/certs             # Where the issued certs are kept
  2452.   crl_dir         = $dir/crl               # Where the issued crl are kept
  2453.   database        = $dir/index.txt         # database index file.
  2454.   new_certs_dir   = $dir/newcerts          # default place for new certs.
  2455.  
  2456.   certificate     = $dir/certs/cacert.pem  # The CA certificate
  2457.   serial          = $dir/ca.srl            # The current serial number
  2458.   crl             = $dir/crl.pem           # The current CRL
  2459.   private_key     = $dir/private/cakey.pem # The private key
  2460.   RANDFILE        = $dir/private/.rand     # private random number file
  2461.  
  2462.   x509_extensions = x509v3_extensions      # The extentions to add to the cert
  2463.   default_days    = 365                    # how long to certify for
  2464.   default_crl_days= 30                     # how long before next CRL
  2465.   default_md      = sha1                   # which md to use.
  2466.   preserve        = no                     # keep passed DN ordering
  2467.  
  2468. If you wish to use the uniqueIdentifier field to perform certificate to user
  2469. ID mapping, add it after the emailAddress field.
  2470.  
  2471. To avoid the need to specify the location of the openssl.cnf file, set the
  2472. environment variable OPENSSL_CNF to be equal to the full path of the file.
  2473. If you do not create this environment variable you will need to include the
  2474. option:
  2475.  
  2476.   -config <path>/openssl.cnf
  2477.  
  2478. to each openssl command.
  2479.  
  2480. Create the file that stores the next available serial number for each CA:
  2481.  
  2482.    openssl/dsaCA/ca.srl
  2483.    openssl/rsaCA/ca.srl
  2484.  
  2485. The format of this file is a hex value followed by a LF (0x0A) character.
  2486. The value "01" is an appropriate initial value.
  2487.  
  2488. Create an empty file to store the index of signed certificates:
  2489.  
  2490.    openssl/dsaCA/index.txt
  2491.    openssl/rsaCA/index.txt
  2492.  
  2493. Now you are ready to create the DSA and RSA CA certificates for your
  2494. organization.
  2495.  
  2496.  
  2497. 14.4  Generating a DSA CA (self-signed) Certificate
  2498.  
  2499. Change the current working directory to openssl/dsaCA/.
  2500.  
  2501. Generate the DSA parameters to be used when generating the keys for use with
  2502. your certificates.
  2503.  
  2504.   openssl dsaparam 1024 -out dsa1024.pem
  2505.  
  2506. Generate the self-signed certificate you will use as the CA certificate for
  2507. your organization.
  2508.  
  2509.   openssl req -x509 -newkey dsa:dsa1024.pem -days <days> \
  2510.     -keyout private/cakey.pem -out certs/cacert.pem
  2511.  
  2512. The <days> parameter should be replaced by the number of days you want this
  2513. certificate to remain valid.  All certificates signed by this certificate
  2514. become invalid when this certificate expires.
  2515.  
  2516. Be sure to not forget the pass-phrase you use to protect the private key of
  2517. the CA certificate.  If you do not wish to encrypt the CA's private key you
  2518. may specify the -nodes option.  But this is highly discouraged.
  2519.  
  2520. You can check the contents of the CA certificate with the command:
  2521.  
  2522.   openssl x509 -text -in certs/cacert.pem
  2523.  
  2524. 14.5  Generating a DSA CSR
  2525.  
  2526. Change the current working directory to openssl/dsaCA/.
  2527.  
  2528. If you have not already created a set of DSA parameters, you must generate a
  2529. set:
  2530.  
  2531.   openssl dsaparam 1024 -out dsa1024.pem
  2532.  
  2533. It is safe to reuse the DSA parameters.
  2534.  
  2535. Generate the DSA certificate request
  2536.  
  2537.   openssl req -newkey dsa:dsa1024.pem -keyout private/<name>-key.pem \
  2538.     -out requests/<name>-req.pem
  2539.  
  2540. <name> should be replaced by something that identifies the files.  Perhaps
  2541. the hostname or userid for which the certificate is being generated.
  2542.  
  2543. If you are generating a CSR for use as a host certificate, be sure to specify
  2544. the fully qualified domain name as reported by the DNS as the Common Name for
  2545. the certificate.  Otherwise, it will not be recognized as belonging to the
  2546. host it is installed on by its clients.
  2547.  
  2548. Be sure not to forget the pass-phrase you use to protect the private key of
  2549. the CA certificate.  The certificate (after signing) is unusable without it.
  2550. Use the -nodes option if you wish to store the key unencrypted.
  2551.  
  2552. You can check the contents of the CSR with the command:
  2553.  
  2554.   openssl req -text -in requests/<name>-req.pem
  2555.  
  2556. The CSR now stored in requests/<name>-req.pem may be sent to one of the
  2557. commerical CAs if you do not wish to be your own CA.
  2558.  
  2559. 14.6  Generating a RSA CA (self-signed) certificate
  2560.  
  2561. Change the current working directory to openssl/rsaCA/.
  2562.  
  2563. Generate the self-signed certificate you will use as the CA certificate for
  2564. your organization.
  2565.  
  2566.   openssl req -x509 -newkey rsa:1024 -days <days> \
  2567.     -keyout private/cakey.pem -out certs/cacert.pem
  2568.  
  2569. The <days> parameter should be replaced by the number of days you want this
  2570. certificate to remain valid.  All certificates signed by this certificate
  2571. become invalid when this certificate expires.
  2572.  
  2573. Be sure not to forget the pass-phrase you use to protect the private key of
  2574. the CA certificate.  If you do not wish to encrypt the CA's private key you
  2575. may specify the -nodes option.  But this is highly discouraged.
  2576.  
  2577. You can check the contents of the CA certificate with the command:
  2578.  
  2579.   openssl x509 -text -in certs/cacert.pem
  2580.  
  2581. 14.7  Generating a RSA CSR
  2582.  
  2583. Change the current working directory to openssl/rsaCA/.
  2584.  
  2585.   openssl req -newkey rsa:1024 -keyout private/<name>-key.pem \
  2586.     -out requests/<name>-req.pem
  2587.  
  2588. <name> should be replaced by something that identifies the files.  Perhaps
  2589. the hostname or userid for which the certificate is being generated.
  2590.  
  2591. If you are generating a CSR for use as a host certificate be sure to specify
  2592. the fully qualified domain name as reported by the DNS as the Common Name for
  2593. the certificate.  Otherwise, it is not recognized as belonging to the host it
  2594. is installed on by its clients.
  2595.  
  2596. Be sure not to forget the pass-phrase you use to protect the private key of
  2597. the CA certificate.  The certificate (after signing) is unusable without it.
  2598. Use the -nodes option if you wish to store the key unencrypted.
  2599.  
  2600. You can check the contents of the CSR with the command:
  2601.  
  2602.   openssl req -text -in requests/<name>-req.pem
  2603.  
  2604. The CSR now stored in requests/<name>-req.pem may be sent to one of the
  2605. commerical CAs if you do not wish to be your own CA.
  2606.  
  2607. 14.8  Signing a CSR with your CA certificate
  2608.  
  2609. If you are signing a DSA certificate change directory to openssl/dsaCA/ and
  2610. use a <caname> of "CA_DSA".  If you are signing a RSA certificate change
  2611. directory to openssl/rsaCA/ and use a <caname> of "CA_RSA".
  2612.  
  2613.   openssl ca -name <caname> -in requests/<name>-req.pem \
  2614.     -out certs/<name>.pem -days <days>
  2615.  
  2616. The <days> parameter should be replaced by the number of days you want the
  2617. signed certificate to remain valid.  If you want to specify a specific date
  2618. range you can replace the -days parameters with:
  2619.  
  2620.  -startdate YYMMDDHHMMSSZ  - certificate validity notBefore
  2621.  -enddate YYMMDDHHMMSSZ    - certificate validity notAfter
  2622.  
  2623. The file certs/<name>.pem now contains a signed certificate that may be used
  2624. by a host or client for authentication in conjunction with its matching
  2625. private key (private/<name>-key.pem.)
  2626.  
  2627. An alternative method of signing the CSR is to use the command:
  2628.  
  2629.   openssl x509 -req -in requests/<name>-req.pem -CA certs/cacert.pem \
  2630.     -CAkey private/cakey.pem -out certs/<name>.pem -days <days> \
  2631.     -CAserial ca.srl -CAcreateserial
  2632.  
  2633. The "openssl x509" command provides greater functionality at the expense of
  2634. ease of use.  The X509 may be used to assign X.509v3 certificate extensions
  2635. with the -extfile and -extensions switches.  It may also be used to produce
  2636. certificates that may only be used for specific purposes.
  2637.  
  2638. You can check the contents of the CA certificate with the command:
  2639.  
  2640.   openssl x509 -text -in certs/<name>.pem
  2641.  
  2642. 14.9  Revoking a Certificate
  2643.  
  2644. If you are revoking a DSA certificate change directory to openssl/dsaCA/ and
  2645. use a <caname> of "CA_DSA".  If you are revoking a RSA certificate change
  2646. directory to openssl/rsaCA/ and use a <caname> of "CA_RSA".
  2647.  
  2648.   openssl ca -name <caname> -revoke -in certs/<name>.pem
  2649.  
  2650. marks the certificate as being revoked in the index.txt file.  It is
  2651. necessary to revoke a certificate with a given subject name if you wish to
  2652. generate a new certificate with an identical subject name.  Once a
  2653. certificate is revoked it is listed in the next generated CRL.
  2654.  
  2655. 14.10  Generating a CRL
  2656.  
  2657. If you are generating a CRL for your DSA certificates change directory to
  2658. openssl/dsaCA/ and use a <caname> of "CA_DSA".  If you are generating a CRL
  2659. for your RSA certificate change directory to openssl/rsaCA/ and use a <caname>
  2660. of "CA_RSA".
  2661.  
  2662.   openssl ca -name <caname> -gencrl -out crl/<date>-crl.pem
  2663.  
  2664. <date> should be replaced by the date the crl was generated.
  2665.  
  2666. You can check the contents of the CRL with the command
  2667.  
  2668.   openssl crl -in crl/<date>-crl.pem -text
  2669.  
  2670. The current CRL should be placed somewhere it is publicly and easily
  2671. accessible.  For instance, by HTTP or FTP.  The CRL is signed by the CA
  2672. certificate
  2673.  
  2674. (End)
  2675.