diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-10-30 15:17:01 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-10-30 15:17:01 +0000 |
commit | 7709fb7143cc272c04f9de3970e4ac0fe3a000d6 (patch) | |
tree | 8def34d3b4ee29b42513b8f7057249a2674e3a6a /src/or | |
parent | 07621f090fd11d2f1b7db6df3b3c87f46318259f (diff) | |
download | tor-7709fb7143cc272c04f9de3970e4ac0fe3a000d6.tar.gz tor-7709fb7143cc272c04f9de3970e4ac0fe3a000d6.zip |
r16278@catbus: nickm | 2007-10-30 09:46:28 -0400
Accept future networkstatus documents, but warn about skew when we get them.
svn:r12282
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/networkstatus.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 355fac3902..bbcc0ff6d5 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1235,7 +1235,8 @@ networkstatus_set_current_consensus(const char *consensus, int from_cache, } if (current_consensus && c->valid_after <= current_consensus->valid_after) { - /* We have a newer one. */ + /* We have a newer one. There's no point in accepting this one, + * even if it's great. */ log_info(LD_DIR, "Got a consensus at least as old as the one we have"); goto done; } @@ -1284,9 +1285,6 @@ networkstatus_set_current_consensus(const char *consensus, int from_cache, } } - /* XXXX020 check dates for plausibility. Don't trust a consensus whose - * valid-after date is very far in the future. */ - /* Are we missing any certificates at all? */ if (r != 1) authority_certs_fetch_missing(c, now); @@ -1330,6 +1328,15 @@ networkstatus_set_current_consensus(const char *consensus, int from_cache, dirserv_set_cached_networkstatus_v3(consensus, current_consensus->valid_after); + if (ftime_definitely_before(now, current_consensus->valid_after)) { + char buf[ISO_TIME_LEN+1]; + format_iso_time(buf, current_consensus->valid_after); + log_warn(LD_GENERAL, "Consensus network status document was published " + "at some time in the future (%s GMT). Check your time and date " + "settings!", buf); + control_event_general_status(LOG_WARN, "CLOCK_SKEW SOURCE=CONSENSUS"); + } + router_dir_info_changed(); result = 0; |