summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-09-01 10:41:02 -0400
committerNick Mathewson <nickm@torproject.org>2015-09-22 09:24:35 -0400
commitd8f031aec2ee84c753ef282577c7f4fcf0123d2f (patch)
tree7a9298926d759902a4c43ed044350b633eb8a994 /src/or/config.c
parentd891e2a9c517e2b097456b7143f955ac66b112ea (diff)
downloadtor-d8f031aec2ee84c753ef282577c7f4fcf0123d2f.tar.gz
tor-d8f031aec2ee84c753ef282577c7f4fcf0123d2f.zip
Add a new --newpass option to add or remove secret key passphrases.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 6e782de0e0..b4a490c70f 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1918,6 +1918,7 @@ static const struct {
{ "--dump-config", ARGUMENT_OPTIONAL },
{ "--list-fingerprint", TAKES_NO_ARGUMENT },
{ "--keygen", TAKES_NO_ARGUMENT },
+ { "--newpass", TAKES_NO_ARGUMENT },
{ "--no-passphrase", TAKES_NO_ARGUMENT },
{ "--passphrase-fd", ARGUMENT_NECESSARY },
{ "--verify-config", TAKES_NO_ARGUMENT },
@@ -4512,6 +4513,15 @@ options_init_from_torrc(int argc, char **argv)
}
}
+ if (config_line_find(cmdline_only_options, "--newpass")) {
+ if (command == CMD_KEYGEN) {
+ get_options_mutable()->change_key_passphrase = 1;
+ } else {
+ log_err(LD_CONFIG, "--newpass specified without --keygen!");
+ exit(1);
+ }
+ }
+
{
const config_line_t *fd_line = config_line_find(cmdline_only_options,
"--passphrase-fd");