summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
AgeCommit message (Collapse)Author
2014-10-13Add comments to can_dl_again usageNick Mathewson
2014-10-13Note that parse-list functions may add duplicate 'invalid' entries.Nick Mathewson
2014-10-13Treat unparseable (micro)descriptors and extrainfos as undownloadableNick Mathewson
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.
2014-09-21get rid of routerstatus->version_supports_optimistic_dataRoger Dingledine
Clients are now willing to send optimistic circuit data (before they receive a 'connected' cell) to relays of any version. We used to only do it for relays running 0.2.3.1-alpha or later, but now all relays are new enough. Resolves ticket 13153.
2014-09-09Remove client-side bad directory logicSebastian Hahn
Implements the second half of #13060.
2014-09-02Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-09-02Fix a number of clang analyzer false-positivesNick Mathewson
Most of these are in somewhat non-obvious code where it is probably a good idea to initialize variables and add extra assertions anyway. Closes 13036. Patches from "teor".
2014-08-29Introduce full coverage tests for module routerset.c.dana koch
This is using the paradigm introduced for test_status.c.
2014-08-15Remove implementation code for all pre-13 consensus methods.Nick Mathewson
Also remove a test for the way that we generated parameter votes before consensus method 12.
2014-04-29Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2014-04-29Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
2014-04-29Stop leaking memory in error cases of md parsingNick Mathewson
When clearing a list of tokens, it's important to do token_clear() on them first, or else any keys they contain will leak. This didn't leak memory on any of the successful microdescriptor parsing paths, but it does leak on some failing paths when the failure happens during tokenization. Fixes bug 11618; bugfix on 0.2.2.6-alpha.
2014-04-14Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2014-04-14Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
Conflicts: src/or/routerlist.h
2014-04-14Code to blacklist authority signing keysNick Mathewson
(I need a list of actual signing keys to blacklist.)
2014-03-31Merge remote-tracking branch 'public/bug11342'Nick Mathewson
2014-03-27Make dump_desc() use binary modeNick Mathewson
Otherwise, it could mung the thing that came over the net on windows, which would defeat the purpose of recording the unparseable thing. Fixes bug 11342; bugfix on 0.2.2.1-alpha.
2014-03-23Merge remote-tracking branch 'public/bug11275_024'Nick Mathewson
2014-03-23Stop leaking 'sig' at each call of router_append_dirobj_signature()Roger Dingledine
The refactoring in commit cb75519b (tor 0.2.4.13-alpha) introduced this leak.
2014-03-18Take out remaining V1 directory code.Karsten Loesing
2014-03-05Merge remote-tracking branch 'arma/ticket5528'Nick Mathewson
Conflicts: src/or/router.c src/test/test_dir.c
2014-02-15Remove a bunch of functions that were never called.Nick Mathewson
2014-02-03More fixes to rip out all of the v2 directory code.Karsten Loesing
(This was a squash commit, but I forgot to squash it. Sorry! --Nick)
2014-01-29Rip out all of the v2 directory code.Nick Mathewson
The remaining vestige is that we continue to publish the V2dir flag, and that, for the controller, we continue to emit v2 directory formats when requested.
2013-12-17Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
Conflicts: src/or/microdesc.c Conflict because one change was on line adjacent to line where 01206893 got fixed.
2013-12-17Merge remote-tracking branch 'public/bug10409_023' into maint-0.2.4Nick Mathewson
2013-12-16Avoid free()ing from an mmap on corrupted microdesc cacheNick Mathewson
The 'body' field of a microdesc_t holds a strdup()'d value if the microdesc's saved_location field is SAVED_IN_JOURNAL or SAVED_NOWHERE, and holds a pointer to the middle of an mmap if the microdesc is SAVED_IN_CACHE. But we weren't setting that field until a while after we parsed the microdescriptor, which left an interval where microdesc_free() would try to free() the middle of the mmap(). This patch also includes a regression test. This is a fix for #10409; bugfix on 0.2.2.6-alpha.
2013-11-18Tweak #10162 documentation a bitNick Mathewson
2013-11-14Make the dir-key-crosscert element requiredNick Mathewson
In proposal 157, we added a cross-certification element for directory authority certificates. We implemented it in 0.2.1.9-alpha. All Tor directory authorities now generate it. Here, as planned, make it required, so that we can finally close proposal 157. The biggest change in the code is in the unit test data, where some old hardcoded certs that we made long ago have become no longer valid and now need to be replaced.
2013-04-18Merge branch 'less_charbuf_rebased' into maint-0.2.4Nick Mathewson
Conflicts: src/or/dirserv.c src/or/dirserv.h src/test/test_dir.c
2013-04-18Remove the now-unused router_get_networkstatus_v3_hashNick Mathewson
2013-04-18Fix a couple of documentation issues.Nick Mathewson
2013-04-18Refactor dirobj signature generationNick Mathewson
Now we can compute the hash and signature of a dirobj before concatenating the smartlist, and we don't need to play silly games with sigbuf and realloc any more.
2013-04-18Fix some wide linesNick Mathewson
2013-04-17Merge branch 'bug8037_squashed' into maint-0.2.4Nick Mathewson
2013-04-17Reject most directory documents with an internal NUL.Nick Mathewson
(Specifically, we reject all the ones that aren't NUL-terminated, since a NUL-terminated thing can't have a NUL in the middle.) Another fix for #8037.
2013-04-14Rename all fields which measure bw in kb to end with _kbNick Mathewson
2013-03-29Bug 8419: Apply the badexit fix from #2203 to validatio tooMike Perry
This was causing dirauths to emit flag weight validation warns if there was a sufficiently large amount of badexit bandwidth to make a difference in flag weight results.
2013-03-26Bug 7065: Use $ for idhex instead of =Mike Perry
2013-03-18Check for 0.2.4.8, not 0.2.4.7, to determine EXTEND2 supportNick Mathewson
Fixes bug 8464; bugfix on b2863739 in 0.2.4.8-alpha
2013-02-19Refactor storing of measured_bw versus Unmeasured=1.Nick Mathewson
This patch moves the measured_bw field and the has_measured_bw field into vote_routerstatus_t, since only votes have 'Measured=XX' set on their weight line. I also added a new bw_is_unmeasured flag to routerstatus_t to represent the Unmeasured=1 flag on a w line. Previously, I was using has_measured_bw for this, which was quite incorrect: has_measured_bw means that the measured_bw field is set, and it's probably a mistake to have it serve double duty as meaning that 'baandwidth' represents a measured value. While making this change,I also found a harmless but stupid bug in dirserv_read_measured_bandwidths: It assumes that it's getting a smartlist of routerstatus_t, when really it's getting a smartlist of vote_routerstatus_t. C's struct layout rules mean that we could never actually get an error because of that, but it's still quite incorrect. I fixed that, and in the process needed to add two more sorting and searching helpers. Finally, I made the Unmeasured=1 flag get parsed. We don't use it for anything yet, but someday we might. This isn't complete yet -- the new 2286 unit test doesn't build.
2013-02-19Tweak consensus method 17 based on arma's commentsNick Mathewson
Instead of capping whenever a router has fewer than 3 measurements, we cap whenever a router has fewer than 3 measurements *AND* there are at least 3 authorities publishing measured bandwidths. We also generate bandwidth lines with a new "Unmeasured=1" flag, meaning that we didn't have enough observations for a node to use measured bandwidth values in the authority's input, whether we capped it or not.
2013-02-09stop setting, or using, router->addressRoger Dingledine
resolves ticket 5528.
2013-02-01Rename and relocate the bw weight scale param getter.Mike Perry
It had nothing to do with circuit build times.
2013-02-01Rename log() to tor_log() for loggingNick Mathewson
This is meant to avoid conflict with the built-in log() function in math.h. It resolves ticket 7599. First reported by dhill. This was generated with the following perl script: #!/usr/bin/perl -w -i -p s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g; s/\blog\(/tor_log\(/g;
2013-01-26Correctly copy microdescs/extrinfos with internal NUL bytesNick Mathewson
Fixes bug 8037; bugfix on 0.2.0.1-alpha; reported by cypherpunks.
2013-01-16Merge branch '024_msvc_squashed'Nick Mathewson
Conflicts: src/or/or.h srcwin32/orconfig.h
2013-01-16Fix an instance of snprintf; don't use _snprintf directlyNick Mathewson
2013-01-16Update the copyright date to 201.Nick Mathewson
2013-01-05Make the = at the end of ntor-onion-key optional.Nick Mathewson
Makes bug 7869 more easily fixable if we ever choose to do so.