mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 22:58:50 +01:00
Lowercase BridgeDistribution value before adding it to the descriptor.
This patch makes sure we lowercase the value of BridgeDistribution before we add it to the descriptor as `bridge-distribution-request`. See: https://bugs.torproject.org/32753
This commit is contained in:
parent
026f0c7184
commit
1c8bafcdf9
1 changed files with 10 additions and 3 deletions
|
@ -2908,14 +2908,21 @@ 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");
|
||||
}
|
||||
|
||||
// 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",
|
||||
escaped(bd));
|
||||
tor_free(bd);
|
||||
}
|
||||
|
||||
if (router->onion_curve25519_pkey) {
|
||||
|
|
Loading…
Add table
Reference in a new issue