summaryrefslogtreecommitdiff
path: root/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'options.cpp')
-rw-r--r--options.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/options.cpp b/options.cpp
index ad70459..174844f 100644
--- a/options.cpp
+++ b/options.cpp
@@ -116,12 +116,14 @@ Options::~Options()
i+=2; \
}
-#define PARSE_HEXSTRING_PARAM(SHORT, LONG, VALUE) \
+#define PARSE_HEXSTRING_PARAM_SEC(SHORT, LONG, VALUE) \
else if(str == SHORT || str == LONG) \
{ \
if(argc < 1 || argv[i+1][0] == '-') \
return false; \
VALUE = Buffer(std::string(argv[i+1])); \
+ for(size_t j=0; j < strlen(argv[i+1]); ++j) \
+ argv[i+1][j] = '#'; \
argc--; \
i++; \
}
@@ -177,8 +179,8 @@ bool Options::parse(int argc, char* argv[])
PARSE_SCALAR_PARAM("-w","--window-size", seq_window_size_)
PARSE_SCALAR_PARAM("-m","--mux", mux_)
PARSE_SCALAR_PARAM("-c","--cipher", cipher_)
- PARSE_HEXSTRING_PARAM("-K","--key", key_)
- PARSE_HEXSTRING_PARAM("-A","--salt", salt_)
+ PARSE_HEXSTRING_PARAM_SEC("-K","--key", key_)
+ PARSE_HEXSTRING_PARAM_SEC("-A","--salt", salt_)
PARSE_SCALAR_PARAM("-k","--kd-prf", kd_prf_)
PARSE_SCALAR_PARAM("-a","--auth-algo", auth_algo_)
PARSE_CSLIST_PARAM("-M","--sync-hosts", host_port_queue)