comparison default_options.h @ 1342:8747c2b19152

merge 2017.75
author Matt Johnston <matt@ucc.asn.au>
date Thu, 18 May 2017 22:59:38 +0800
parents 5abbecdecba4
children 4f8eb331174f
comparison
equal deleted inserted replaced
1341:ab35a9ccc2eb 1342:8747c2b19152
1 #ifndef DROPBEAR_DEFAULT_OPTIONS_H_
2 #define DROPBEAR_DEFAULT_OPTIONS_H_
3 /*
4 > > > Read This < < <
5
6 default_options.h.in (this file) documents compile-time options, and provides
7 default values.
8
9 Local customisation should be added to localoptions.h which is
10 used if it exists. Options defined there will override any options in this
11 file (#ifndef guards added by ifndef_wrapper.sh).
12
13 Options can also be defined with -DDROPBEAR_XXX Makefile CFLAGS
14
15 IMPORTANT: Many options will require "make clean" after changes */
16
17 #ifndef DROPBEAR_DEFPORT
18 #define DROPBEAR_DEFPORT "22"
19 #endif
20
21 /* Listen on all interfaces */
22 #ifndef DROPBEAR_DEFADDRESS
23 #define DROPBEAR_DEFADDRESS ""
24 #endif
25
26 /* Default hostkey paths - these can be specified on the command line */
27 #ifndef DSS_PRIV_FILENAME
28 #define DSS_PRIV_FILENAME "/etc/dropbear/dropbear_dss_host_key"
29 #endif
30 #ifndef RSA_PRIV_FILENAME
31 #define RSA_PRIV_FILENAME "/etc/dropbear/dropbear_rsa_host_key"
32 #endif
33 #ifndef ECDSA_PRIV_FILENAME
34 #define ECDSA_PRIV_FILENAME "/etc/dropbear/dropbear_ecdsa_host_key"
35 #endif
36
37 /* Set NON_INETD_MODE if you require daemon functionality (ie Dropbear listens
38 * on chosen ports and keeps accepting connections. This is the default.
39 *
40 * Set INETD_MODE if you want to be able to run Dropbear with inetd (or
41 * similar), where it will use stdin/stdout for connections, and each process
42 * lasts for a single connection. Dropbear should be invoked with the -i flag
43 * for inetd, and can only accept IPv4 connections.
44 *
45 * Both of these flags can be defined at once, don't compile without at least
46 * one of them. */
47 #ifndef NON_INETD_MODE
48 #define NON_INETD_MODE 1
49 #endif
50 #ifndef INETD_MODE
51 #define INETD_MODE 1
52 #endif
53
54 /* Setting this disables the fast exptmod bignum code. It saves ~5kB, but is
55 * perhaps 20% slower for pubkey operations (it is probably worth experimenting
56 * if you want to use this) */
57 /*#define NO_FAST_EXPTMOD*/
58
59 /* Set this if you want to use the DROPBEAR_SMALL_CODE option. This can save
60 several kB in binary size however will make the symmetrical ciphers and hashes
61 slower, perhaps by 50%. Recommended for small systems that aren't doing
62 much traffic. */
63 #ifndef DROPBEAR_SMALL_CODE
64 #define DROPBEAR_SMALL_CODE 1
65 #endif
66
67 /* Enable X11 Forwarding - server only */
68 #ifndef DROPBEAR_X11FWD
69 #define DROPBEAR_X11FWD 1
70 #endif
71
72 /* Enable TCP Fowarding */
73 /* 'Local' is "-L" style (client listening port forwarded via server)
74 * 'Remote' is "-R" style (server listening port forwarded via client) */
75
76 #ifndef DROPBEAR_CLI_LOCALTCPFWD
77 #define DROPBEAR_CLI_LOCALTCPFWD 1
78 #endif
79 #ifndef DROPBEAR_CLI_REMOTETCPFWD
80 #define DROPBEAR_CLI_REMOTETCPFWD 1
81 #endif
82
83 #ifndef DROPBEAR_SVR_LOCALTCPFWD
84 #define DROPBEAR_SVR_LOCALTCPFWD 1
85 #endif
86 #ifndef DROPBEAR_SVR_REMOTETCPFWD
87 #define DROPBEAR_SVR_REMOTETCPFWD 1
88 #endif
89
90 /* Enable Authentication Agent Forwarding */
91 #ifndef DROPBEAR_SVR_AGENTFWD
92 #define DROPBEAR_SVR_AGENTFWD 1
93 #endif
94 #ifndef DROPBEAR_CLI_AGENTFWD
95 #define DROPBEAR_CLI_AGENTFWD 1
96 #endif
97
98
99 /* Note: Both DROPBEAR_CLI_PROXYCMD and DROPBEAR_CLI_NETCAT must be set to
100 * allow multihop dbclient connections */
101
102 /* Allow using -J <proxycommand> to run the connection through a
103 pipe to a program, rather the normal TCP connection */
104 #ifndef DROPBEAR_CLI_PROXYCMD
105 #define DROPBEAR_CLI_PROXYCMD 1
106 #endif
107
108 /* Enable "Netcat mode" option. This will forward standard input/output
109 * to a remote TCP-forwarded connection */
110 #ifndef DROPBEAR_CLI_NETCAT
111 #define DROPBEAR_CLI_NETCAT 1
112 #endif
113
114 /* Whether to support "-c" and "-m" flags to choose ciphers/MACs at runtime */
115 #ifndef ENABLE_USER_ALGO_LIST
116 #define ENABLE_USER_ALGO_LIST 1
117 #endif
118
119 /* Encryption - at least one required.
120 * Protocol RFC requires 3DES and recommends AES128 for interoperability.
121 * Including multiple keysize variants the same cipher
122 * (eg AES256 as well as AES128) will result in a minimal size increase.*/
123 #ifndef DROPBEAR_AES128
124 #define DROPBEAR_AES128 1
125 #endif
126 #ifndef DROPBEAR_3DES
127 #define DROPBEAR_3DES 1
128 #endif
129 #ifndef DROPBEAR_AES256
130 #define DROPBEAR_AES256 1
131 #endif
132 /* Compiling in Blowfish will add ~6kB to runtime heap memory usage */
133 /*#define DROPBEAR_BLOWFISH*/
134 #ifndef DROPBEAR_TWOFISH256
135 #define DROPBEAR_TWOFISH256 1
136 #endif
137 #ifndef DROPBEAR_TWOFISH128
138 #define DROPBEAR_TWOFISH128 1
139 #endif
140
141 /* Enable CBC mode for ciphers. This has security issues though
142 * is the most compatible with older SSH implementations */
143 #ifndef DROPBEAR_ENABLE_CBC_MODE
144 #define DROPBEAR_ENABLE_CBC_MODE 1
145 #endif
146
147 /* Enable "Counter Mode" for ciphers. This is more secure than normal
148 * CBC mode against certain attacks. It is recommended for security
149 * and forwards compatibility */
150 #ifndef DROPBEAR_ENABLE_CTR_MODE
151 #define DROPBEAR_ENABLE_CTR_MODE 1
152 #endif
153
154 /* Twofish counter mode is disabled by default because it
155 has not been tested for interoperability with other SSH implementations.
156 If you test it please contact the Dropbear author */
157 #ifndef DROPBEAR_TWOFISH_CTR
158 #define DROPBEAR_TWOFISH_CTR 0
159 #endif
160
161 /* Message integrity. sha2-256 is recommended as a default,
162 sha1 for compatibility */
163 #ifndef DROPBEAR_SHA1_HMAC
164 #define DROPBEAR_SHA1_HMAC 1
165 #endif
166 #ifndef DROPBEAR_SHA1_96_HMAC
167 #define DROPBEAR_SHA1_96_HMAC 1
168 #endif
169 #ifndef DROPBEAR_SHA2_256_HMAC
170 #define DROPBEAR_SHA2_256_HMAC 1
171 #endif
172 /* Default is to include it is sha512 is being compiled in for ECDSA */
173 #ifndef DROPBEAR_SHA2_512_HMAC
174 #define DROPBEAR_SHA2_512_HMAC (DROPBEAR_ECDSA)
175 #endif
176
177 /* XXX needed for fingerprints */
178 #ifndef DROPBEAR_MD5_HMAC
179 #define DROPBEAR_MD5_HMAC 0
180 #endif
181
182 /* Hostkey/public key algorithms - at least one required, these are used
183 * for hostkey as well as for verifying signatures with pubkey auth.
184 * Removing either of these won't save very much space.
185 * RSA is recommended
186 * DSS may be necessary to connect to some systems though
187 is not recommended for new keys */
188 #ifndef DROPBEAR_RSA
189 #define DROPBEAR_RSA 1
190 #endif
191 #ifndef DROPBEAR_DSS
192 #define DROPBEAR_DSS 1
193 #endif
194 /* ECDSA is significantly faster than RSA or DSS. Compiling in ECC
195 * code (either ECDSA or ECDH) increases binary size - around 30kB
196 * on x86-64 */
197 #ifndef DROPBEAR_ECDSA
198 #define DROPBEAR_ECDSA 1
199 #endif
200
201 /* Add runtime flag "-R" to generate hostkeys as-needed when the first
202 connection using that key type occurs.
203 This avoids the need to otherwise run "dropbearkey" and avoids some problems
204 with badly seeded /dev/urandom when systems first boot. */
205 #ifndef DROPBEAR_DELAY_HOSTKEY
206 #define DROPBEAR_DELAY_HOSTKEY 1
207 #endif
208
209 /* Enable Curve25519 for key exchange. This is another elliptic
210 * curve method with good security properties. Increases binary size
211 * by ~8kB on x86-64 */
212 #ifndef DROPBEAR_CURVE25519
213 #define DROPBEAR_CURVE25519 1
214 #endif
215
216 /* Enable elliptic curve Diffie Hellman key exchange, see note about
217 * ECDSA above */
218 #ifndef DROPBEAR_ECDH
219 #define DROPBEAR_ECDH 1
220 #endif
221
222 /* Key exchange algorithm.
223 * group14_sha1 - 2048 bit, sha1
224 * group14_sha256 - 2048 bit, sha2-256
225 * group16 - 4096 bit, sha2-512
226 * group1 - 1024 bit, sha1
227 *
228 * group14 is supported by most implementations.
229 * group16 provides a greater strength level but is slower and increases binary size
230 * group1 is too small for security though is necessary if you need
231 compatibility with some implementations such as Dropbear versions < 0.53
232 */
233 #ifndef DROPBEAR_DH_GROUP1
234 #define DROPBEAR_DH_GROUP1 1
235 #endif
236 #ifndef DROPBEAR_DH_GROUP14_SHA1
237 #define DROPBEAR_DH_GROUP14_SHA1 1
238 #endif
239 #ifndef DROPBEAR_DH_GROUP14_SHA256
240 #define DROPBEAR_DH_GROUP14_SHA256 1
241 #endif
242 #ifndef DROPBEAR_DH_GROUP16
243 #define DROPBEAR_DH_GROUP16 0
244 #endif
245
246 /* Control the memory/performance/compression tradeoff for zlib.
247 * Set windowBits=8 for least memory usage, see your system's
248 * zlib.h for full details.
249 * Default settings (windowBits=15) will use 256kB for compression
250 * windowBits=8 will use 129kB for compression.
251 * Both modes will use ~35kB for decompression (using windowBits=15 for
252 * interoperability) */
253 #ifndef DROPBEAR_ZLIB_WINDOW_BITS
254 #define DROPBEAR_ZLIB_WINDOW_BITS 15
255 #endif
256
257 /* Whether to do reverse DNS lookups. */
258 #ifndef DO_HOST_LOOKUP
259 #define DO_HOST_LOOKUP 0
260 #endif
261
262 /* Whether to print the message of the day (MOTD). */
263 #ifndef DO_MOTD
264 #define DO_MOTD 0
265 #endif
266
267 /* The MOTD file path */
268 #ifndef MOTD_FILENAME
269 #define MOTD_FILENAME "/etc/motd"
270 #endif
271
272 /* Authentication Types - at least one required.
273 RFC Draft requires pubkey auth, and recommends password */
274
275 /* Note: PAM auth is quite simple and only works for PAM modules which just do
276 * a simple "Login: " "Password: " (you can edit the strings in svr-authpam.c).
277 * It's useful for systems like OS X where standard password crypts don't work
278 * but there's an interface via a PAM module. It won't work for more complex
279 * PAM challenge/response.
280 * You can't enable both PASSWORD and PAM. */
281
282 /* This requires crypt() */
283 #ifdef HAVE_CRYPT
284 #ifndef DROPBEAR_SVR_PASSWORD_AUTH
285 #define DROPBEAR_SVR_PASSWORD_AUTH 1
286 #endif
287 #else
288 #ifndef DROPBEAR_SVR_PASSWORD_AUTH
289 #define DROPBEAR_SVR_PASSWORD_AUTH 0
290 #endif
291 #endif
292 /* PAM requires ./configure --enable-pam */
293 #ifndef DROPBEAR_SVR_PAM_AUTH
294 #define DROPBEAR_SVR_PAM_AUTH 0
295 #endif
296 #ifndef DROPBEAR_SVR_PUBKEY_AUTH
297 #define DROPBEAR_SVR_PUBKEY_AUTH 1
298 #endif
299
300 /* Whether to take public key options in
301 * authorized_keys file into account */
302 #ifndef DROPBEAR_SVR_PUBKEY_OPTIONS
303 #define DROPBEAR_SVR_PUBKEY_OPTIONS 1
304 #endif
305
306 /* This requires getpass. */
307 #ifdef HAVE_GETPASS
308 #ifndef DROPBEAR_CLI_PASSWORD_AUTH
309 #define DROPBEAR_CLI_PASSWORD_AUTH 1
310 #endif
311 #ifndef DROPBEAR_CLI_INTERACT_AUTH
312 #define DROPBEAR_CLI_INTERACT_AUTH 1
313 #endif
314 #endif
315 #ifndef DROPBEAR_CLI_PUBKEY_AUTH
316 #define DROPBEAR_CLI_PUBKEY_AUTH 1
317 #endif
318
319 /* A default argument for dbclient -i <privatekey>.
320 Homedir is prepended unless path begins with / */
321 #ifndef DROPBEAR_DEFAULT_CLI_AUTHKEY
322 #define DROPBEAR_DEFAULT_CLI_AUTHKEY ".ssh/id_dropbear"
323 #endif
324
325 /* This variable can be used to set a password for client
326 * authentication on the commandline. Beware of platforms
327 * that don't protect environment variables of processes etc. Also
328 * note that it will be provided for all "hidden" client-interactive
329 * style prompts - if you want something more sophisticated, use
330 * SSH_ASKPASS instead. Comment out this var to remove this functionality.*/
331 #ifndef DROPBEAR_PASSWORD_ENV
332 #define DROPBEAR_PASSWORD_ENV "DROPBEAR_PASSWORD"
333 #endif
334
335 /* Define this (as well as DROPBEAR_CLI_PASSWORD_AUTH) to allow the use of
336 * a helper program for the ssh client. The helper program should be
337 * specified in the SSH_ASKPASS environment variable, and dbclient
338 * should be run with DISPLAY set and no tty. The program should
339 * return the password on standard output */
340 #ifndef DROPBEAR_CLI_ASKPASS_HELPER
341 #define DROPBEAR_CLI_ASKPASS_HELPER 0
342 #endif
343
344 /* Save a network roundtrip by sendng a real auth request immediately after
345 * sending a query for the available methods. It is at the expense of < 100
346 * bytes of extra network traffic. This is not yet enabled by default since it
347 * could cause problems with non-compliant servers */
348 #ifndef DROPBEAR_CLI_IMMEDIATE_AUTH
349 #define DROPBEAR_CLI_IMMEDIATE_AUTH 0
350 #endif
351
352 /* Source for randomness. This must be able to provide hundreds of bytes per SSH
353 * connection without blocking. In addition /dev/random is used for seeding
354 * rsa/dss key generation */
355 #ifndef DROPBEAR_URANDOM_DEV
356 #define DROPBEAR_URANDOM_DEV "/dev/urandom"
357 #endif
358
359 /* Set this to use PRNGD or EGD instead of /dev/urandom or /dev/random */
360 /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
361
362
363 /* Specify the number of clients we will allow to be connected but
364 * not yet authenticated. After this limit, connections are rejected */
365 /* The first setting is per-IP, to avoid denial of service */
366 #ifndef MAX_UNAUTH_PER_IP
367 #define MAX_UNAUTH_PER_IP 5
368 #endif
369
370 /* And then a global limit to avoid chewing memory if connections
371 * come from many IPs */
372 #ifndef MAX_UNAUTH_CLIENTS
373 #define MAX_UNAUTH_CLIENTS 30
374 #endif
375
376 /* Maximum number of failed authentication tries (server option) */
377 #ifndef MAX_AUTH_TRIES
378 #define MAX_AUTH_TRIES 10
379 #endif
380
381 /* The default file to store the daemon's process ID, for shutdown
382 scripts etc. This can be overridden with the -P flag */
383 #ifndef DROPBEAR_PIDFILE
384 #define DROPBEAR_PIDFILE "/var/run/dropbear.pid"
385 #endif
386
387 /* The command to invoke for xauth when using X11 forwarding.
388 * "-q" for quiet */
389 #ifndef XAUTH_COMMAND
390 #define XAUTH_COMMAND "/usr/bin/xauth -q"
391 #endif
392
393 /* if you want to enable running an sftp server (such as the one included with
394 * OpenSSH), set the path below. If the path isn't defined, sftp will not
395 * be enabled */
396 #ifndef SFTPSERVER_PATH
397 #define SFTPSERVER_PATH "/usr/libexec/sftp-server"
398 #endif
399
400 /* This is used by the scp binary when used as a client binary. If you're
401 * not using the Dropbear client, you'll need to change it */
402 #ifndef DROPBEAR_PATH_SSH_PROGRAM
403 #define DROPBEAR_PATH_SSH_PROGRAM "/usr/bin/dbclient"
404 #endif
405
406 /* Whether to log commands executed by a client. This only logs the
407 * (single) command sent to the server, not what a user did in a
408 * shell/sftp session etc. */
409 #ifndef LOG_COMMANDS
410 #define LOG_COMMANDS 0
411 #endif
412
413 /* Window size limits. These tend to be a trade-off between memory
414 usage and network performance: */
415 /* Size of the network receive window. This amount of memory is allocated
416 as a per-channel receive buffer. Increasing this value can make a
417 significant difference to network performance. 24kB was empirically
418 chosen for a 100mbit ethernet network. The value can be altered at
419 runtime with the -W argument. */
420 #ifndef DEFAULT_RECV_WINDOW
421 #define DEFAULT_RECV_WINDOW 24576
422 #endif
423 /* Maximum size of a received SSH data packet - this _MUST_ be >= 32768
424 in order to interoperate with other implementations */
425 #ifndef RECV_MAX_PAYLOAD_LEN
426 #define RECV_MAX_PAYLOAD_LEN 32768
427 #endif
428 /* Maximum size of a transmitted data packet - this can be any value,
429 though increasing it may not make a significant difference. */
430 #ifndef TRANS_MAX_PAYLOAD_LEN
431 #define TRANS_MAX_PAYLOAD_LEN 16384
432 #endif
433
434 /* Ensure that data is transmitted every KEEPALIVE seconds. This can
435 be overridden at runtime with -K. 0 disables keepalives */
436 #ifndef DEFAULT_KEEPALIVE
437 #define DEFAULT_KEEPALIVE 0
438 #endif
439
440 /* If this many KEEPALIVES are sent with no packets received from the
441 other side, exit. Not run-time configurable - if you have a need
442 for runtime configuration please mail the Dropbear list */
443 #ifndef DEFAULT_KEEPALIVE_LIMIT
444 #define DEFAULT_KEEPALIVE_LIMIT 3
445 #endif
446
447 /* Ensure that data is received within IDLE_TIMEOUT seconds. This can
448 be overridden at runtime with -I. 0 disables idle timeouts */
449 #ifndef DEFAULT_IDLE_TIMEOUT
450 #define DEFAULT_IDLE_TIMEOUT 0
451 #endif
452
453 /* The default path. This will often get replaced by the shell */
454 #ifndef DEFAULT_PATH
455 #define DEFAULT_PATH "/usr/bin:/bin"
456 #endif
457
458 #endif /* DROPBEAR_DEFAULT_OPTIONS_H_ */