aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirauth/dirvote.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-11-05 10:10:24 -0400
committerDavid Goulet <dgoulet@torproject.org>2021-11-05 10:13:47 -0400
commit3d1a49908c2727746928d40bc71da0373aad7fcf (patch)
treee1e930dcd38be6a26fd6ac9b7409a7ff29de5c7e /src/feature/dirauth/dirvote.c
parent7c085490f5324f374dd7caa570dff5902f0e32cc (diff)
downloadtor-3d1a49908c2727746928d40bc71da0373aad7fcf.tar.gz
tor-3d1a49908c2727746928d40bc71da0373aad7fcf.zip
protover: Move all hardcoded lists in one place
This also moves the warnings and add some theatrical effect around the code so anyone modifying those list should notice the warnings signs and read the comment accordingly. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/dirauth/dirvote.c')
-rw-r--r--src/feature/dirauth/dirvote.c37
1 files changed, 5 insertions, 32 deletions
diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c
index 5ecf680f02..d6a99d3ef8 100644
--- a/src/feature/dirauth/dirvote.c
+++ b/src/feature/dirauth/dirvote.c
@@ -180,7 +180,7 @@ format_protocols_lines_for_vote(const networkstatus_t *v3_ns)
char *required_relay_protocols_line = NULL;
char *required_client_protocols_line = NULL;
- recommended_relay_protocols_line =
+ recommended_relay_protocols_line =
format_line_if_present("recommended-relay-protocols",
v3_ns->recommended_relay_protocols);
recommended_client_protocols_line =
@@ -4577,41 +4577,14 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
v3_out->client_versions = client_versions;
v3_out->server_versions = server_versions;
- /*
- * WARNING!
- *
- * These values are hardwired, to avoid disaster. Voting on the wrong
- * subprotocols here has the potential to take down the network.
- *
- * In particular, you need to be EXTREMELY CAREFUL before adding new
- * versions to the required protocol list. Doing so will cause every relay
- * or client that doesn't support those versions to refuse to connect to the
- * network and shut down.
- *
- * Note that this applies to versions, not just protocols! If you say that
- * Foobar=8-9 is required, and the client only has Foobar=9, it will shut
- * down.
- *
- * It is okay to do this only for SUPER OLD relays that are not supported on
- * the network anyway. For clients, we really shouldn't kick them off the
- * network unless their presence is causing serious active harm.
- *
- * See also the warning in protocol_get_supported_versions().
- *
- * WARNING!
- */
v3_out->recommended_relay_protocols =
- tor_strdup("Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 "
- "Link=4 Microdesc=1-2 Relay=2");
+ tor_strdup(protover_get_recommended_relay_protocols());
v3_out->recommended_client_protocols =
- tor_strdup("Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 "
- "Link=4 Microdesc=1-2 Relay=2");
+ tor_strdup(protover_get_recommended_client_protocols());
v3_out->required_client_protocols =
- tor_strdup("Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 "
- "Link=4 Microdesc=1-2 Relay=2");
+ tor_strdup(protover_get_required_client_protocols());
v3_out->required_relay_protocols =
- tor_strdup("Cons=1 Desc=1 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 "
- "Link=3-4 Microdesc=1 Relay=1-2");
+ tor_strdup(protover_get_required_relay_protocols());
/* We are not allowed to vote to require anything we don't have. */
tor_assert(protover_all_supported(v3_out->required_relay_protocols, NULL));