summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-01-14 14:48:00 -0500
committerNick Mathewson <nickm@torproject.org>2019-01-14 14:48:00 -0500
commitb169c8c14f23394b40305f38ee4ce08add278e27 (patch)
tree0649da16a97792103773f9d5cedbfd75deac49bd /src/app
parent691dec5d4615dec9a845d0f7dea7ef55cc66fe62 (diff)
parentb269ab5aaeee65a3a0b1e5e0923d9dc7898c232e (diff)
downloadtor-b169c8c14f23394b40305f38ee4ce08add278e27.tar.gz
tor-b169c8c14f23394b40305f38ee4ce08add278e27.zip
Merge remote-tracking branch 'asn-github/adaptive_padding-final'
Diffstat (limited to 'src/app')
-rw-r--r--src/app/config/config.c6
-rw-r--r--src/app/config/or_options_st.h3
-rw-r--r--src/app/main/main.c10
3 files changed, 17 insertions, 2 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c
index 22070c346b..ecf4c21545 100644
--- a/src/app/config/config.c
+++ b/src/app/config/config.c
@@ -421,6 +421,10 @@ static config_var_t option_vars_[] = {
V(ExcludeExitNodes, ROUTERSET, NULL),
OBSOLETE("ExcludeSingleHopRelays"),
V(ExitNodes, ROUTERSET, NULL),
+ /* Researchers need a way to tell their clients to use specific
+ * middles that they also control, to allow safe live-network
+ * experimentation with new padding machines. */
+ V(MiddleNodes, ROUTERSET, NULL),
V(ExitPolicy, LINELIST, NULL),
V(ExitPolicyRejectPrivate, BOOL, "1"),
V(ExitPolicyRejectLocalInterfaces, BOOL, "0"),
@@ -1693,6 +1697,7 @@ options_need_geoip_info(const or_options_t *options, const char **reason_out)
int routerset_usage =
routerset_needs_geoip(options->EntryNodes) ||
routerset_needs_geoip(options->ExitNodes) ||
+ routerset_needs_geoip(options->MiddleNodes) ||
routerset_needs_geoip(options->ExcludeExitNodes) ||
routerset_needs_geoip(options->ExcludeNodes) ||
routerset_needs_geoip(options->HSLayer2Nodes) ||
@@ -2132,6 +2137,7 @@ options_act(const or_options_t *old_options)
options->HSLayer2Nodes) ||
!routerset_equal(old_options->HSLayer3Nodes,
options->HSLayer3Nodes) ||
+ !routerset_equal(old_options->MiddleNodes, options->MiddleNodes) ||
options->StrictNodes != old_options->StrictNodes) {
log_info(LD_CIRC,
"Changed to using entry guards or bridges, or changed "
diff --git a/src/app/config/or_options_st.h b/src/app/config/or_options_st.h
index c2bc1079a5..63a17c9771 100644
--- a/src/app/config/or_options_st.h
+++ b/src/app/config/or_options_st.h
@@ -72,6 +72,9 @@ struct or_options_t {
routerset_t *ExitNodes; /**< Structure containing nicknames, digests,
* country codes and IP address patterns of ORs to
* consider as exits. */
+ routerset_t *MiddleNodes; /**< Structure containing nicknames, digests,
+ * country codes and IP address patterns of ORs to
+ * consider as middles. */
routerset_t *EntryNodes;/**< Structure containing nicknames, digests,
* country codes and IP address patterns of ORs to
* consider as entry points. */
diff --git a/src/app/main/main.c b/src/app/main/main.c
index d71e43ec30..ba2dfebd77 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -22,6 +22,7 @@
#include "core/mainloop/netstatus.h"
#include "core/or/channel.h"
#include "core/or/channelpadding.h"
+#include "core/or/circuitpadding.h"
#include "core/or/channeltls.h"
#include "core/or/circuitlist.h"
#include "core/or/circuitmux_ewma.h"
@@ -645,9 +646,13 @@ tor_init(int argc, char *argv[])
/* The options are now initialised */
const or_options_t *options = get_options();
- /* Initialize channelpadding parameters to defaults until we get
- * a consensus */
+ /* Initialize channelpadding and circpad parameters to defaults
+ * until we get a consensus */
channelpadding_new_consensus_params(NULL);
+ circpad_new_consensus_params(NULL);
+
+ /* Initialize circuit padding to defaults+torrc until we get a consensus */
+ circpad_machines_init();
/* Initialize predicted ports list after loading options */
predicted_ports_init();
@@ -766,6 +771,7 @@ tor_free_all(int postfork)
dns_free_all();
clear_pending_onions();
circuit_free_all();
+ circpad_machines_free();
entry_guards_free_all();
pt_free_all();
channel_tls_free_all();