diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-10-03 10:55:50 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-10-13 14:30:02 -0400 |
commit | a30594605e60d3a581f21c71a7d9e7a062800e3d (patch) | |
tree | 0a6900254158758b726724d551e85802935bc08a /src/or/routerparse.h | |
parent | b448ec195dd8687d2d5f363e12fec046eb2d1677 (diff) | |
download | tor-a30594605e60d3a581f21c71a7d9e7a062800e3d.tar.gz tor-a30594605e60d3a581f21c71a7d9e7a062800e3d.zip |
Treat unparseable (micro)descriptors and extrainfos as undownloadable
One pain point in evolving the Tor design and implementing has been
adding code that makes clients reject directory documents that they
previously would have accepted, if those descriptors actually exist.
When this happened, the clients would get the document, reject it,
and then decide to try downloading it again, ad infinitum. This
problem becomes particularly obnoxious with authorities, since if
some authorities accept a descriptor that others don't, the ones
that don't accept it would go crazy trying to re-fetch it over and
over. (See for example ticket #9286.)
This patch tries to solve this problem by tracking, if a descriptor
isn't parseable, what its digest was, and whether it is invalid
because of some flaw that applies to the portion containing the
digest. (This excludes RSA signature problems: RSA signatures
aren't included in the digest. This means that a directory
authority can still put another directory authority into a loop by
mentioning a descriptor, and then serving that descriptor with an
invalid RSA signatures. But that would also make the misbehaving
directory authority get DoSed by the server it's attacking, so it's
not much of an issue.)
We already have a mechanism to mark something undownloadable with
downloadstatus_mark_impossible(); we use that here for
microdescriptors, extrainfos, and router descriptors.
Unit tests to follow in another patch.
Closes ticket #11243.
Diffstat (limited to 'src/or/routerparse.h')
-rw-r--r-- | src/or/routerparse.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/routerparse.h b/src/or/routerparse.h index fa275c8265..927d0b50a7 100644 --- a/src/or/routerparse.h +++ b/src/or/routerparse.h @@ -29,14 +29,17 @@ int router_parse_list_from_string(const char **s, const char *eos, saved_location_t saved_location, int is_extrainfo, int allow_annotations, - const char *prepend_annotations); + const char *prepend_annotations, + smartlist_t *invalid_digests_out); routerinfo_t *router_parse_entry_from_string(const char *s, const char *end, int cache_copy, int allow_annotations, - const char *prepend_annotations); + const char *prepend_annotations, + int *can_dl_again_out); extrainfo_t *extrainfo_parse_entry_from_string(const char *s, const char *end, - int cache_copy, struct digest_ri_map_t *routermap); + int cache_copy, struct digest_ri_map_t *routermap, + int *can_dl_again_out); MOCK_DECL(addr_policy_t *, router_parse_addr_policy_item_from_string, (const char *s, int assume_action)); version_status_t tor_version_is_obsolete(const char *myversion, @@ -60,7 +63,8 @@ ns_detached_signatures_t *networkstatus_parse_detached_signatures( smartlist_t *microdescs_parse_from_string(const char *s, const char *eos, int allow_annotations, - saved_location_t where); + saved_location_t where, + smartlist_t *invalid_digests_out); authority_cert_t *authority_cert_parse_from_string(const char *s, const char **end_of_string); |