summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-03-03 12:02:30 -0500
committerNick Mathewson <nickm@torproject.org>2018-03-03 12:02:30 -0500
commitdf9d2de44119e09e8fc485c6ff57ca01c226abd1 (patch)
tree6b0f91446b7351b2a379728b86497daa52d9ac71 /src/or/networkstatus.c
parent338dbdab93328e00b5e80934ce0352bebaf9ce25 (diff)
parent1c8f55310f6a9969dc8ae5e8566e971fd2ac50b4 (diff)
downloadtor-df9d2de44119e09e8fc485c6ff57ca01c226abd1.tar.gz
tor-df9d2de44119e09e8fc485c6ff57ca01c226abd1.zip
Merge remote-tracking branch 'fristonio/ticket4187'
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 7777473f11..87825e7194 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -237,7 +237,7 @@ router_reload_consensus_networkstatus(void)
s = networkstatus_read_cached_consensus_impl(flav, flavor, 1);
if (s) {
if (networkstatus_set_current_consensus(s, flavor,
- flags|NSSET_WAS_WAITING_FOR_CERTS,
+ flags | NSSET_WAS_WAITING_FOR_CERTS,
NULL)) {
log_info(LD_FS, "Couldn't load unverified consensus %s networkstatus "
"from cache", flavor);
@@ -1917,6 +1917,15 @@ networkstatus_set_current_consensus(const char *consensus,
}
}
+ /* Signatures from the consensus are verified */
+ if (from_cache && was_waiting_for_certs) {
+ /* We check if the consensus is loaded from disk cache and that it
+ * it is an unverified consensus. If it is unverified, rename it to
+ * cached-*-consensus since it has been verified. */
+ log_info(LD_DIR, "Unverified consensus signatures verified.");
+ tor_rename(unverified_fname, consensus_fname);
+ }
+
if (!from_cache && flav == usable_consensus_flavor())
control_event_client_status(LOG_NOTICE, "CONSENSUS_ARRIVED");