From 696ed48c0758ccbaf6971530234486525896d817 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 11 Apr 2008 23:27:38 +0000 Subject: Key and Salt Option get blanked out after parsing options --- options.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'options.cpp') 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) -- cgit v1.2.3