Commit Graph

23970 Commits

Author SHA1 Message Date
rl1987 49acbfad23 Don't forget to use the mutex in testing_enable_prefilled_rng() 2019-05-17 19:30:09 +03:00
Nick Mathewson b2b779228d Merge remote-tracking branch 'tor-github/pr/1033' 2019-05-17 08:18:20 -04:00
Nick Mathewson 9cec7a7b5c Merge branch 'maint-0.4.0' 2019-05-17 08:10:17 -04:00
Nick Mathewson c7f9f7e542 Merge branch 'maint-0.3.5' into maint-0.4.0 2019-05-17 08:10:16 -04:00
Nick Mathewson e5deb2bbc7 Merge branch 'maint-0.3.4' into maint-0.3.5 2019-05-17 08:10:16 -04:00
Nick Mathewson a521c42788 Merge branch 'maint-0.2.9' into maint-0.3.4 2019-05-17 08:10:15 -04:00
Karsten Loesing 4e262196a8 Update geoip and geoip6 to the May 13 2019 database. 2019-05-17 08:52:13 +02:00
Mike Perry 857c54ca03 Refactor rend machines, stage 2/2: Move histogram code.
Comment clarifications now that the code is seperated. It's the same code, but
its doing this for different reasons on each side.
2019-05-16 20:17:14 +00:00
Mike Perry 0cba53c6ed Refactor rend machines, stage 1/2: Move state transition code. 2019-05-16 20:17:11 +00:00
Mike Perry bbb974234c Refactor intro machines, stage 2/2: Move histogram code.
The client side had garbage histograms and deadcode here, too. That code has
been removed.

The tests have also been updated to properly test the intro circ by sending
padding from the relay side to the client, and verifying that both shut down
when padding was up. (The tests previously erroneously tested only the client
side of intro circs, which actually were supposed to be doing nothing).
2019-05-16 19:21:19 +00:00
Mike Perry f237fed746 Refactor intro machines, stage 1/2: Move state transition code.
This just moves the state transition directives into the proper client/relay
side functions. It also allows us to remove some dead-code from the client
side (since the client doesn't send padding).
2019-05-16 19:21:14 +00:00
George Kadianakis 42ea3a416e Improve logging around the circpad module..
- Add some more useful logs for future debugging.

- Stop usage of circpad_state_to_string(). It's innacurate.

- Reduce severity and fix up log domain of some logging messages.
2019-05-16 14:23:32 +03:00
George Kadianakis 953dc601d9 Add unittests for the new machines. 2019-05-16 14:23:22 +03:00
George Kadianakis ac895fa405 Add client-side onion service circuit hiding machines. 2019-05-16 14:23:17 +03:00
George Kadianakis 9b582edddb Correctly handle machines out of tokens that have not closed yet.
Perhaps the machine on the other side is still not done.
2019-05-16 14:07:32 +03:00
George Kadianakis 69a277f635 Introduce circpad free_all() function. 2019-05-16 14:07:25 +03:00
George Kadianakis 5791bc9d76 Generate non-padding circpad events for PADDING_NEGOTIATE(D).
As part of our machines, we need to know when a PADDING_NEGOATIATE(D) cell gets
sent out, so we add an event for this.
2019-05-16 14:06:27 +03:00
George Kadianakis 39c52d14a6 Make register_padding_machine part of the public API.
We are gonna use this function to register our new machine.
2019-05-16 14:05:58 +03:00
George Kadianakis a014e01b68 Behave correctly when state->max_length is zero. 2019-05-16 14:05:27 +03:00
Roger Dingledine d86896b29c fix typos, whitespace, comments 2019-05-15 23:20:03 -04:00
George Kadianakis 338cfb3179 Merge branch 'tor-github/pr/1002' 2019-05-15 23:23:18 +03:00
David Goulet 39a14421b1 Merge branch 'tor-github/pr/1021'
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-15 15:35:22 -04:00
George Kadianakis d71fa707dd Merge branch 'bug28780-squashed3-rebased' into bug28780_rebase 2019-05-15 16:46:51 +03:00
Mike Perry 56738ff8c6 Add control port circuit ID to all pathbias bug messages.
To ease debugging of miscount issues, attach vanguards with --loglevel DEBUG
and obtain control port logs (or use any other control port CIRC and
CIRC_MINOR event logging mechanism).
2019-05-15 16:44:59 +03:00
Mike Perry b98bcd789e Pathbias should continue to ignore previously ignored circs.
If circuit padding wants to keep a circuit open and pathbias used to ignore
it, pathbias should continue to ignore it.

This may catch other purpose-change related miscounts (such as timeout
measurement, cannibalization, onion service circuit transitions, and
vanguards).
2019-05-15 16:44:59 +03:00
Mike Perry e253a117c0 Bug 28780: Add tests
Also test circpad expiry safeguard.
2019-05-15 16:44:59 +03:00
Mike Perry 662825474c Bug 28780: Make use of purpose to keep padding circuits open.
When a circuit is marked for close, check to see if any of our padding
machines want to take ownership of it and continue padding until the machine
hits the END state.

For safety, we also ensure that machines that do not terminate are still
closed as follows: Because padding machine timers are UINT32_MAX in size, if
some sort of network event doesn't happen on a padding-only circuit within
that time, we can conclude it is deadlocked and allow
circuit_expire_old_circuits_clientside() to close it.

If too much network activity happens, then per-machine padding limits can be
used to cease padding, which will cause network cell events to cease, on the
circuit, which will cause circpad to abandon the circuit as per the above time
limit.
2019-05-15 16:44:59 +03:00
Mike Perry d44e3e57b0 Bug 28780: Add purpose for keeping padding circuits open 2019-05-15 16:44:59 +03:00
George Kadianakis a7779df84c Merge branch 'bug29085_rebase' 2019-05-15 15:13:08 +03:00
Mike Perry 5638d65f79 Check the token supply when we received a padding event, too.
We need to check here because otherwise we can try to schedule padding with no
tokens left upon the receipt of a padding event when our bins just became
empty.
2019-05-15 15:10:48 +03:00
Mike Perry 148c2d5bab Fix two typo bugs found by new state length test. 2019-05-15 15:10:48 +03:00
Mike Perry e8a1f24178 Add test to explicitly check state lengths and token counts.
Our other tests tested state lengths against padding packets, and token counts
against non-padding packets. This test checks state lengths against
non-padding packets (and also padding packets too), and checks token counts
against padding packets (and also non-padding packets too).

The next three commits are needed to make this test pass (it found 3 bugs).
Yay?
2019-05-15 15:10:48 +03:00
Mike Perry aef9be6ace Eliminate unneeded casts to circuit_t in circpad tests. 2019-05-15 15:10:48 +03:00
Mike Perry 14ec8b89f8 Bug 29085: Avoid monotime usage for rtt estimates if it is not in use. 2019-05-15 15:10:31 +03:00
Mike Perry 5c2d2b5d11 Make the relationship between mutable histograms and token removal explicit. 2019-05-15 15:09:49 +03:00
George Kadianakis 1de11dc47a Merge branch 'maint-0.4.0' 2019-05-15 13:46:20 +03:00
George Kadianakis cd264e145b Merge branch 'tor-github/pr/1013' into maint-0.4.0 2019-05-15 13:45:39 +03:00
Mike Perry 57e5e940d3 Bug 29085: Minor unit test updates for refactoring.
Deliver nonpadding events instead of calling token removal functions.
2019-05-15 04:57:11 +00:00
Mike Perry 1c46790e0d Bug 29085: Refactor padding sent accounting out of callback.
This commit moves code that updates the state length and padding limit counts
out from the callback to its own function, for clarity.

It does not change functionality.
2019-05-15 04:57:11 +00:00
Mike Perry 010779176b Bug 29085: Refactor non-padding accounting out of token removal.
This commit moves the padding state limit checks and the padding rate limit
checks out of the token removal codepath, and causes all three functions to
get called from a single circpad_machine_count_nonpadding_sent() function.

It does not change functionality.
2019-05-15 04:57:11 +00:00
Nick Mathewson 370ea8d23b Merge branch 'ticket30452_035_v3' into ticket30452_041_v3 2019-05-14 19:55:51 -04:00
Nick Mathewson 0c451b31d2 Make --list-modules imply --hush 2019-05-14 19:55:35 -04:00
Nick Mathewson 1c95bdb83b Merge branch 'ticket30452_035_v3' into ticket30452_041_v3 2019-05-14 19:20:53 -04:00
Nick Mathewson 1b16fcb70c Add a --list-modules command
Closes ticket 30452.
2019-05-14 19:19:53 -04:00
Nick Mathewson 43d4119454 Merge remote-tracking branch 'tor-github/pr/1004' 2019-05-14 11:43:10 -04:00
George Kadianakis 0f4f4fdcf5 Merge branch 'tor-github/pr/1006' 2019-05-14 15:15:09 +03:00
Nick Mathewson 5d950f3edd Fix a compilation warning: function does not have to be STATIC. 2019-05-13 14:34:16 -04:00
Nick Mathewson 9ad2eb8f73 Merge branch 'bug28683_30173_29203_squashed' 2019-05-13 14:33:31 -04:00
Mike Perry 42eb02a327 Tests for bugs 28683, 30173, and 29203. 2019-05-13 14:30:35 -04:00
Mike Perry 621ea2315b Bug 29203: Provide ReducedCircuitPadding torrc and consensus params 2019-05-13 14:30:35 -04:00