aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-06-11Rework orconn tracking to use pubsubTaylor Yu
Part of ticket 29976.
2019-05-22Multiple subscribers or publishers per subsystemTaylor Yu
Allow a subsystem to register to publish or subscribe a given message from multiple places. Part of ticket 29976.
2019-05-22circuitpadding tests: Use tt_i64_op() to compare int64_t valuestor-0.4.1.1-alphaNick Mathewson
Bug not in any released Tor.
2019-05-22Bump to 0.4.1.1-alphaNick Mathewson
2019-05-22Merge remote-tracking branch 'dgoulet/ticket30454_035_01'Nick Mathewson
2019-05-22Merge branch 'ticket30428_041_02_squashed'Nick Mathewson
2019-05-22sendme: Add non fatal asserts for extra safetyDavid Goulet
Two non fatal asserts are added in this commit. First one is to see if the SENDME digest list kept on the circuit for validation ever grows bigger than the maximum number of expected SENDME on a circuit (currently 10). The second one is to know if we ever send more than one SENDME at a time on a circuit. In theory, we shouldn't but if we ever do, the v1 implementation wouldn't work because we only keep one single cell digest (the previous cell to the SENDME) on the circuit/cpath. Thus, sending two SENDME consecutively will lead to a mismatch on the other side because the same cell digest would be use and thus the circuit would collapse. Finally, add an extra debug log in case we emit a v0 which also includes the consensus emit version in that case. Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Always pop last SENDME digest from circuitDavid Goulet
We must not accumulate digests on the circuit if the other end point is using another SENDME version that is not using those digests like v0. This commit makes it that we always pop the digest regardless of the version. Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Clarify how sendme_circuit_cell_is_next() worksDavid Goulet
Commit 4ef8470fa5480d3b was actually reverted before because in the end we needed to do this minus 1 check on the window. This commit clarifies that in the code, takes the useful comment changes from 4ef8470fa5480d3b and makes sendme_circuit_cell_is_next() private since it behaves in a very specific way that one external caller might expect. Part of #30428. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Properly record SENDMEs on both edgesDavid Goulet
Turns out that we were only recording the "b_digest" but to have bidirectionnal authenticated SENDMEs, we need to use the "f_digest" in the forward cell situation. Because of the cpath refactoring, this commit plays with the crypt_path_ and relay_crypto_t API a little bit in order to respect the abstractions. Previously, we would record the cell digest as the SENDME digest in the decrypt cell function but to avoid code duplication (both directions needs to record), we now do that right after iff the cell is recognized (at the edge). It is now done in circuit_receive_relay_cell() instead. We now also record the cell digest as the SENDME digest in both relay cell encryption functions since they are split depending on the direction. relay_encrypt_cell_outbound() and relay_encrypt_cell_inbound() need to consider recording the cell digest depending on their direction (f vs b digest). Fixes #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Never fallback to v0 if unknown versionDavid Goulet
There was a missing cell version check against our max supported version. In other words, we do not fallback to v0 anymore in case we do know the SENDME version. We can either handle it or not, never fallback to the unauthenticated version in order to avoid gaming the authenticated logic. Add a unit tests making sure we properly test that and also test that we can always handle the default emit and accepted versions. Fixes #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Validate v1 SENDMEs on both client and exit sideDavid Goulet
The validation of the SENDME cell is now done as the very first thing when receiving it for both client and exit. On failure to validate, the circuit is closed as detailed in the specification. Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Record cell digest on both client and exitDavid Goulet
It turns out that only the exit side is validating the authenticated SENDME v1 logic and never the client side. Which means that if a client ever uploaded data towards an exit, the authenticated SENDME logic wouldn't apply. For this to work, we have to record the cell digest client side as well which introduced a new function that supports both type of edges. This also removes a test that is not valid anymore which was that we didn't allow cell recording on an origin circuit (client). Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22Merge remote-tracking branch 'nickm/ticket30454_034_01_squashed' into ↵David Goulet
ticket30454_035_01
2019-05-20In microdesc_cache_reload(), set journal length to length of string we readrl1987
Hopefully this will fix CID 1444769.
2019-05-20hs: Remove hs_cell_onion_key_type_t enumDavid Goulet
Unify this with the trunnel ABI so we don't duplicate. Part of #30454 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20trunnel: Remove INTRODUCE1 status code IN statementDavid Goulet
We want to support parsing a cell with unknown status code so we are forward compatible. Part of #30454 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20hs: Remove hs_intro_auth_key_type_t enumDavid Goulet
Like the previous commit about the INTRODUCE_ACK status code, change all auth key type to use the one defined in the trunnel file. Standardize the use of these auth type to a common ABI. Part of #30454 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20hs: Get rid of duplicate hs_cell_introd_ack_status_tDavid Goulet
This enum was the exact same as hs_intro_ack_status_t that was removed at the previous commit. It was used client side when parsing the INTRODUCE_ACK cell. Now, the entire code dealing with the INTRODUCE_ACK cell (both sending and receiving) have been modified to all use the same ABI defined in the trunnel introduce1 file. Finally, the client will default to the normal behavior when receiving an unknown NACK status code which is to note down that we've failed and re-extend to the next intro point. This way, unknown status code won't trigger a different behavior client side. Part of #30454. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20hs: Define INTRODUCE_ACK status code in trunnelDavid Goulet
Remove the hs_intro_ack_status_t enum and move the value into trunnel. Only use these values from now on in the intro point code. Interestingly enough, the client side also re-define these values in hs_cell.h with the hs_cell_introd_ack_status_t enum. Next commit will fix that and force to use the trunnel ABI. Part of #30454 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-17Don't forget to use the mutex in testing_enable_prefilled_rng()rl1987
2019-05-17Merge remote-tracking branch 'tor-github/pr/1033'Nick Mathewson
2019-05-17Merge branch 'maint-0.4.0'Nick Mathewson
2019-05-17Merge branch 'maint-0.3.4' into maint-0.3.5Nick Mathewson
2019-05-17Merge branch 'maint-0.3.5' into maint-0.4.0Nick Mathewson
2019-05-17Merge branch 'maint-0.2.9' into maint-0.3.4maint-0.3.4Nick Mathewson
2019-05-17Update geoip and geoip6 to the May 13 2019 database.Karsten Loesing
2019-05-16Refactor rend machines, stage 2/2: Move histogram code.Mike Perry
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-16Refactor rend machines, stage 1/2: Move state transition code.Mike Perry
2019-05-16Refactor intro machines, stage 2/2: Move histogram code.Mike Perry
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-16Refactor intro machines, stage 1/2: Move state transition code.Mike Perry
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-16Improve logging around the circpad module..George Kadianakis
- 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-16Add unittests for the new machines.George Kadianakis
2019-05-16Add client-side onion service circuit hiding machines.George Kadianakis
2019-05-16Correctly handle machines out of tokens that have not closed yet.George Kadianakis
Perhaps the machine on the other side is still not done.
2019-05-16Introduce circpad free_all() function.George Kadianakis
2019-05-16Generate non-padding circpad events for PADDING_NEGOTIATE(D).George Kadianakis
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-16Make register_padding_machine part of the public API.George Kadianakis
We are gonna use this function to register our new machine.
2019-05-16Behave correctly when state->max_length is zero.George Kadianakis
2019-05-15fix typos, whitespace, commentsRoger Dingledine
2019-05-15Merge branch 'tor-github/pr/1002'George Kadianakis
2019-05-15Merge branch 'tor-github/pr/1021'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-15Merge branch 'bug28780-squashed3-rebased' into bug28780_rebaseGeorge Kadianakis
2019-05-15Add control port circuit ID to all pathbias bug messages.Mike Perry
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-15Pathbias should continue to ignore previously ignored circs.Mike Perry
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-15Bug 28780: Add testsMike Perry
Also test circpad expiry safeguard.
2019-05-15Bug 28780: Make use of purpose to keep padding circuits open.Mike Perry
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-15Bug 28780: Add purpose for keeping padding circuits openMike Perry
2019-05-15Merge branch 'bug29085_rebase'George Kadianakis
2019-05-15Check the token supply when we received a padding event, too.Mike Perry
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.