remove unused variable
[dropbear.git] / options.h
blobf151cdb6082088b494cb8c3fb98d7b6ab2b570e2
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 - server only for now */
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. In general this isn't required */
132 /* #define DSS_PROTOK */
134 /* Control the memory/performance/compression tradeoff for zlib.
135 * Set windowBits=8, memLevel=1 for least memory usage, see your system's
136 * zlib.h for full details.
137 * Default settings (windowBits=15, memLevel=8) will use
138 * 256kB for compression + 32kB for decompression.
139 * windowBits=8, memLevel=1 will use 10kB compression + 32kB decompression.
140 * Note that windowBits is only set for deflate() - inflate() always uses the
141 * default of 15 so as to interoperate with other clients. */
142 #ifndef DROPBEAR_ZLIB_WINDOW_BITS
143 #define DROPBEAR_ZLIB_WINDOW_BITS 15
144 #endif
145 #ifndef DROPBEAR_ZLIB_MEM_LEVEL
146 #define DROPBEAR_ZLIB_MEM_LEVEL 8
147 #endif
149 /* Whether to do reverse DNS lookups. */
150 #define DO_HOST_LOOKUP
152 /* Whether to print the message of the day (MOTD). This doesn't add much code
153 * size */
154 #define DO_MOTD
156 /* The MOTD file path */
157 #ifndef MOTD_FILENAME
158 #define MOTD_FILENAME "/etc/motd"
159 #endif
161 /* Authentication Types - at least one required.
162 RFC Draft requires pubkey auth, and recommends password */
164 /* Note: PAM auth is quite simple, and only works for PAM modules which just do
165 * a simple "Login: " "Password: " (you can edit the strings in svr-authpam.c).
166 * It's useful for systems like OS X where standard password crypts don't work,
167 * but there's an interface via a PAM module - don't bother using it otherwise.
168 * You can't enable both PASSWORD and PAM. */
170 #define ENABLE_SVR_PASSWORD_AUTH
171 /* PAM requires ./configure --enable-pam */
172 /*#define ENABLE_SVR_PAM_AUTH*/
173 #define ENABLE_SVR_PUBKEY_AUTH
175 /* Whether to take public key options in
176 * authorized_keys file into account */
177 #ifdef ENABLE_SVR_PUBKEY_AUTH
178 #define ENABLE_SVR_PUBKEY_OPTIONS
179 #endif
181 #define ENABLE_CLI_PASSWORD_AUTH
182 #define ENABLE_CLI_PUBKEY_AUTH
183 #define ENABLE_CLI_INTERACT_AUTH
185 /* This variable can be used to set a password for client
186 * authentication on the commandline. Beware of platforms
187 * that don't protect environment variables of processes etc. Also
188 * note that it will be provided for all "hidden" client-interactive
189 * style prompts - if you want something more sophisticated, use
190 * SSH_ASKPASS instead. Comment out this var to remove this functionality.*/
191 #define DROPBEAR_PASSWORD_ENV "DROPBEAR_PASSWORD"
193 /* Define this (as well as ENABLE_CLI_PASSWORD_AUTH) to allow the use of
194 * a helper program for the ssh client. The helper program should be
195 * specified in the SSH_ASKPASS environment variable, and dbclient
196 * should be run with DISPLAY set and no tty. The program should
197 * return the password on standard output */
198 /*#define ENABLE_CLI_ASKPASS_HELPER*/
200 /* Random device to use - define either DROPBEAR_RANDOM_DEV or
201 * DROPBEAR_PRNGD_SOCKET.
202 * DROPBEAR_RANDOM_DEV is recommended on hosts with a good /dev/(u)random,
203 * otherwise use run prngd (or egd if you want), specifying the socket.
204 * The device will be queried for a few dozen bytes of seed a couple of times
205 * per session (or more for very long-lived sessions). */
207 /* We'll use /dev/urandom by default, since /dev/random is too much hassle.
208 * If system developers aren't keeping seeds between boots nor getting
209 * any entropy from somewhere it's their own fault. */
210 #define DROPBEAR_RANDOM_DEV "/dev/urandom"
212 /* prngd must be manually set up to produce output */
213 /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
215 /* Specify the number of clients we will allow to be connected but
216 * not yet authenticated. After this limit, connections are rejected */
217 /* The first setting is per-IP, to avoid denial of service */
218 #ifndef MAX_UNAUTH_PER_IP
219 #define MAX_UNAUTH_PER_IP 5
220 #endif
222 /* And then a global limit to avoid chewing memory if connections
223 * come from many IPs */
224 #ifndef MAX_UNAUTH_CLIENTS
225 #define MAX_UNAUTH_CLIENTS 30
226 #endif
228 /* Maximum number of failed authentication tries (server option) */
229 #ifndef MAX_AUTH_TRIES
230 #define MAX_AUTH_TRIES 10
231 #endif
233 /* The default file to store the daemon's process ID, for shutdown
234 scripts etc. This can be overridden with the -P flag */
235 #ifndef DROPBEAR_PIDFILE
236 #define DROPBEAR_PIDFILE "/var/run/dropbear.pid"
237 #endif
239 /* The command to invoke for xauth when using X11 forwarding.
240 * "-q" for quiet */
241 #ifndef XAUTH_COMMAND
242 #define XAUTH_COMMAND "/usr/bin/X11/xauth -q"
243 #endif
245 /* if you want to enable running an sftp server (such as the one included with
246 * OpenSSH), set the path below. If the path isn't defined, sftp will not
247 * be enabled */
248 #ifndef SFTPSERVER_PATH
249 #define SFTPSERVER_PATH "/usr/libexec/sftp-server"
250 #endif
252 /* This is used by the scp binary when used as a client binary. If you're
253 * not using the Dropbear client, you'll need to change it */
254 #define _PATH_SSH_PROGRAM "/usr/bin/dbclient"
256 /* Whether to log commands executed by a client. This only logs the
257 * (single) command sent to the server, not what a user did in a
258 * shell/sftp session etc. */
259 /* #define LOG_COMMANDS */
261 /* Window size limits. These tend to be a trade-off between memory
262 usage and network performance: */
263 /* Size of the network receive window. This amount of memory is allocated
264 as a per-channel receive buffer. Increasing this value can make a
265 significant difference to network performance. 24kB was empirically
266 chosen for a 100mbit ethernet network. The value can be altered at
267 runtime with the -W argument. */
268 #ifndef DEFAULT_RECV_WINDOW
269 #define DEFAULT_RECV_WINDOW 24576
270 #endif
271 /* Maximum size of a received SSH data packet - this _MUST_ be >= 32768
272 in order to interoperate with other implementations */
273 #ifndef RECV_MAX_PAYLOAD_LEN
274 #define RECV_MAX_PAYLOAD_LEN 32768
275 #endif
276 /* Maximum size of a transmitted data packet - this can be any value,
277 though increasing it may not make a significant difference. */
278 #ifndef TRANS_MAX_PAYLOAD_LEN
279 #define TRANS_MAX_PAYLOAD_LEN 16384
280 #endif
282 /* Ensure that data is transmitted every KEEPALIVE seconds. This can
283 be overridden at runtime with -K. 0 disables keepalives */
284 #define DEFAULT_KEEPALIVE 0
286 /* Ensure that data is received within IDLE_TIMEOUT seconds. This can
287 be overridden at runtime with -I. 0 disables idle timeouts */
288 #define DEFAULT_IDLE_TIMEOUT 0
290 /* The default path. This will often get replaced by the shell */
291 #define DEFAULT_PATH "/usr/bin:/bin"
293 /* Some other defines (that mostly should be left alone) are defined
294 * in sysoptions.h */
295 #include "sysoptions.h"
297 #endif /* _OPTIONS_H_ */