diff options
author | George Kadianakis <desnacked@riseup.net> | 2021-01-22 00:21:21 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2021-01-22 00:21:21 +0200 |
commit | 9e33aa878f091248ee5ec9da9d7d0d9fa216b965 (patch) | |
tree | d6aeba5e1766c2506b38b79d3f54257e3cf0ca5b | |
parent | 1f7876ff7eff328fd4850ea1ef9ade81ac9c676e (diff) | |
parent | 4cbd22f1a7f876c7b47a0e688e28c5ac1f256d6d (diff) | |
download | tor-9e33aa878f091248ee5ec9da9d7d0d9fa216b965.tar.gz tor-9e33aa878f091248ee5ec9da9d7d0d9fa216b965.zip |
Merge branch 'maint-0.4.5' into release-0.4.5
-rw-r--r-- | changes/bug40238 | 3 | ||||
-rw-r--r-- | src/feature/dirparse/routerparse.c | 11 |
2 files changed, 14 insertions, 0 deletions
diff --git a/changes/bug40238 b/changes/bug40238 new file mode 100644 index 0000000000..35784a16bb --- /dev/null +++ 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 index 635fc4b49d..3d90c1bc91 100644 --- 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; |