summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2021-01-22 00:21:09 +0200
committerGeorge Kadianakis <desnacked@riseup.net>2021-01-22 00:21:09 +0200
commit4cbd22f1a7f876c7b47a0e688e28c5ac1f256d6d (patch)
tree5b638bcf7a3626e8152a0ea8825563f7243ef421 /src
parent68d1e02c3a7594dc3f293edfe69ce49eb856d3ce (diff)
parent5d711450dd3a1a08ec8461600b558ac7880bf7cf (diff)
downloadtor-4cbd22f1a7f876c7b47a0e688e28c5ac1f256d6d.tar.gz
tor-4cbd22f1a7f876c7b47a0e688e28c5ac1f256d6d.zip
Merge branch 'mr/251' into maint-0.4.5
Diffstat (limited to 'src')
-rw-r--r--src/feature/dirparse/routerparse.c11
1 files changed, 11 insertions, 0 deletions
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;