Просмотр исходного кода

Clarify threat description and avoid negative uptimes.

Nick Mathewson 15 лет назад
Родитель
Сommit
3a0c602155
2 измененных файлов с 5 добавлено и 4 удалено
  1. 4 3
      changes/hsdir_assignment
  2. 1 1
      src/or/rephist.c

+ 4 - 3
changes/hsdir_assignment

@@ -2,6 +2,7 @@
     - Directory authorities now use data collected from rephist when
     - Directory authorities now use data collected from rephist when
       choosing whether to assign the HSDir flag to relays, instead of
       choosing whether to assign the HSDir flag to relays, instead of
       trusting the uptime value the relay reports in its descriptor.
       trusting the uptime value the relay reports in its descriptor.
-      This helps prevent an attack where relatively few malaicious
-      nodes can blackhole any given hidden service. Bugfix on
-      0.2.0.10-alpha; fixes bug 2709.
+      This helps prevent an attack where a small set of nodes with
+      frequently-changing identity keys can blackhole a hidden service.
+      (Only authorities need upgrade; others will be fine once they do.)
+      Bugfix on 0.2.0.10-alpha; fixes bug 2709.

+ 1 - 1
src/or/rephist.c

@@ -537,7 +537,7 @@ rep_hist_get_uptime(const char *id, time_t when)
   or_history_t *hist = get_or_history(id);
   or_history_t *hist = get_or_history(id);
   if (!hist)
   if (!hist)
     return 0;
     return 0;
-  if (!hist->start_of_run)
+  if (!hist->start_of_run || when < hist->start_of_run)
     return 0;
     return 0;
   return when - hist->start_of_run;
   return when - hist->start_of_run;
 }
 }