From 344ce83a10fc6dea31a3d8fc3ba6c578f3efa742 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 12 Apr 2008 09:48:14 +0000 Subject: added key/salt options blanking to all other tools --- anyctrOptions.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'anyctrOptions.cpp') diff --git a/anyctrOptions.cpp b/anyctrOptions.cpp index d6b0689..3c770bc 100644 --- a/anyctrOptions.cpp +++ b/anyctrOptions.cpp @@ -100,12 +100,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++; \ } @@ -146,8 +148,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("-l","--prefix-len", network_prefix_length_) - 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_) else return false; -- cgit v1.2.3