summaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2016-11-30Write the easy parts of the public entryguard interface.Nick Mathewson
Here we add a little bit of state to origin circuits, and set up the necessary functions for the circuit code to call in order to find guards, use guards, and decide when circuits can be used. There's also an incomplete function for the hard part of the circuit-maintenance code, where we figure out whether any waiting guards are ready to become usable. (This patch finally uses the handle.c code to make safe handles to entry_guard_t objects, so that we are allowed to free an entry_guard_t without checking whether any origin_circuit_t is holding a reference to it.)
2016-11-30Implement most of the prop271 data structure backends.Nick Mathewson
This code handles: * Maintaining the sampled set, the filtered set, and the usable_filtered set. * Maintaining the confirmed and primary guard lists. * Picking guards for circuits, and updating guard state when circuit state changes. Additionally, I've done code structure movement: even more constants and structures from entrynodes.c have become ENTRYNODES_PRIVATE fields of entrynodes.h. I've also included a bunch of documentation and a bunch of unit tests. Coverage on the new code is pretty high. I've noted important things to resolve before this branch is done with the /XXXX.*prop271/ regex.
2016-11-30Add parameters for new (prop271) guard algorithm.Nick Mathewson
These are taken from the proposal, and defined there. Some of them should turn into consensus parameters. Also, remove some dead code that was there to make compilation work, and use ATTR_UNUSED like a normal person.
2016-11-30Collect old guard algorithm parameters into one placeNick Mathewson
2016-11-30Add accessors as needed to repair compilationNick Mathewson
The previous commit, in moving a bunch of functions to bridges.c, broke compilation because bridges.c required two entry points to entrynodes.c it didn't have.
2016-11-30Split bridge functions into a new module.Nick Mathewson
This patch is just: * Code movement * Adding headers here and there as needed * Adding a bridges_free_all() with a call to it. It breaks compilation, since the bridge code needed to make exactly 2 calls into entrynodes.c internals. I'll fix those in the next commit.
2016-11-30Initial code to parse/encode/sample prop271 guardsNick Mathewson
The encoding code is very straightforward. The decoding code is a bit tricky, but clean-ish. The sampling code is untested and probably needs more work.
2016-11-30Teach parse_iso_time about the spaceless variant.Nick Mathewson
(We previously added support for generating the spaceless 2016-11-14T19:58:12 variant, but not for actually parsing it.)
2016-11-30Add the prop271 fields to entry_guard_t. Not used yet.Nick Mathewson
2016-11-30Whitespace fixes from previous mechanical search-and-replacesNick Mathewson
2016-11-30Make entry_guard_t opaque to circpathbias.cNick Mathewson
This was a relatively mechanical change. First, I added an accessor function for the pathbias-state field of a guard. Then I did a search-and-replace in circpathbias.c to replace "guard->pb." with "pb->". Finally, I made sure that "pb" was declared whenever it was needed.
2016-11-30Fix remaining case of circpathbias inspecting entryguard internalsNick Mathewson
2016-11-30Add an entry_guard_describe() functionNick Mathewson
This function helpfully removes all but one remaining use of an entry_guard_t private field in pathbias.c
2016-11-30Move path-bias fields into a separate structureNick Mathewson
(Other than the field movement, the code changes here are just search-and-replace)
2016-11-30prop271: make entry_guard_t mostly-privateNick Mathewson
The entry_guard_t structure should really be opaque, so that we can change its contents and have the rest of Tor not care. This commit makes it "mostly opaque" -- circpathbias.c can still see inside it. (I'm making circpathbias.c exempt since it's the only part of Tor outside of entrynodes.c that made serious use of entry_guard_t internals.)
2016-11-21Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-17Merge remote-tracking branch 'dgoulet/bug20629_030_01'Nick Mathewson
2016-11-17Merge remote-tracking branch 'public/bug20558'Nick Mathewson
2016-11-17Merge remote-tracking branch 'public/bug20630'Nick Mathewson
2016-11-17Fix and simplify error handling code in rend_service_parse_port_config()Ivan Markin
2016-11-17Fix comment for rend_service_parse_port_config()Ivan Markin
2016-11-16don't attempt a resolve when the cached answer will doRoger Dingledine
For relays that don't know their own address, avoid attempting a local hostname resolve for each descriptor we download. Also cut down on the number of "Success: chose address 'x.x.x.x'" log lines. Fixes bugs 20423 and 20610; bugfix on 0.2.8.1-alpha.
2016-11-16refactor router_pick_published_address to have another argRoger Dingledine
no change in behavior except fewer log entries in the case where we use a cached result.
2016-11-14Fix a "shouldn't have reached this" warning in connection_edge.cNick Mathewson
This was bug 20630; bugfix on f3e158ed where I thought I was committing a documentation-only fix but instead messed up the control flow too.
2016-11-10hs: Remove pointless NULL check found by CoverityDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-10Merge remote-tracking branch 'dgoulet/bug20567_030_01'Nick Mathewson
2016-11-10Merge remote-tracking branch 'public/feature20552'Nick Mathewson
2016-11-10Merge remote-tracking branch 'dgoulet/ticket19642_030_01'Nick Mathewson
2016-11-10Add "TByte" and "TBytes" units; also add "TBits" to man pageMatt Nordhoff
2016-11-10Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-09Stop logging single onion and Tor2web long-term one-hop circuitsteor
Single onion services and Tor2web deliberately create long-term one-hop circuits to their intro and rend points, respectively. These log messages are intended to diagnose issue 8387, which relates to circuits hanging around forever for no reason. Fixes bug 20613; bugfix on 0.2.9.1-alpha. Reported by "pastly".
2016-11-09Call get_options() once at the top of circuit_log_ancient_one_hop_circuits()teor
Refactoring, no behaviour change.
2016-11-08Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-08Merge remote-tracking branch 'public/bug20306_029' into maint-0.2.9Nick Mathewson
2016-11-08hs: Add single-onion-service line to v3 descriptorDavid Goulet
This field indicates if the service is a Single Onion Service if present in the descriptor. Closes #19642 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-08Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-08When using exponential backoff in test networks, use a lower exponentteor
Lower exponents mean that delays do not vary as much. This helps test networks bootstrap consistently. Bugfix on 20499.
2016-11-07Merge branch 'maint-0.2.9'Nick Mathewson
Conflicts: src/or/rendservice.c
2016-11-07Merge remote-tracking branch 'teor/bug20484_029_v2' into maint-0.2.9Nick Mathewson
2016-11-07hs: Document arguments of rend_data_*_create()David Goulet
Fixes #20567 Signed-off-by: David Goulet <dgoulet@torproject.org>
2016-11-07Treat bacoff/schedule mismatch as a bug.Nick Mathewson
2016-11-07Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-07Reduce multiplier to 3, per teor's recommendation on #20534Nick Mathewson
(Three _is_ a good number for anonymity!)
2016-11-07Always increment delays by at least 1.Nick Mathewson
2016-11-07Avoid integer overflow in delay calculation.Nick Mathewson
2016-11-07Count HTTP 503 as a download failure.Nick Mathewson
Because as Teor puts it: "[Resetting on 503] is exactly what we don't want when relays are busy - imagine clients doing an automatic reset every time they DoS a relay..." Fixes bug 20593.
2016-11-07Adjust download schedules per teor's #20534 recommendataionsNick Mathewson
2016-11-07Merge branch 'maint-0.2.9'Nick Mathewson
2016-11-07Merge branch '20499_part1_029_squashed', remote-tracking branches ↵Nick Mathewson
'teor/bug20591_029' and 'teor/bug20533_029' into maint-0.2.9
2016-11-07Allow infinitely long delays in exponential-backoff downloadsNick Mathewson
It's only safe to remove the failure limit (per 20536) if we are in fact waiting a bit longer each time we try to download. Fixes bug 20534; bugfix on 0.2.9.1-alpha.