summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-09-22 10:25:02 -0400
committerNick Mathewson <nickm@torproject.org>2016-09-26 10:56:54 -0700
commit501fc3bbc6e6e4003c99b0bfd95deb06b2df9580 (patch)
treecaa73ec28a208dc0200e5e305b0e4820a5fa738d /src
parent1ab641a70e1f2cc2548abfd03e62e3f8b04825d2 (diff)
downloadtor-501fc3bbc6e6e4003c99b0bfd95deb06b2df9580.tar.gz
tor-501fc3bbc6e6e4003c99b0bfd95deb06b2df9580.zip
protovers: during voting, assert that we are not voting to shut down.
As a failsafe, we should make sure that no authority ever votes for a set of protocol versions that it does not itself support.
Diffstat (limited to 'src')
-rw-r--r--src/or/dirserv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index d7a707d847..e8d60d0db8 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2934,6 +2934,16 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
tor_strdup("Cons=1 Desc=1 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 "
"Link=3-4 LinkAuth=1 Microdesc=1 Relay=1-2");
+ /* We are not allowed to vote to require anything we don't have. */
+ tor_assert(protover_all_supported(v3_out->required_relay_protocols, NULL));
+ tor_assert(protover_all_supported(v3_out->required_client_protocols, NULL));
+
+ /* We should not recommend anything we don't have. */
+ tor_assert_nonfatal(protover_all_supported(
+ v3_out->recommended_relay_protocols, NULL));
+ tor_assert_nonfatal(protover_all_supported(
+ v3_out->recommended_client_protocols, NULL));
+
v3_out->package_lines = smartlist_new();
{
config_line_t *cl;