comparison cli-runopts.c @ 682:4edea9f363d0

Add rough support for choosing ciphers/hashes with "-c" or "-m"
author Matt Johnston <matt@ucc.asn.au>
date Thu, 17 May 2012 00:12:42 +0800
parents 1291413c7c7e
children aadfa8de977d
comparison
equal deleted inserted replaced
678:6e0899b56ac4 682:4edea9f363d0
84 "-B <endhost:endport> Netcat-alike forwarding\n" 84 "-B <endhost:endport> Netcat-alike forwarding\n"
85 #endif 85 #endif
86 #ifdef ENABLE_CLI_PROXYCMD 86 #ifdef ENABLE_CLI_PROXYCMD
87 "-J <proxy_program> Use program pipe rather than TCP connection\n" 87 "-J <proxy_program> Use program pipe rather than TCP connection\n"
88 #endif 88 #endif
89 #ifdef ENABLE_USER_ALGO_LIST
90 "-c <cipher list> Specify preferred ciphers ('-c help' to list options)\n"
91 "-m <MAC list> Specify preferred MACs for packet verification (or '-m help')\n"
92 #endif
89 #ifdef DEBUG_TRACE 93 #ifdef DEBUG_TRACE
90 "-v verbose (compiled with DEBUG_TRACE)\n" 94 "-v verbose (compiled with DEBUG_TRACE)\n"
91 #endif 95 #endif
92 ,DROPBEAR_VERSION, cli_opts.progname, 96 ,DROPBEAR_VERSION, cli_opts.progname,
93 DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE, DEFAULT_IDLE_TIMEOUT); 97 DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE, DEFAULT_IDLE_TIMEOUT);
147 cli_opts.proxycmd = NULL; 151 cli_opts.proxycmd = NULL;
148 #endif 152 #endif
149 #ifndef DISABLE_ZLIB 153 #ifndef DISABLE_ZLIB
150 opts.enable_compress = 1; 154 opts.enable_compress = 1;
151 #endif 155 #endif
156 #ifdef ENABLE_USER_ALGO_LIST
157 opts.cipher_list = NULL;
158 opts.mac_list = NULL;
159 #endif
152 /* not yet 160 /* not yet
153 opts.ipv4 = 1; 161 opts.ipv4 = 1;
154 opts.ipv6 = 1; 162 opts.ipv6 = 1;
155 */ 163 */
156 opts.recv_window = DEFAULT_RECV_WINDOW; 164 opts.recv_window = DEFAULT_RECV_WINDOW;
281 #ifdef ENABLE_CLI_AGENTFWD 289 #ifdef ENABLE_CLI_AGENTFWD
282 case 'A': 290 case 'A':
283 cli_opts.agent_fwd = 1; 291 cli_opts.agent_fwd = 1;
284 break; 292 break;
285 #endif 293 #endif
294 #ifdef ENABLE_USER_ALGO_LIST
295 case 'c':
296 next = &opts.cipher_list;
297 break;
298 case 'm':
299 next = &opts.mac_list;
300 break;
301 #endif
286 #ifdef DEBUG_TRACE 302 #ifdef DEBUG_TRACE
287 case 'v': 303 case 'v':
288 debug_trace = 1; 304 debug_trace = 1;
289 break; 305 break;
290 #endif 306 #endif
291 case 'F': 307 case 'F':
292 case 'e': 308 case 'e':
309 #ifndef ENABLE_USER_ALGO_LIST
293 case 'c': 310 case 'c':
294 case 'm': 311 case 'm':
312 #endif
295 case 'D': 313 case 'D':
296 #ifndef ENABLE_CLI_REMOTETCPFWD 314 #ifndef ENABLE_CLI_REMOTETCPFWD
297 case 'R': 315 case 'R':
298 #endif 316 #endif
299 #ifndef ENABLE_CLI_LOCALTCPFWD 317 #ifndef ENABLE_CLI_LOCALTCPFWD
348 } 366 }
349 } 367 }
350 } 368 }
351 369
352 /* And now a few sanity checks and setup */ 370 /* And now a few sanity checks and setup */
371
372 #ifdef ENABLE_USER_ALGO_LIST
373 parse_ciphers_macs();
374 #endif
353 375
354 if (host_arg == NULL) { 376 if (host_arg == NULL) {
355 printhelp(); 377 printhelp();
356 exit(EXIT_FAILURE); 378 exit(EXIT_FAILURE);
357 } 379 }