diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2015-03-12 15:37:48 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-03-12 13:12:56 -0400 |
commit | b3281fc6d634ac32c6ce591313600b0ed56a9347 (patch) | |
tree | f3a4eb089314e86643eee30af3e92d2543d1a360 | |
parent | c2dcd9b703b494b404200c6330ef9f0511b79925 (diff) | |
download | tor-b3281fc6d634ac32c6ce591313600b0ed56a9347.tar.gz tor-b3281fc6d634ac32c6ce591313600b0ed56a9347.zip |
Initialize the extorport auth cookie before launching PTs.
PTs expect the auth cookie to be available immedieately after launch,
leading to a race condition when PTs opt to cache the extorport cookie
once immediately after startup.
Fixes #15240.
-rw-r--r-- | changes/bug15240 | 6 | ||||
-rw-r--r-- | src/or/config.c | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/changes/bug15240 b/changes/bug15240 new file mode 100644 index 0000000000..e11f804a12 --- /dev/null +++ b/changes/bug15240 @@ -0,0 +1,6 @@ + o Minor bugfixes (pluggable transports): + - Initialize the extended OR Port authentication cookie before launching + pluggable transports. This prevents a race condition that occured when + server-side pluggable transports would cache the authentication cookie + before it has been (re)generated. Fixes bug 15240; bugfix on + 0.2.5.1-alpha. diff --git a/src/or/config.c b/src/or/config.c index 5ba8c997fa..fca350c203 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1451,6 +1451,13 @@ options_act(const or_options_t *old_options) rep_hist_load_mtbf_data(time(NULL)); } + /* If we have an ExtORPort, initialize its auth cookie. */ + if (running_tor && + init_ext_or_cookie_authentication(!!options->ExtORPort_lines) < 0) { + log_warn(LD_CONFIG,"Error creating Extended ORPort cookie file."); + return -1; + } + mark_transport_list(); pt_prepare_proxy_list_for_config_read(); if (!options->DisableNetwork) { @@ -1555,12 +1562,6 @@ options_act(const or_options_t *old_options) return -1; } - /* If we have an ExtORPort, initialize its auth cookie. */ - if (init_ext_or_cookie_authentication(!!options->ExtORPort_lines) < 0) { - log_warn(LD_CONFIG,"Error creating Extended ORPort cookie file."); - return -1; - } - monitor_owning_controller_process(options->OwningControllerProcess); /* reload keys as needed for rendezvous services. */ |