comparison default_options.h.in @ 1318:10e2a7727253 coverity

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