summaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-01-20 10:44:03 -0500
committerDavid Goulet <dgoulet@torproject.org>2020-01-20 10:44:03 -0500
commitca8b90a843b404799550fb88f8542040698d2a94 (patch)
treeae6116594eaba17a4de9f671c93e7679f9e91382 /src/feature
parent51c76215dbdf94ff710eca1cc671a2b1976e6d07 (diff)
parentca9a5390ff56cb809b2afa2645863ebd7b12262d (diff)
downloadtor-ca8b90a843b404799550fb88f8542040698d2a94.tar.gz
tor-ca8b90a843b404799550fb88f8542040698d2a94.zip
Merge branch 'tor-github/pr/1668'
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/relay/relay_config.c5
-rw-r--r--src/feature/relay/router.c15
2 files changed, 12 insertions, 8 deletions
diff --git a/src/feature/relay/relay_config.c b/src/feature/relay/relay_config.c
index 9895485c83..8d20e97eb6 100644
--- a/src/feature/relay/relay_config.c
+++ b/src/feature/relay/relay_config.c
@@ -468,7 +468,6 @@ compute_publishserverdescriptor(or_options_t *options)
* - "https"
* - "email"
* - "moat"
- * - "hyphae"
*
* If the option string is unrecognised, a warning will be logged and 0 is
* returned. If the option string contains an invalid character, -1 is
@@ -481,11 +480,11 @@ check_bridge_distribution_setting(const char *bd)
return 0;
const char *RECOGNIZED[] = {
- "none", "any", "https", "email", "moat", "hyphae"
+ "none", "any", "https", "email", "moat"
};
unsigned i;
for (i = 0; i < ARRAY_LENGTH(RECOGNIZED); ++i) {
- if (!strcmp(bd, RECOGNIZED[i]))
+ if (!strcasecmp(bd, RECOGNIZED[i]))
return 0;
}
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
index e547b5a553..e24e499971 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -2908,15 +2908,20 @@ router_dump_router_to_string(routerinfo_t *router,
}
if (options->BridgeRelay) {
- const char *bd;
+ char *bd = NULL;
+
if (options->BridgeDistribution && strlen(options->BridgeDistribution)) {
- bd = options->BridgeDistribution;
+ bd = tor_strdup(options->BridgeDistribution);
} else {
- bd = "any";
+ bd = tor_strdup("any");
}
- if (strchr(bd, '\n') || strchr(bd, '\r'))
- bd = escaped(bd);
+
+ // Make sure our value is lowercased in the descriptor instead of just
+ // forwarding what the user wrote in their torrc directly.
+ tor_strlower(bd);
+
smartlist_add_asprintf(chunks, "bridge-distribution-request %s\n", bd);
+ tor_free(bd);
}
if (router->onion_curve25519_pkey) {