Changes to update Tomato RAF.
[tomato.git] / release / src / router / dropbear / options.h
blobe3c2d173f7129de6743e38b58f65b81a88de7356
1 /* Dropbear SSH
2 * Copyright (c) 2002,2003 Matt Johnston
3 * All rights reserved. See LICENSE for the license. */
5 #ifndef _OPTIONS_H_
6 #define _OPTIONS_H_
8 /******************************************************************
9 * Define compile-time options below - the "#ifndef DROPBEAR_XXX .... #endif"
10 * parts are to allow for commandline -DDROPBEAR_XXX options etc.
11 ******************************************************************/
13 #ifndef DROPBEAR_DEFPORT
14 #define DROPBEAR_DEFPORT "22"
15 #endif
17 #ifndef DROPBEAR_DEFADDRESS
18 /* Listen on all interfaces */
19 #define DROPBEAR_DEFADDRESS ""
20 #endif
22 /* Default hostkey paths - these can be specified on the command line */
23 #ifndef DSS_PRIV_FILENAME
24 #define DSS_PRIV_FILENAME "/etc/dropbear/dropbear_dss_host_key"
25 #endif
26 #ifndef RSA_PRIV_FILENAME
27 #define RSA_PRIV_FILENAME "/etc/dropbear/dropbear_rsa_host_key"
28 #endif
30 /* Set NON_INETD_MODE if you require daemon functionality (ie Dropbear listens
31 * on chosen ports and keeps accepting connections. This is the default.
33 * Set INETD_MODE if you want to be able to run Dropbear with inetd (or
34 * similar), where it will use stdin/stdout for connections, and each process
35 * lasts for a single connection. Dropbear should be invoked with the -i flag
36 * for inetd, and can only accept IPv4 connections.
38 * Both of these flags can be defined at once, don't compile without at least
39 * one of them. */
40 #define NON_INETD_MODE
41 #define INETD_MODE
43 /* Setting this disables the fast exptmod bignum code. It saves ~5kB, but is
44 * perhaps 20% slower for pubkey operations (it is probably worth experimenting
45 * if you want to use this) */
46 /*#define NO_FAST_EXPTMOD*/
48 /* Set this if you want to use the DROPBEAR_SMALL_CODE option. This can save
49 several kB in binary size however will make the symmetrical ciphers and hashes
50 slower, perhaps by 50%. Recommended for small systems that aren't doing
51 much traffic. */
52 /*#define DROPBEAR_SMALL_CODE*/
54 /* Enable X11 Forwarding - server only */
55 #define ENABLE_X11FWD
57 /* Enable TCP Fowarding */
58 /* 'Local' is "-L" style (client listening port forwarded via server)
59 * 'Remote' is "-R" style (server listening port forwarded via client) */
61 #define ENABLE_CLI_LOCALTCPFWD
62 #define ENABLE_CLI_REMOTETCPFWD
64 #define ENABLE_SVR_LOCALTCPFWD
65 #define ENABLE_SVR_REMOTETCPFWD
67 /* Enable Authentication Agent Forwarding */
68 #define ENABLE_SVR_AGENTFWD
69 #define ENABLE_CLI_AGENTFWD
72 /* Note: Both ENABLE_CLI_PROXYCMD and ENABLE_CLI_NETCAT must be set to
73 * allow multihop dbclient connections */
75 /* Allow using -J <proxycommand> to run the connection through a
76 pipe to a program, rather the normal TCP connection */
77 #define ENABLE_CLI_PROXYCMD
79 /* Enable "Netcat mode" option. This will forward standard input/output
80 * to a remote TCP-forwarded connection */
81 #define ENABLE_CLI_NETCAT
83 /* Encryption - at least one required.
84 * Protocol RFC requires 3DES and recommends AES128 for interoperability.
85 * Including multiple keysize variants the same cipher
86 * (eg AES256 as well as AES128) will result in a minimal size increase.*/
87 #define DROPBEAR_AES128
88 #define DROPBEAR_3DES
89 #define DROPBEAR_AES256
90 /* Compiling in Blowfish will add ~6kB to runtime heap memory usage */
91 /*#define DROPBEAR_BLOWFISH*/
92 /*#define DROPBEAR_TWOFISH256*/
93 /*#define DROPBEAR_TWOFISH128*/
95 /* Enable "Counter Mode" for ciphers. This is more secure than normal
96 * CBC mode against certain attacks. This adds around 1kB to binary
97 * size and is recommended for most cases */
98 #define DROPBEAR_ENABLE_CTR_MODE
100 /* Message Integrity - at least one required.
101 * Protocol RFC requires sha1 and recommends sha1-96.
102 * sha1-96 may be of use for slow links, as it has a smaller overhead.
104 * Note: there's no point disabling sha1 to save space, since it's used
105 * for the random number generator and public-key cryptography anyway.
106 * Disabling it here will just stop it from being used as the integrity portion
107 * of the ssh protocol.
109 * These hashes are also used for public key fingerprints in logs.
110 * If you disable MD5, Dropbear will fall back to SHA1 fingerprints,
111 * which are not the standard form. */
112 #define DROPBEAR_SHA1_HMAC
113 #define DROPBEAR_SHA1_96_HMAC
114 #define DROPBEAR_MD5_HMAC
116 /* Hostkey/public key algorithms - at least one required, these are used
117 * for hostkey as well as for verifying signatures with pubkey auth.
118 * Removing either of these won't save very much space.
119 * SSH2 RFC Draft requires dss, recommends rsa */
120 #define DROPBEAR_RSA
121 #define DROPBEAR_DSS
123 /* RSA can be vulnerable to timing attacks which use the time required for
124 * signing to guess the private key. Blinding avoids this attack, though makes
125 * signing operations slightly slower. */
126 #define RSA_BLINDING
128 /* Define DSS_PROTOK to use PuTTY's method of generating the value k for dss,
129 * rather than just from the random byte source. Undefining this will save you
130 * ~4k in binary size with static uclibc, but your DSS hostkey could be exposed
131 * if the random number source isn't good. It happened to Sony.
132 * On systems with a decent random source this isn't required. */
133 /* #define DSS_PROTOK */
135 /* Control the memory/performance/compression tradeoff for zlib.
136 * Set windowBits=8 for least memory usage, see your system's
137 * zlib.h for full details.
138 * Default settings (windowBits=15) will use 256kB for compression
139 * windowBits=8 will use 129kB for compression.
140 * Both modes will use ~35kB for decompression (using windowBits=15 for
141 * interoperability) */
142 #ifndef DROPBEAR_ZLIB_WINDOW_BITS
143 #define DROPBEAR_ZLIB_WINDOW_BITS 15
144 #endif
146 /* Whether to do reverse DNS lookups. */
147 /*#define DO_HOST_LOOKUP*/
149 /* Whether to print the message of the day (MOTD). This doesn't add much code
150 * size */
151 #define DO_MOTD
153 /* The MOTD file path */
154 #ifndef MOTD_FILENAME
155 #define MOTD_FILENAME "/etc/motd"
156 #endif
158 /* Authentication Types - at least one required.
159 RFC Draft requires pubkey auth, and recommends password */
161 /* Note: PAM auth is quite simple and only works for PAM modules which just do
162 * a simple "Login: " "Password: " (you can edit the strings in svr-authpam.c).
163 * It's useful for systems like OS X where standard password crypts don't work
164 * but there's an interface via a PAM module. It won't work for more complex
165 * PAM challenge/response.
166 * You can't enable both PASSWORD and PAM. */
168 #define ENABLE_SVR_PASSWORD_AUTH
169 /* PAM requires ./configure --enable-pam */
170 /*#define ENABLE_SVR_PAM_AUTH*/
171 #define ENABLE_SVR_PUBKEY_AUTH
173 /* Whether to take public key options in
174 * authorized_keys file into account */
175 #ifdef ENABLE_SVR_PUBKEY_AUTH
176 #define ENABLE_SVR_PUBKEY_OPTIONS
177 #endif
179 /* Define this to allow logging in to accounts that have no password specified.
180 * Public key logins are allowed for blank-password accounts regardless of this
181 * setting. PAM is not affected by this setting, it uses the normal pam.d
182 * settings ('nullok' option) */
183 /* #define ALLOW_BLANK_PASSWORD */
185 #define ENABLE_CLI_PASSWORD_AUTH
186 #define ENABLE_CLI_PUBKEY_AUTH
187 #define ENABLE_CLI_INTERACT_AUTH
189 /* This variable can be used to set a password for client
190 * authentication on the commandline. Beware of platforms
191 * that don't protect environment variables of processes etc. Also
192 * note that it will be provided for all "hidden" client-interactive
193 * style prompts - if you want something more sophisticated, use
194 * SSH_ASKPASS instead. Comment out this var to remove this functionality.*/
195 /*#define DROPBEAR_PASSWORD_ENV "DROPBEAR_PASSWORD"*/
197 /* Define this (as well as ENABLE_CLI_PASSWORD_AUTH) to allow the use of
198 * a helper program for the ssh client. The helper program should be
199 * specified in the SSH_ASKPASS environment variable, and dbclient
200 * should be run with DISPLAY set and no tty. The program should
201 * return the password on standard output */
202 /*#define ENABLE_CLI_ASKPASS_HELPER*/
204 /* Random device to use - define either DROPBEAR_RANDOM_DEV or
205 * DROPBEAR_PRNGD_SOCKET.
206 * DROPBEAR_RANDOM_DEV is recommended on hosts with a good /dev/(u)random,
207 * otherwise use run prngd (or egd if you want), specifying the socket.
208 * The device will be queried for a few dozen bytes of seed a couple of times
209 * per session (or more for very long-lived sessions). */
211 /* We'll use /dev/urandom by default, since /dev/random is too much hassle.
212 * If system developers aren't keeping seeds between boots nor getting
213 * any entropy from somewhere it's their own fault. */
214 #define DROPBEAR_RANDOM_DEV "/dev/urandom"
216 /* prngd must be manually set up to produce output */
217 /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
219 /* Specify the number of clients we will allow to be connected but
220 * not yet authenticated. After this limit, connections are rejected */
221 /* The first setting is per-IP, to avoid denial of service */
222 #ifndef MAX_UNAUTH_PER_IP
223 #define MAX_UNAUTH_PER_IP 5
224 #endif
226 /* And then a global limit to avoid chewing memory if connections
227 * come from many IPs */
228 #ifndef MAX_UNAUTH_CLIENTS
229 #define MAX_UNAUTH_CLIENTS 30
230 #endif
232 /* Maximum number of failed authentication tries (server option) */
233 #ifndef MAX_AUTH_TRIES
234 #define MAX_AUTH_TRIES 10
235 #endif
237 /* The default file to store the daemon's process ID, for shutdown
238 scripts etc. This can be overridden with the -P flag */
239 #ifndef DROPBEAR_PIDFILE
240 #define DROPBEAR_PIDFILE "/var/run/dropbear.pid"
241 #endif
243 /* The command to invoke for xauth when using X11 forwarding.
244 * "-q" for quiet */
245 #ifndef XAUTH_COMMAND
246 #define XAUTH_COMMAND "/opt/X11R6/bin/xauth -q"
247 #endif
249 /* if you want to enable running an sftp server (such as the one included with
250 * OpenSSH), set the path below. If the path isn't defined, sftp will not
251 * be enabled */
252 #ifndef SFTPSERVER_PATH
253 #define SFTPSERVER_PATH "/opt/libexec/sftp-server"
254 #endif
256 /* This is used by the scp binary when used as a client binary. If you're
257 * not using the Dropbear client, you'll need to change it */
258 #define _PATH_SSH_PROGRAM "/usr/bin/dbclient"
260 /* Whether to log commands executed by a client. This only logs the
261 * (single) command sent to the server, not what a user did in a
262 * shell/sftp session etc. */
263 /* #define LOG_COMMANDS */
265 /* Window size limits. These tend to be a trade-off between memory
266 usage and network performance: */
267 /* Size of the network receive window. This amount of memory is allocated
268 as a per-channel receive buffer. Increasing this value can make a
269 significant difference to network performance. 24kB was empirically
270 chosen for a 100mbit ethernet network. The value can be altered at
271 runtime with the -W argument. */
272 #ifndef DEFAULT_RECV_WINDOW
273 #define DEFAULT_RECV_WINDOW 12288
274 #endif
275 /* Maximum size of a received SSH data packet - this _MUST_ be >= 32768
276 in order to interoperate with other implementations */
277 #ifndef RECV_MAX_PAYLOAD_LEN
278 #define RECV_MAX_PAYLOAD_LEN 32768
279 #endif
280 /* Maximum size of a transmitted data packet - this can be any value,
281 though increasing it may not make a significant difference. */
282 #ifndef TRANS_MAX_PAYLOAD_LEN
283 #define TRANS_MAX_PAYLOAD_LEN 16384
284 #endif
286 /* Ensure that data is transmitted every KEEPALIVE seconds. This can
287 be overridden at runtime with -K. 0 disables keepalives */
288 #define DEFAULT_KEEPALIVE 0
290 /* Ensure that data is received within IDLE_TIMEOUT seconds. This can
291 be overridden at runtime with -I. 0 disables idle timeouts */
292 #define DEFAULT_IDLE_TIMEOUT 0
294 /* The default path. This will often get replaced by the shell */
295 #define DEFAULT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/opt/sbin"
297 /* Some other defines (that mostly should be left alone) are defined
298 * in sysoptions.h */
299 #include "sysoptions.h"
301 #endif /* _OPTIONS_H_ */