aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2020-01-15 17:18:30 +0000
committerAlexander Færøy <ahf@torproject.org>2020-01-15 17:18:30 +0000
commit3f20a69afb666e4dcd43e2f9182692502300a58d (patch)
tree31eac025946841f0a614dbb94d6f392f3621b6cc /src/feature/relay
parent5fa7c1b13fbefcfd9b71a1f95922cf4e92b5e141 (diff)
downloadtor-3f20a69afb666e4dcd43e2f9182692502300a58d.tar.gz
tor-3f20a69afb666e4dcd43e2f9182692502300a58d.zip
Always escape BridgeDistribution value from torrc in descriptors.
When the BridgeDistribution value was added in commit ebab5215252f9fa810ae091c335c5ae6e619faaf the check for whether the value contains '\n' or '\r' was added as a requirement for whether or not the value should be escaped. This patch removes this check and makes sure we call `escaped()` on the value every time before we add it to a descriptor. See: https://bugs.torproject.org/32753
Diffstat (limited to 'src/feature/relay')
-rw-r--r--src/feature/relay/router.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c
index e547b5a553..7ad0d1bd05 100644
--- a/src/feature/relay/router.c
+++ b/src/feature/relay/router.c
@@ -2914,9 +2914,8 @@ router_dump_router_to_string(routerinfo_t *router,
} else {
bd = "any";
}
- if (strchr(bd, '\n') || strchr(bd, '\r'))
- bd = escaped(bd);
- smartlist_add_asprintf(chunks, "bridge-distribution-request %s\n", bd);
+ smartlist_add_asprintf(chunks, "bridge-distribution-request %s\n",
+ escaped(bd));
}
if (router->onion_curve25519_pkey) {