From c123163043e42668c3597298e14d25607a2d4623 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 7 Jan 2009 02:13:42 +0000 Subject: 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 --- src/or/routerlist.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/or') 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); -- cgit v1.2.3-54-g00ecf