summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2009-01-07 02:13:42 +0000
committerRoger Dingledine <arma@torproject.org>2009-01-07 02:13:42 +0000
commitc123163043e42668c3597298e14d25607a2d4623 (patch)
tree1b56d3ec82909df8d89c9a695bc1e482e386b0d0
parent18ffea77ae42a91e0028437f6c58253e2e3b0e99 (diff)
downloadtor-c123163043e42668c3597298e14d25607a2d4623.tar.gz
tor-c123163043e42668c3597298e14d25607a2d4623.zip
Discard router descriptors as we load them if they are more than
five days old. Otherwise if Tor is off for a long time and then starts with cached descriptors, it will try to use the onion keys in those obsolete descriptors when building circuits. Bugfix on 0.2.0.x. Fixes bug 887. svn:r17993
-rw-r--r--ChangeLog7
-rw-r--r--src/or/routerlist.c6
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 1138d04257..7b09d1904a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,11 @@
Changes in version 0.2.1.11-alpha - 2009-01-??
+ o Major bugfixes:
+ - Discard router descriptors as we load them if they are more than
+ five days old. Otherwise if Tor is off for a long time and then
+ starts with cached descriptors, it will try to use the onion
+ keys in those obsolete descriptors when building circuits. Bugfix
+ on 0.2.0.x. Fixes bug 887.
+
o Minor bugfixes:
- Make outbound DNS packets respect the OutboundBindAddress setting.
Fixes the bug part of bug 798. Bugfix on 0.1.2.2-alpha.
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 4aa129c645..b08d506dbe 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3060,6 +3060,12 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
}
}
+ if (!in_consensus && from_cache &&
+ router->cache_info.published_on < time(NULL) - OLD_ROUTER_DESC_MAX_AGE) {
+ *msg = "Router descriptor was really old.";
+ return ROUTER_WAS_NOT_NEW;
+ }
+
/* We haven't seen a router with this identity before. Add it to the end of
* the list. */
routerlist_insert(routerlist, router);