summaryrefslogtreecommitdiff
path: root/cli-runopts.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2012-05-17 00:12:42 +0800
committerMatt Johnston <matt@ucc.asn.au>2012-05-17 00:12:42 +0800
commit5b73595b2799b061124c05e6d5d375eab07cbe0b (patch)
treea3f65a5ce911bbf58fa2fb76571a346ef4ca21eb /cli-runopts.c
parent626f8b9b58f599076b4707b3e3cc72cb7aaf1a94 (diff)
downloaddropbear-5b73595b2799b061124c05e6d5d375eab07cbe0b.tar.gz
Add rough support for choosing ciphers/hashes with "-c" or "-m"
Diffstat (limited to 'cli-runopts.c')
-rw-r--r--cli-runopts.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/cli-runopts.c b/cli-runopts.c
index 44d2b24..140b0cf 100644
--- a/cli-runopts.c
+++ b/cli-runopts.c
@@ -86,6 +86,10 @@ static void printhelp() {
#ifdef ENABLE_CLI_PROXYCMD
"-J <proxy_program> Use program pipe rather than TCP connection\n"
#endif
+#ifdef ENABLE_USER_ALGO_LIST
+ "-c <cipher list> Specify preferred ciphers ('-c help' to list options)\n"
+ "-m <MAC list> Specify preferred MACs for packet verification (or '-m help')\n"
+#endif
#ifdef DEBUG_TRACE
"-v verbose (compiled with DEBUG_TRACE)\n"
#endif
@@ -149,6 +153,10 @@ void cli_getopts(int argc, char ** argv) {
#ifndef DISABLE_ZLIB
opts.enable_compress = 1;
#endif
+#ifdef ENABLE_USER_ALGO_LIST
+ opts.cipher_list = NULL;
+ opts.mac_list = NULL;
+#endif
/* not yet
opts.ipv4 = 1;
opts.ipv6 = 1;
@@ -283,6 +291,14 @@ void cli_getopts(int argc, char ** argv) {
cli_opts.agent_fwd = 1;
break;
#endif
+#ifdef ENABLE_USER_ALGO_LIST
+ case 'c':
+ next = &opts.cipher_list;
+ break;
+ case 'm':
+ next = &opts.mac_list;
+ break;
+#endif
#ifdef DEBUG_TRACE
case 'v':
debug_trace = 1;
@@ -290,8 +306,10 @@ void cli_getopts(int argc, char ** argv) {
#endif
case 'F':
case 'e':
+#ifndef ENABLE_USER_ALGO_LIST
case 'c':
case 'm':
+#endif
case 'D':
#ifndef ENABLE_CLI_REMOTETCPFWD
case 'R':
@@ -351,6 +369,10 @@ void cli_getopts(int argc, char ** argv) {
/* And now a few sanity checks and setup */
+#ifdef ENABLE_USER_ALGO_LIST
+ parse_ciphers_macs();
+#endif
+
if (host_arg == NULL) {
printhelp();
exit(EXIT_FAILURE);