tor

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

commit 74cfe3611f7b54f7c68bb8ea932a5ab224b95154
parent ceefdf984c1b9aa13d8e43399328e6ee29b0d3ff
Author: George Kadianakis <desnacked@riseup.net>
Date:   Fri, 22 Jan 2021 00:21:21 +0200

Merge branch 'maint-0.4.5'

Diffstat:
Achanges/bug40238 | 4++++
Msrc/feature/dirparse/routerparse.c | 11+++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/changes/bug40238 b/changes/bug40238 @@ -0,0 +1,3 @@ + o Minor bugfixes (logging): + - Reject obsolete router/extrainfo descs earlier and more quietly. + Fixes bug 40238; bugfix on 0.4.5.1-alpha. +\ No newline at end of file diff --git a/src/feature/dirparse/routerparse.c b/src/feature/dirparse/routerparse.c @@ -456,6 +456,12 @@ router_parse_entry_from_string(const char *s, const char *end, } } + if (!tor_memstr(s, end-s, "\nproto ")) { + log_debug(LD_DIR, "Found an obsolete router descriptor. " + "Rejecting quietly."); + goto err; + } + if (router_get_router_hash(s, end - s, digest) < 0) { log_warn(LD_DIR, "Couldn't compute router hash."); goto err; @@ -991,6 +997,11 @@ extrainfo_parse_entry_from_string(const char *s, const char *end, while (end > s+2 && *(end-1) == '\n' && *(end-2) == '\n') --end; + if (!tor_memstr(s, end-s, "\nidentity-ed25519")) { + log_debug(LD_DIR, "Found an obsolete extrainfo. Rejecting quietly."); + goto err; + } + if (router_get_extrainfo_hash(s, end-s, digest) < 0) { log_warn(LD_DIR, "Couldn't compute router hash."); goto err;