diff options
author | Christian Pointner <equinox@anytun.org> | 2008-04-11 23:27:38 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2008-04-11 23:27:38 +0000 |
commit | 696ed48c0758ccbaf6971530234486525896d817 (patch) | |
tree | 890de6a4f7db54acd9ef7aa8b536f1db2a6e32fb /options.cpp | |
parent | new dependencies in Readme (diff) |
Key and Salt Option get blanked out after parsing options
Diffstat (limited to 'options.cpp')
-rw-r--r-- | options.cpp | 8 |
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) |