MiniDLNA update: 1.0.19.1 to 1.0.20
[tomato.git] / release / src / router / dropbear / options.h
blob0737e757ddd615ad4a97cec95b3091149655d850
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 - don't bother using it otherwise.
165 * You can't enable both PASSWORD and PAM. */
167 #define ENABLE_SVR_PASSWORD_AUTH
168 /* PAM requires ./configure --enable-pam */
169 /*#define ENABLE_SVR_PAM_AUTH*/
170 #define ENABLE_SVR_PUBKEY_AUTH
172 /* Whether to take public key options in
173 * authorized_keys file into account */
174 #ifdef ENABLE_SVR_PUBKEY_AUTH
175 #define ENABLE_SVR_PUBKEY_OPTIONS
176 #endif
178 #define ENABLE_CLI_PASSWORD_AUTH
179 #define ENABLE_CLI_PUBKEY_AUTH
180 #define ENABLE_CLI_INTERACT_AUTH
182 /* This variable can be used to set a password for client
183 * authentication on the commandline. Beware of platforms
184 * that don't protect environment variables of processes etc. Also
185 * note that it will be provided for all "hidden" client-interactive
186 * style prompts - if you want something more sophisticated, use
187 * SSH_ASKPASS instead. Comment out this var to remove this functionality.*/
188 /*#define DROPBEAR_PASSWORD_ENV "DROPBEAR_PASSWORD"*/
190 /* Define this (as well as ENABLE_CLI_PASSWORD_AUTH) to allow the use of
191 * a helper program for the ssh client. The helper program should be
192 * specified in the SSH_ASKPASS environment variable, and dbclient
193 * should be run with DISPLAY set and no tty. The program should
194 * return the password on standard output */
195 /*#define ENABLE_CLI_ASKPASS_HELPER*/
197 /* Random device to use - define either DROPBEAR_RANDOM_DEV or
198 * DROPBEAR_PRNGD_SOCKET.
199 * DROPBEAR_RANDOM_DEV is recommended on hosts with a good /dev/(u)random,
200 * otherwise use run prngd (or egd if you want), specifying the socket.
201 * The device will be queried for a few dozen bytes of seed a couple of times
202 * per session (or more for very long-lived sessions). */
204 /* We'll use /dev/urandom by default, since /dev/random is too much hassle.
205 * If system developers aren't keeping seeds between boots nor getting
206 * any entropy from somewhere it's their own fault. */
207 #define DROPBEAR_RANDOM_DEV "/dev/urandom"
209 /* prngd must be manually set up to produce output */
210 /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
212 /* Specify the number of clients we will allow to be connected but
213 * not yet authenticated. After this limit, connections are rejected */
214 /* The first setting is per-IP, to avoid denial of service */
215 #ifndef MAX_UNAUTH_PER_IP
216 #define MAX_UNAUTH_PER_IP 5
217 #endif
219 /* And then a global limit to avoid chewing memory if connections
220 * come from many IPs */
221 #ifndef MAX_UNAUTH_CLIENTS
222 #define MAX_UNAUTH_CLIENTS 30
223 #endif
225 /* Maximum number of failed authentication tries (server option) */
226 #ifndef MAX_AUTH_TRIES
227 #define MAX_AUTH_TRIES 10
228 #endif
230 /* The default file to store the daemon's process ID, for shutdown
231 scripts etc. This can be overridden with the -P flag */
232 #ifndef DROPBEAR_PIDFILE
233 #define DROPBEAR_PIDFILE "/var/run/dropbear.pid"
234 #endif
236 /* The command to invoke for xauth when using X11 forwarding.
237 * "-q" for quiet */
238 #ifndef XAUTH_COMMAND
239 #define XAUTH_COMMAND "/opt/X11R6/bin/xauth -q"
240 #endif
242 /* if you want to enable running an sftp server (such as the one included with
243 * OpenSSH), set the path below. If the path isn't defined, sftp will not
244 * be enabled */
245 #ifndef SFTPSERVER_PATH
246 #define SFTPSERVER_PATH "/opt/libexec/sftp-server"
247 #endif
249 /* This is used by the scp binary when used as a client binary. If you're
250 * not using the Dropbear client, you'll need to change it */
251 #define _PATH_SSH_PROGRAM "/usr/bin/dbclient"
253 /* Whether to log commands executed by a client. This only logs the
254 * (single) command sent to the server, not what a user did in a
255 * shell/sftp session etc. */
256 /* #define LOG_COMMANDS */
258 /* Window size limits. These tend to be a trade-off between memory
259 usage and network performance: */
260 /* Size of the network receive window. This amount of memory is allocated
261 as a per-channel receive buffer. Increasing this value can make a
262 significant difference to network performance. 24kB was empirically
263 chosen for a 100mbit ethernet network. The value can be altered at
264 runtime with the -W argument. */
265 #ifndef DEFAULT_RECV_WINDOW
266 #define DEFAULT_RECV_WINDOW 12288
267 #endif
268 /* Maximum size of a received SSH data packet - this _MUST_ be >= 32768
269 in order to interoperate with other implementations */
270 #ifndef RECV_MAX_PAYLOAD_LEN
271 #define RECV_MAX_PAYLOAD_LEN 32768
272 #endif
273 /* Maximum size of a transmitted data packet - this can be any value,
274 though increasing it may not make a significant difference. */
275 #ifndef TRANS_MAX_PAYLOAD_LEN
276 #define TRANS_MAX_PAYLOAD_LEN 16384
277 #endif
279 /* Ensure that data is transmitted every KEEPALIVE seconds. This can
280 be overridden at runtime with -K. 0 disables keepalives */
281 #define DEFAULT_KEEPALIVE 0
283 /* Ensure that data is received within IDLE_TIMEOUT seconds. This can
284 be overridden at runtime with -I. 0 disables idle timeouts */
285 #define DEFAULT_IDLE_TIMEOUT 0
287 /* The default path. This will often get replaced by the shell */
288 #define DEFAULT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/opt/bin:/opt/sbin"
290 /* Some other defines (that mostly should be left alone) are defined
291 * in sysoptions.h */
292 #include "sysoptions.h"
294 #endif /* _OPTIONS_H_ */