- Mar 17, 2018
-
-
Nick Mathewson authored
This function is used upon receiving a cell, and only handles the decrypting part. The encryption part is currently handled inside circuit_package_relay_cell.
-
- Feb 02, 2018
-
-
David Goulet authored
If the cache is using 20% of our maximum allowed memory, clean 10% of it. Same behavior as the HS descriptor cache. Closes #25122 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
- Feb 01, 2018
-
-
Caio Valente authored
connection_t.timestamp_lastwritten renamed to connection_t.timestamp_last_write_allowed connection_t.timestamp_lastread renamed to connection_t.timestamp_last_read_allowed Closes ticket 24714.
-
- Jan 25, 2018
-
-
Nick Mathewson authored
We'd been using crypto_digest_dup() and crypto_digest_assign() here, but they aren't necessary. Instead we can just use the stack to store the previous state of the SHA_CTX and avoid a malloc/free pair. Closes ticket 24914.
-
- Dec 21, 2017
-
-
Nick Mathewson authored
-
Nick Mathewson authored
This way it will match the insert queue in 029 and later.
-
Nick Mathewson authored
We've been seeing problems with destroy cells queues taking up a huge amount of RAM. We can mitigate this, since while a full packed destroy cell takes 514 bytes, we only need 5 bytes to remember a circuit ID and a reason. Fixes bug 24666. Bugfix on 0.2.5.1-alpha, when destroy cell queues were introduced.
-
- Dec 20, 2017
-
-
Fernando Fernandez Mancera authored
Exposing cell_queues_get_total_allocation(), buf_get_total_allocation(), tor_compress_get_total_allocation(), tor_compress_get_total_allocation() when hit MaxMemInQueues threshold. Fixes #24501 Signed-off-by:
Fernando Fernandez Mancera <ffernandezmancera@gmail.com>
-
- Dec 08, 2017
-
-
Nick Mathewson authored
-
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>
-
- Nov 27, 2017
-
-
Nick Mathewson authored
The goal here is to replace our use of msec-based timestamps with something less precise, but easier to calculate. We're doing this because calculating lots of msec-based timestamps requires lots of 64/32 division operations, which can be inefficient on 32-bit platforms. We make sure that these stamps can be calculated using only the coarse monotonic timer and 32-bit bitwise operations.
-
- Nov 22, 2017
-
-
David Goulet authored
If the channel layer failed to write a cell from the circuit queue, requeue it so it can be retried on the same channel later. Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
This function is part of the tor fast path so this commit adds more documentation to it as it is critical. Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
David Goulet authored
append_cell_to_circuit_queue() had code disabled from commit 2a95f317 This code is 4+ years old related to bug #9072 so if we ever want to revisit it, lets inspect/revert this commit. Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
- Nov 04, 2017
-
-
Sebastian Hahn authored
This reverts commit 27fa4a98.
-
- Sep 29, 2017
-
-
Nick Mathewson authored
This caused a BUG log when we noticed that the circuit had no channel. The likeliest culprit for exposing that behavior is d769cab3, where we made circuit_mark_for_close() NULL out the n_chan and p_chan fields of the circuit. Fixes bug 8185; bugfix on 0.2.5.4-alpha, I think.
-
Nick Mathewson authored
My current theory is that this is just a marked circuit that hasn't closed yet, but let's gather more information in case that theory is wrong. Diagnostic for 8185.
-
- Sep 15, 2017
-
-
Nick Mathewson authored
-
- Sep 11, 2017
-
-
Add magic comments recognized by default -Wimplicit-fallthrough=3 or break, as required.
-
- Sep 07, 2017
-
-
Nick Mathewson authored
Undeprecate it; rename it to TestingClientDNSRejectInternalAddresses; add the old name as an alias; reject configurations where it is set but TestingTorNetwork is not; change the documentation accordingly. Closes tickets 21031 and 21522.
-
Nick Mathewson authored
With luck, this will help us diagnose 23105 and fix it. I also added a stack trace to the warning right before it, since why not.
-
- Sep 05, 2017
-
-
Nick Mathewson authored
-
Nick Mathewson authored
By convention, a function that frobs a foo_t should be called foo_frob, and it should have a foo_t * as its first argument. But for many of the buf_t functions, the buf_t was the final argument, which is silly.
-
Nick Mathewson authored
Our convention is that functions which manipulate a type T should be named T_foo. But the buffer functions were super old, and followed all kinds of conventions. Now they're uniform. Here's the perl I used to do this: \#!/usr/bin/perl -w -i -p s/read_to_buf\(/buf_read_from_socket\(/; s/flush_buf\(/buf_flush_to_socket\(/; s/read_to_buf_tls\(/buf_read_from_tls\(/; s/flush_buf_tls\(/buf_flush_to_tls\(/; s/write_to_buf\(/buf_add\(/; s/write_to_buf_compress\(/buf_add_compress\(/; s/move_buf_to_buf\(/buf_move_to_buf\(/; s/peek_from_buf\(/buf_peek\(/; s/fetch_from_buf\(/buf_get_bytes\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/buf_remove_from_front\(/buf_drain\(/; s/peek_buf_startswith\(/buf_peek_startswith\(/; s/assert_buf_ok\(/buf_assert_ok\(/;
-
- Jun 19, 2017
-
-
Nick Mathewson authored
-
- Jun 08, 2017
-
-
On an hidden service rendezvous circuit, a BEGIN_DIR could be sent (maliciously) which would trigger a tor_assert() because connection_edge_process_relay_cell() thought that the circuit is an or_circuit_t but is an origin circuit in reality. Fixes #22494 Reported-by:
Roger Dingledine <arma@torproject.org> Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
- May 30, 2017
-
-
Add magic comments recognized by default -Wimplicit-fallthrough=3 or break, as required.
-
- May 28, 2017
-
-
Roger Dingledine authored
-
- May 08, 2017
-
-
This defense will cause Cisco, Juniper, Fortinet, and other routers operating in the default configuration to collapse netflow records that would normally be split due to the 15 second flow idle timeout. Collapsing these records should greatly reduce the utility of default netflow data for correlation attacks, since all client-side records should become 30 minute chunks of total bytes sent/received, rather than creating multiple separate records for every webpage load/ssh command interaction/XMPP chat/whatever else happens to be inactive for more than 15 seconds. The defense adds consensus parameters to govern the range of timeout values for sending padding packets, as well as for keeping connections open. The defense only sends padding when connections are otherwise inactive, and it does not pad connections used solely for directory traffic at all. By default it also doesn't pad inter-relay connections. Statistics on the total padding in the last 24 hours are exported to the extra-info descriptors.
- Apr 25, 2017
-
-
David Goulet authored
That log statement can be triggered if somebody on the Internet behaves badly which is possible with buggy implementation for instance. Fixes #21293 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
This patch adds the `tor_compress_get_total_allocation()` which returns an approximate number of bytes currently in use by all the different compression backends. See: https://bugs.torproject.org/21662
-
This patch refactors the `torgzip` module to allow us to extend a common compression API to support multiple compression backends. Additionally we move the gzip/zlib code into its own module under the name `compress_zlib`. See https://bugs.torproject.org/21664
-
- Apr 05, 2017
-
-
David Goulet authored
When a client tried to connect to an invalid port of an hidden service, a warning was printed: [warn] connection_edge_process_relay_cell (at origin) failed. This is because the connection subsystem wants to close the circuit because the port can't be found and then returns a negative reason to achieve that. However, that specific situation triggered a warning. This commit prevents it for the specific case of an invalid hidden service port. Fixes #16706 Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
- Mar 15, 2017
-
-
Nick Mathewson authored
-
- Feb 16, 2017
-
-
Alexander Hansen Færøy authored
This patch makes us store the number of sent and received RELAY_DATA cells used for directory connections. We log the numbers after we have received an EOF in connection_dir_client_reached_eof() from the directory server.
-
- Jan 18, 2017
-
-
David Goulet authored
Signed-off-by:
David Goulet <dgoulet@torproject.org>
-
- Nov 04, 2016
-
-
This implements the proposal 224 directory descriptor cache store and lookup functionalities. Furthermore, it merges the OOM call for the HSDir cache with current protocol v2 and the new upcoming v3. Add hs_cache.{c|h} with store/lookup API. Closes #18572 Signed-off-by:
David Goulet <dgoulet@torproject.org> Signed-off-by:
George Kadianakis <desnacked@riseup.net>
-
- Nov 03, 2016
-
-
Nick Mathewson authored
-
- Oct 27, 2016
-
-
David Goulet authored
Signed-off-by:
David Goulet <dgoulet@torproject.org>
-