Darren Tucker | 22cc741 | 2004-12-06 22:47:41 +1100 | [diff] [blame] | 1 | /* $OpenBSD: ssh.h,v 1.76 2004/12/06 11:41:03 dtucker Exp $ */ |
Ben Lindstrom | 05764b9 | 2002-03-05 01:53:02 +0000 | [diff] [blame] | 2 | |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 3 | /* |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 5 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
| 6 | * All rights reserved |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 7 | * |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 8 | * As far as I am concerned, the code I have written for this software |
| 9 | * can be used freely for any purpose. Any derived versions of this |
| 10 | * software must be clearly marked as such, and if the derived work is |
| 11 | * incompatible with the protocol description in the RFC file, it must be |
| 12 | * called by a name other than "ssh" or "Secure Shell". |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 13 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 14 | |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 15 | #ifndef SSH_H |
| 16 | #define SSH_H |
| 17 | |
Damien Miller | ab18c41 | 1999-11-11 10:40:23 +1100 | [diff] [blame] | 18 | #include <netinet/in.h> /* For struct sockaddr_in */ |
| 19 | #include <pwd.h> /* For struct pw */ |
Damien Miller | 5ce662a | 1999-11-11 17:57:39 +1100 | [diff] [blame] | 20 | #include <stdarg.h> /* For va_list */ |
Damien Miller | 6dbfef6 | 2000-11-29 13:51:06 +1100 | [diff] [blame] | 21 | #include <syslog.h> /* For LOG_AUTH and friends */ |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 22 | #include <sys/socket.h> /* For struct sockaddr_storage */ |
Damien Miller | 365199d | 1999-12-22 00:12:38 +1100 | [diff] [blame] | 23 | #ifdef HAVE_SYS_SELECT_H |
| 24 | # include <sys/select.h> |
| 25 | #endif |
Ben Lindstrom | 226cfa0 | 2001-01-22 05:34:40 +0000 | [diff] [blame] | 26 | |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 27 | /* Cipher used for encrypting authentication files. */ |
| 28 | #define SSH_AUTHFILE_CIPHER SSH_CIPHER_3DES |
| 29 | |
| 30 | /* Default port number. */ |
| 31 | #define SSH_DEFAULT_PORT 22 |
| 32 | |
| 33 | /* Maximum number of TCP/IP ports forwarded per direction. */ |
| 34 | #define SSH_MAX_FORWARDS_PER_DIRECTION 100 |
| 35 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 36 | /* |
| 37 | * Maximum number of RSA authentication identity files that can be specified |
| 38 | * in configuration files or on the command line. |
| 39 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 40 | #define SSH_MAX_IDENTITY_FILES 100 |
| 41 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 42 | /* |
Darren Tucker | 22cc741 | 2004-12-06 22:47:41 +1100 | [diff] [blame] | 43 | * Maximum length of lines in authorized_keys file. |
| 44 | * Current value permits 16kbit RSA and RSA1 keys and 8kbit DSA keys, with |
| 45 | * some room for options and comments. |
| 46 | */ |
| 47 | #define SSH_MAX_PUBKEY_BYTES 8192 |
| 48 | |
| 49 | /* |
Ben Lindstrom | 2e14bc7 | 2002-06-06 20:56:07 +0000 | [diff] [blame] | 50 | * Major protocol version. Different version indicates major incompatibility |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 51 | * that prevents communication. |
Damien Miller | 7892879 | 2000-04-12 20:17:38 +1000 | [diff] [blame] | 52 | * |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 53 | * Minor protocol version. Different version indicates minor incompatibility |
| 54 | * that does not prevent interoperation. |
| 55 | */ |
Damien Miller | 7892879 | 2000-04-12 20:17:38 +1000 | [diff] [blame] | 56 | #define PROTOCOL_MAJOR_1 1 |
| 57 | #define PROTOCOL_MINOR_1 5 |
| 58 | |
| 59 | /* We support both SSH1 and SSH2 */ |
| 60 | #define PROTOCOL_MAJOR_2 2 |
| 61 | #define PROTOCOL_MINOR_2 0 |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 62 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 63 | /* |
| 64 | * Name for the service. The port named by this service overrides the |
| 65 | * default port if present. |
| 66 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 67 | #define SSH_SERVICE_NAME "ssh" |
| 68 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 69 | /* |
Ben Lindstrom | 5590aa5 | 2002-06-23 00:30:30 +0000 | [diff] [blame] | 70 | * Name of the environment variable containing the process ID of the |
| 71 | * authentication agent. |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 72 | */ |
Kevin Steves | 28a7f26 | 2001-02-05 15:43:59 +0000 | [diff] [blame] | 73 | #define SSH_AGENTPID_ENV_NAME "SSH_AGENT_PID" |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 74 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 75 | /* |
| 76 | * Name of the environment variable containing the pathname of the |
| 77 | * authentication socket. |
| 78 | */ |
Ben Lindstrom | 226cfa0 | 2001-01-22 05:34:40 +0000 | [diff] [blame] | 79 | #define SSH_AUTHSOCKET_ENV_NAME "SSH_AUTH_SOCK" |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 80 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 81 | /* |
Ben Lindstrom | 226cfa0 | 2001-01-22 05:34:40 +0000 | [diff] [blame] | 82 | * Environment variable for overwriting the default location of askpass |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 83 | */ |
Damien Miller | aae6c61 | 1999-12-06 11:47:28 +1100 | [diff] [blame] | 84 | #define SSH_ASKPASS_ENV "SSH_ASKPASS" |
| 85 | |
| 86 | /* |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 87 | * Force host key length and server key length to differ by at least this |
| 88 | * many bits. This is to make double encryption with rsaref work. |
| 89 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 90 | #define SSH_KEY_BITS_RESERVED 128 |
| 91 | |
Damien Miller | 5428f64 | 1999-11-25 11:54:57 +1100 | [diff] [blame] | 92 | /* |
| 93 | * Length of the session key in bytes. (Specified as 256 bits in the |
| 94 | * protocol.) |
| 95 | */ |
Damien Miller | d4a8b7e | 1999-10-27 13:42:43 +1000 | [diff] [blame] | 96 | #define SSH_SESSION_KEY_LENGTH 32 |
| 97 | |
Ben Lindstrom | 2b1f71b | 2001-06-05 20:32:21 +0000 | [diff] [blame] | 98 | /* Used to identify ``EscapeChar none'' */ |
| 99 | #define SSH_ESCAPECHAR_NONE -2 |
| 100 | |
Ben Lindstrom | c743134 | 2002-03-22 03:11:49 +0000 | [diff] [blame] | 101 | /* |
| 102 | * unprivileged user when UsePrivilegeSeparation=yes; |
Ben Lindstrom | 966bfda | 2002-05-15 16:09:57 +0000 | [diff] [blame] | 103 | * sshd will change its privileges to this user and its |
Ben Lindstrom | c743134 | 2002-03-22 03:11:49 +0000 | [diff] [blame] | 104 | * primary group. |
| 105 | */ |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 106 | #ifndef SSH_PRIVSEP_USER |
Ben Lindstrom | 973be00 | 2002-05-15 16:08:48 +0000 | [diff] [blame] | 107 | #define SSH_PRIVSEP_USER "sshd" |
Kevin Steves | 7ff9112 | 2002-04-07 19:22:54 +0000 | [diff] [blame] | 108 | #endif |
Ben Lindstrom | c743134 | 2002-03-22 03:11:49 +0000 | [diff] [blame] | 109 | |
Ben Lindstrom | 03f3932 | 2002-04-02 20:43:11 +0000 | [diff] [blame] | 110 | /* Minimum modulus size (n) for RSA keys. */ |
| 111 | #define SSH_RSA_MINIMUM_MODULUS_SIZE 768 |
| 112 | |
Darren Tucker | 3175eb9 | 2003-12-09 19:15:11 +1100 | [diff] [blame] | 113 | /* Listen backlog for sshd, ssh-agent and forwarding sockets */ |
| 114 | #define SSH_LISTEN_BACKLOG 128 |
| 115 | |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 116 | #endif /* SSH_H */ |