diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config/config.c | 23 | ||||
-rw-r--r-- | src/app/config/or_options_st.h | 11 | ||||
-rw-r--r-- | src/app/main/main.c | 1 |
3 files changed, 35 insertions, 0 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 26a3061a26..d03305627b 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -597,6 +597,8 @@ static config_var_t option_vars_[] = { V(ReducedConnectionPadding, BOOL, "0"), V(ConnectionPadding, AUTOBOOL, "auto"), V(RefuseUnknownExits, AUTOBOOL, "auto"), + V(CircuitPadding, BOOL, "1"), + V(ReducedCircuitPadding, BOOL, "0"), V(RejectPlaintextPorts, CSV, ""), V(RelayBandwidthBurst, MEMUNIT, "0"), V(RelayBandwidthRate, MEMUNIT, "0"), @@ -2447,6 +2449,7 @@ static const struct { { "--quiet", TAKES_NO_ARGUMENT }, { "--hush", TAKES_NO_ARGUMENT }, { "--version", TAKES_NO_ARGUMENT }, + { "--list-modules", TAKES_NO_ARGUMENT }, { "--library-versions", TAKES_NO_ARGUMENT }, { "-h", TAKES_NO_ARGUMENT }, { "--help", TAKES_NO_ARGUMENT }, @@ -2668,6 +2671,13 @@ list_deprecated_options(void) } } +/** Print all compile-time modules and their enabled/disabled status. */ +static void +list_enabled_modules(void) +{ + printf("%s: %s\n", "dirauth", have_module_dirauth() ? "yes" : "no"); +} + /** Last value actually set by resolve_my_address. */ static uint32_t last_resolved_addr = 0; @@ -3744,6 +3754,14 @@ options_validate(or_options_t *old_options, or_options_t *options, REJECT("Relays cannot set ReducedConnectionPadding. "); } + if (server_mode(options) && options->CircuitPadding == 0) { + REJECT("Relays cannot set CircuitPadding to 0. "); + } + + if (server_mode(options) && options->ReducedCircuitPadding == 1) { + REJECT("Relays cannot set ReducedCircuitPadding. "); + } + if (options->BridgeDistribution) { if (!options->BridgeRelay) { REJECT("You set BridgeDistribution, but you didn't set BridgeRelay!"); @@ -5185,6 +5203,11 @@ options_init_from_torrc(int argc, char **argv) return 1; } + if (config_line_find(cmdline_only_options, "--list-modules")) { + list_enabled_modules(); + return 1; + } + if (config_line_find(cmdline_only_options, "--library-versions")) { printf("Tor version %s. \n", get_version()); printf("Library versions\tCompiled\t\tRuntime\n"); diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h index bd707fd193..4e03bec7fa 100644 --- a/src/app/config/or_options_st.h +++ b/src/app/config/or_options_st.h @@ -248,6 +248,17 @@ struct or_options_t { * pad to the server regardless of server support. */ int ConnectionPadding; + /** Boolean: if true, then circuit padding will be negotiated by client + * and server, subject to consenus limits (default). If 0, it will be fully + * disabled. */ + int CircuitPadding; + + /** Boolean: if true, then this client will only use circuit padding + * algorithms that are known to use a low amount of overhead. If false, + * we will use all available circuit padding algorithms. + */ + int ReducedCircuitPadding; + /** To what authority types do we publish our descriptor? Choices are * "v1", "v2", "v3", "bridge", or "". */ struct smartlist_t *PublishServerDescriptor; diff --git a/src/app/main/main.c b/src/app/main/main.c index 184b9e91da..6e325f0b10 100644 --- a/src/app/main/main.c +++ b/src/app/main/main.c @@ -561,6 +561,7 @@ tor_init(int argc, char *argv[]) if (!strcmp(cl->key, "--version") || !strcmp(cl->key, "--digests") || !strcmp(cl->key, "--list-torrc-options") || !strcmp(cl->key, "--library-versions") || + !strcmp(cl->key, "--list-modules") || !strcmp(cl->key, "--hash-password") || !strcmp(cl->key, "-h") || !strcmp(cl->key, "--help")) { if (quiet < 1) |