tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 58b5300f4433f7cb741681a0501adba19af4ae6f
parent 758000aa98432414847393420324fef983c66f1e
Author: George Kadianakis <desnacked@riseup.net>
Date:   Fri, 12 Feb 2021 13:44:03 +0200

Merge remote-tracking branch 'tor-gitlab/mr/295' into maint-0.4.5

Diffstat:
Achanges/bug40281 | 6++++++
Msrc/feature/nodelist/networkstatus.c | 9++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/changes/bug40281 b/changes/bug40281 @@ -0,0 +1,6 @@ + o Minor bugfixes (logging): + - Avoid a spurious log message about missing subprotocol versions, when + the consensus that we're reading from is older than the current + release. . Previously we had made this message nonfatal in this case, + but in practice, it is never relevant when the consensus is older than + the current release. Fixes bug 40281; bugfix on 0.4.0.1-alpha. diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c @@ -2723,6 +2723,13 @@ networkstatus_check_required_protocols(const networkstatus_t *ns, const bool consensus_postdates_this_release = ns->valid_after >= tor_get_approx_release_date(); + if (! consensus_postdates_this_release) { + // We can't meaningfully warn about this case: This consensus is from + // before we were released, so whatever is says about required or + // recommended versions may no longer be true. + return 0; + } + tor_assert(warning_out); if (client_mode) { @@ -2740,7 +2747,7 @@ networkstatus_check_required_protocols(const networkstatus_t *ns, "%s on the Tor network. The missing protocols are: %s", func, missing); tor_free(missing); - return consensus_postdates_this_release ? 1 : 0; + return 1; } if (! protover_all_supported(recommended, &missing)) {