summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-04-12 09:48:14 +0000
committerChristian Pointner <equinox@anytun.org>2008-04-12 09:48:14 +0000
commit344ce83a10fc6dea31a3d8fc3ba6c578f3efa742 (patch)
tree6a45d1e680d462b403512fea2e6c7a78ac2806d0
parentKey and Salt Option get blanked out after parsing options (diff)
added key/salt options blanking to all other tools
-rw-r--r--anyctrOptions.cpp8
-rw-r--r--anymuxOptions.cpp4
-rw-r--r--anyrtpproxy/options.cpp5
-rw-r--r--plain_tool/options.cpp4
4 files changed, 14 insertions, 7 deletions
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;
diff --git a/anymuxOptions.cpp b/anymuxOptions.cpp
index 418eebd..c892e26 100644
--- a/anymuxOptions.cpp
+++ b/anymuxOptions.cpp
@@ -101,12 +101,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++; \
}
diff --git a/anyrtpproxy/options.cpp b/anyrtpproxy/options.cpp
index 6ddd9dc..bdddf75 100644
--- a/anyrtpproxy/options.cpp
+++ b/anyrtpproxy/options.cpp
@@ -112,17 +112,18 @@ Options::~Options()
i++; \
}
-#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++; \
}
-
#define PARSE_CSLIST_PARAM(SHORT, LONG, LIST) \
else if(str == SHORT || str == LONG) \
{ \
diff --git a/plain_tool/options.cpp b/plain_tool/options.cpp
index 1dcf8a2..f8dc187 100644
--- a/plain_tool/options.cpp
+++ b/plain_tool/options.cpp
@@ -92,12 +92,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++; \
}