summaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2017-12-11Merge branch 'maint-0.3.2'Nick Mathewson
2017-12-11sched: Avoid integer overflow when computing tcp_spaceDavid Goulet
In KIST, we could have a small congestion window value than the unacked packets leading to a integer overflow which leaves the tcp_space value to be humongous. This has no security implications but it results in KIST scheduler allowing to send cells on a potentially saturated connection. Found by #24423. Fixes #24590. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-11Merge remote-tracking branch 'ffmancera/github/bug23459'Nick Mathewson
2017-12-11Merge remote-tracking branch 'teor/comment24575'Nick Mathewson
2017-12-11Merge branch 'maint-0.3.2'Nick Mathewson
2017-12-11Merge remote-tracking branch 'dgoulet/bug23603_032_02' into maint-0.3.2Nick Mathewson
2017-12-11Update the comment in options_transition_affects_guards()teor
It referred to the an old function name. Fixes #24575, bugfix on 0.3.0.
2017-12-08Merge remote-tracking branch 'mikeperry/bug23114_squashed2'Nick Mathewson
2017-12-08move a macro; fix a build?Nick Mathewson
2017-12-08Merge branch 'macro_free_v2_squashed'Nick Mathewson
2017-12-08Convert remaining function (mostly static) to new free styleNick Mathewson
2017-12-08Fix wide lines introduced by previous patch.Nick Mathewson
2017-12-08Replace all FREE_AND_NULL* uses to take a type and a free function.Nick Mathewson
This commit was made mechanically by this perl script: \#!/usr/bin/perl -w -i -p next if /^#define FREE_AND_NULL/; s/\bFREE_AND_NULL\((\w+),/FREE_AND_NULL\(${1}_t, ${1}_free_,/; s/\bFREE_AND_NULL_UNMATCHED\(/FREE_AND_NULL\(/;
2017-12-08Switch to a safer FREE_AND_NULL implementationNick Mathewson
This one only evaluates the input once, so it cannot mess up even if there are side effects.
2017-12-08Change the free macro convention in the rest of src/or/*.hNick Mathewson
2017-12-08Convert connection_free to a nulling macro.Nick Mathewson
2017-12-08Rename connection_free_ to connection_free_minimal.Nick Mathewson
2017-12-08Update free functions into macros: src/or/ part 1Nick Mathewson
This covers addressmap.h (no change needed) through confparse.h
2017-12-08Convert the rest of src/common's headers to use FREE_AND_NULLNick Mathewson
2017-12-08Merge branch 'dgoulet_ticket23709_033_01_squashed'Nick Mathewson
2017-12-08chan: Do not re-queue after a fail cell writeDavid Goulet
Couple things happen in this commit. First, we do not re-queue a cell back in the circuit queue if the write packed cell failed. Currently, it is close to impossible to have it failed but just in case, the channel is mark as closed and we move on. The second thing is that the channel_write_packed_cell() always took ownership of the cell whatever the outcome. This means, on success or failure, it needs to free it. It turns out that that we were using the wrong free function in one case and not freeing it in an other possible code path. So, this commit makes sure we only free it in one place that is at the very end of channel_write_packed_cell() which is the top layer of the channel abstraction. This makes also channel_tls_write_packed_cell_method() return a negative value on error. Two unit tests had to be fixed (quite trivial) due to a double free of the packed cell in the test since now we do free it in all cases correctly. Part of #23709 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-08Split client-side get_rend_circ into two functions.Fernando Fernandez Mancera
Split hs_circuitmap_get_rend_circ_client_side(). One returns only established circuits (hs_circuitmap_get_established_rend_circ_client_side()) and the other returns all kinds of circuits. Fixes #23459 Signed-off-by: Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
2017-12-08Move a comment to relay_send_end_cell_from_edge()teor
It looks like it was left behind in a refactor. Fixes 24559.
2017-12-07Merge branch 'maint-0.3.2'Nick Mathewson
2017-12-07Merge branch 'arthuredelstein_18859+1_031' into maint-0.3.2Nick Mathewson
2017-12-07Revert accidentally-committed code from 046acf208bc53a3fa7ea9Nick Mathewson
2017-12-07Add tests for circuitstats.cMike Perry
These tests primarily test the relaxed and measured behavior of circuitstats.c, to make sure we did not break it with #23100 or #23114.
2017-12-07Report close and timeout rates since uptime, not based on data.Mike Perry
Bug #23114 was harder to see because we were just reporting our math, rather than reporting behavior.
2017-12-07Bug #23114: Time out circuits immediately.Mike Perry
This changes the purpose of circuits that are past the timeout to measurement *as they are built*, ensuring accurate application of the timeout logic.
2017-12-07Bug #23100: Count all 3 hop circuits for CBT.Mike Perry
This change causes us to count anything once it reaches 3 hops (but not after).
2017-12-06Don't consider a port "handled" by an isolated circuit.Arthur Edelstein
Previously, circuit_stream_is_being_handled incorrectly reported that (1) an exit port was "handled" by a circuit regardless of whether the circuit was already isolated in some way, and (2) that a stream could be "handled" by a circuit even if their isolation settings were incompatible. As a result of (1), in Tor Browser, circuit_get_unhandled_ports was reporting that all ports were handled even though all non-internal circuits had already been isolated by a SOCKS username+password. Therefore, circuit_predict_and_launch_new was declining to launch new exit circuits. Then, when the user visited a new site in Tor Browser, a stream with new SOCKS credentials would be initiated, and the stream would have to wait while a new circuit with those credentials could be built. That wait was making the time-to-first-byte longer than it needed to be. Now, clean, not-yet-isolated circuit(s) will be automatically launched ahead of time and be ready for use whenever a new stream with new SOCKS credentials (or other isolation criteria) is initiated. Fixes bug 18859. Thanks to Nick Mathewson for improvements.
2017-12-06Fix a compiler warningNick Mathewson
2017-12-06Merge remote-tracking branch 'public/monotime_coarse_stamps'Nick Mathewson
2017-12-06Merge remote-tracking branch 'teor/bug24488'Nick Mathewson
2017-12-06Merge remote-tracking branch 'teor/bug24489'Nick Mathewson
2017-12-06Merge remote-tracking branch 'dgoulet/bug24502_032_01'Nick Mathewson
2017-12-06Check the return value of hs_parse_address().Alexander Færøy
This patch adds a check for the return value of `hs_parse_address()` in `hs_control_hspost_command()`. Since it should not be possible for `hs_parse_address()` to fail in this context we wrap the error check with the `BUG()` macro. See: https://bugs.torproject.org/24543
2017-12-05Initialize pk so that older gcc versions don't freak out.Nick Mathewson
2017-12-05Merge branch 'more_directories_squashed'Nick Mathewson
2017-12-05Implement the various get_foodir_*() functions.Nick Mathewson
2017-12-05Create a CacheDirectory and KeyDirectory options.Nick Mathewson
They work the same as DataDirectory, but default slightly different. Tor is not actually updated to use them yet.
2017-12-05Clean up a needlessly complex get_datadir_fname useNick Mathewson
2017-12-05New accessors for keydir/cachedir accessNick Mathewson
This patch is a result of auditing all of our uses of get_datadir_fname() and its kin, and dividing them into cache vs keys vs other data. The new get_keydir_fname() and get_cachedir_fname() functions don't actually do anything new yet.
2017-12-05Extract common code for creating the keys directory.Nick Mathewson
This had somehow gotten duplicated between router.c and routerkeys.c
2017-12-05Use get_datadir_fname() accessor in networkstatus.cNick Mathewson
2017-12-05Extract the code that creates the datadir into a separate function.Nick Mathewson
2017-12-05Merge branch 'dgoulet_ticket20699_033_01'Nick Mathewson
2017-12-05control: Improve ADD_ONION helper function commentsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05control: Don't use void pointer for ADD_ONION secret keyDavid Goulet
Make this a bit more safe with at least type checking of the pointers depending on the version. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-12-05control: HSPOST command support for v3David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>