diff options
author | David Goulet <dgoulet@torproject.org> | 2020-09-22 10:45:52 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-11-18 11:31:37 -0500 |
commit | ea52705e4b1753a75aac77ec0bc828d70327a4ad (patch) | |
tree | 331a8d61cd709483ed9cdba428d6141ba0e9938c /src/app | |
parent | fcf5bbb59fe12304dd60da248fafc5d892629d1b (diff) | |
download | tor-ea52705e4b1753a75aac77ec0bc828d70327a4ad.tar.gz tor-ea52705e4b1753a75aac77ec0bc828d70327a4ad.zip |
config: Bridge line with a transport must have a ClientTransportPlugin
Fixes #25528
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config/config.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 04a82a5c43..79b67e7a90 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -2189,6 +2189,22 @@ options_act,(const or_options_t *old_options)) } } + /* Validate that we actually have a configured transport for a Bridge line + * that has one. This is done here because we require the bridge and + * transport to be added to the global list before doing the validation. + * + * In an ideal world, pt_parse_transport_line() would actually return a + * transport_t object so we could inspect it and thus do this step at + * validation time. */ + SMARTLIST_FOREACH_BEGIN(bridge_list_get(), const bridge_info_t *, bi) { + const char *bi_transport_name = bridget_get_transport_name(bi); + if (bi_transport_name && !transport_get_by_name(bi_transport_name)) { + log_warn(LD_CONFIG, "Bridge line with transport %s is missing a " + "ClientTransportPlugin line", bi_transport_name); + return -1; + } + } SMARTLIST_FOREACH_END(bi); + if (options_act_server_transport(old_options) < 0) return -1; |