瀏覽代碼

hs-v3: Don't apply DoS defenses if circuit has not been flagged

Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet 4 年之前
父節點
當前提交
aee66c80bd
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/feature/hs/hs_dos.c

+ 4 - 2
src/feature/hs/hs_dos.c

@@ -156,8 +156,10 @@ hs_dos_can_send_intro2(or_circuit_t *s_intro_circ)
 {
   tor_assert(s_intro_circ);
 
-  /* Always allowed if the defense is disabled. */
-  if (!param_introduce_defense_enabled) {
+  /* Allow to send the cell if the DoS defenses are disabled on the circuit.
+   * This can be set by the consensus, the ESTABLISH_INTRO cell extension or
+   * the hardcoded values in tor code. */
+  if (!s_intro_circ->introduce2_dos_defense_enabled) {
     return true;
   }