aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-08-19 09:47:34 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-08-19 09:47:34 -0400
commitf5c9f6d4327d7dcd36081426c0a862b6a06a2b61 (patch)
tree5eaaed28604f399e42ac715182e25977f861df42 /src/core
parent7915b651d9e926d829d2241a161c7afdaf0e7ffb (diff)
downloadtor-f5c9f6d4327d7dcd36081426c0a862b6a06a2b61.tar.gz
tor-f5c9f6d4327d7dcd36081426c0a862b6a06a2b61.zip
hs: Don't overwrite DoS parameters on circuit with consensus params
Turns out that the HS DoS defenses parameters were overwritten by the consensus parameters everytime a new consensus would arrive. This means that a service operator can still enable the defenses but as soon as the intro point relay would get a new consensus, they would be overwritten. And at this commit, the network is entirely disabling DoS defenses. Fix this by introducing an "explicit" flag that indicate if the ESTABLISH_INTRO cell DoS extension set those parameters or not. If set, avoid using the consenus at once. We are not bumping the protover HSIntro value for this because 0.4.2.x series is EOL in 1 month and thus 0.4.3.x would be the only series with this bug. We are confident that a backport and then upgrade path to the latest 0.4.4.x stable coming up soon is enough to mitigate this problem in the coming months. It avoids the upgrade path on the service side by keeping the requirement for protover HSIntro=5. Fixes #40109 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/or/or_circuit_st.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/or/or_circuit_st.h b/src/core/or/or_circuit_st.h
index 9bfe999728..4e17b1c143 100644
--- a/src/core/or/or_circuit_st.h
+++ b/src/core/or/or_circuit_st.h
@@ -75,6 +75,10 @@ struct or_circuit_t {
/** If set, the DoS defenses are enabled on this circuit meaning that the
* introduce2_bucket is initialized and used. */
unsigned int introduce2_dos_defense_enabled : 1;
+ /** If set, the DoS defenses were explicitly enabled through the
+ * ESTABLISH_INTRO cell extension. If unset, the consensus is used to learn
+ * if the defenses can be enabled or not. */
+ unsigned int introduce2_dos_defense_explicit : 1;
/** INTRODUCE2 cell bucket controlling how much can go on this circuit. Only
* used if this is a service introduction circuit at the intro point