]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
6 years agoHiding crypt_path_t: Trivial changes to satisfy check-local.
George Kadianakis [Mon, 8 Apr 2019 13:36:12 +0000 (16:36 +0300)] 
Hiding crypt_path_t: Trivial changes to satisfy check-local.

6 years agoHiding crypt_path_t: Ensure that ->private is initialized.
George Kadianakis [Wed, 10 Apr 2019 13:28:29 +0000 (16:28 +0300)] 
Hiding crypt_path_t: Ensure that ->private is initialized.

Now that we are using a constructor we should be more careful that we are
always using the constructor to initialize crypt_path_t, so make sure that
->private is initialized.

6 years agoHiding crypt_path_t: Create a constructor for crypt_path_t.
George Kadianakis [Mon, 8 Apr 2019 13:18:44 +0000 (16:18 +0300)] 
Hiding crypt_path_t: Create a constructor for crypt_path_t.

We are using an opaque pointer so the structure needs to be allocated on the
heap. This means we now need a constructor for crypt_path_t.

Also modify all places initializing a crypt_path_t to use the constructor.

6 years agoHiding crypt_path_t: Fixup broken unittests.
George Kadianakis [Mon, 8 Apr 2019 12:43:23 +0000 (15:43 +0300)] 
Hiding crypt_path_t: Fixup broken unittests.

6 years agoHiding crypt_path_t: Move the free func in crypt_path.c.
George Kadianakis [Mon, 8 Apr 2019 12:37:02 +0000 (15:37 +0300)] 
Hiding crypt_path_t: Move the free func in crypt_path.c.

Again everything is moved, apart from a free line using ->private.

6 years agoHiding crypt_path_t: Move some more init funcs in crypt_path.c.
George Kadianakis [Mon, 8 Apr 2019 12:32:23 +0000 (15:32 +0300)] 
Hiding crypt_path_t: Move some more init funcs in crypt_path.c.

Everything is moved, but the argument of the function is edited to access
->private->crypto.

6 years agoHiding crypt_path_t: Start with crypt_path.crypto .
George Kadianakis [Mon, 8 Apr 2019 12:16:37 +0000 (15:16 +0300)] 
Hiding crypt_path_t: Start with crypt_path.crypto .

Create some functions to eventually be able to hide crypt_path_t.crypto.

6 years agoHiding crypt_path_t: Move init functions to crypt_path.c.
George Kadianakis [Mon, 8 Apr 2019 10:01:18 +0000 (13:01 +0300)] 
Hiding crypt_path_t: Move init functions to crypt_path.c.

This commit only moves code.

6 years agoHiding crypt_path_t: Move assert functions in crypt_path.c.
George Kadianakis [Mon, 8 Apr 2019 09:46:40 +0000 (12:46 +0300)] 
Hiding crypt_path_t: Move assert functions in crypt_path.c.

This commit only moves code, and makes one function public.

6 years agoHiding crypt_path_t: Introduce opaque crypt_path_private_t .
George Kadianakis [Mon, 8 Apr 2019 11:35:02 +0000 (14:35 +0300)] 
Hiding crypt_path_t: Introduce opaque crypt_path_private_t .

This will be our base for incrementally hiding crypt_path_t.

6 years agoMerge branch 'tor-github/pr/984'
David Goulet [Fri, 3 May 2019 14:56:12 +0000 (10:56 -0400)] 
Merge branch 'tor-github/pr/984'

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoNote how to update the new website in the ReleasingTor.md instructions
Nick Mathewson [Fri, 3 May 2019 12:51:28 +0000 (08:51 -0400)] 
Note how to update the new website in the ReleasingTor.md instructions

6 years agoMerge branch 'maint-0.4.0'
Nick Mathewson [Thu, 2 May 2019 18:33:09 +0000 (14:33 -0400)] 
Merge branch 'maint-0.4.0'

"ours" to avoid version bump.

6 years agoBump to 0.4.0.5-dev
Nick Mathewson [Thu, 2 May 2019 18:32:55 +0000 (14:32 -0400)] 
Bump to 0.4.0.5-dev

6 years agoforward-port changelog and releasenotes from 0.4.0.5
Nick Mathewson [Thu, 2 May 2019 18:32:24 +0000 (14:32 -0400)] 
forward-port changelog and releasenotes from 0.4.0.5

6 years agoMerge branch 'tor-github/pr/986'
George Kadianakis [Thu, 2 May 2019 15:12:52 +0000 (18:12 +0300)] 
Merge branch 'tor-github/pr/986'

6 years agosendme: Add changes file for prop289
David Goulet [Thu, 2 May 2019 15:10:41 +0000 (11:10 -0400)] 
sendme: Add changes file for prop289

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoMerge branch 'tor-github/pr/999'
George Kadianakis [Thu, 2 May 2019 14:48:09 +0000 (17:48 +0300)] 
Merge branch 'tor-github/pr/999'

6 years agoAdd comments to include.am files to note where new sources go
Nick Mathewson [Thu, 2 May 2019 13:37:18 +0000 (09:37 -0400)] 
Add comments to include.am files to note where new sources go

This mechanism isn't perfect, and sometimes it will guess wrong,
but it will help our automation.

6 years agoChanges file for improved dirauth modularity (ticket 30345)
Nick Mathewson [Tue, 30 Apr 2019 18:59:28 +0000 (14:59 -0400)] 
Changes file for improved dirauth modularity (ticket 30345)

6 years agopractracker updates.
Nick Mathewson [Tue, 30 Apr 2019 17:04:18 +0000 (13:04 -0400)] 
practracker updates.

6 years agoRemove some now-needless dirauth includes
Nick Mathewson [Tue, 30 Apr 2019 16:58:00 +0000 (12:58 -0400)] 
Remove some now-needless dirauth includes

6 years agoMake keypin.c dirauth-only
Nick Mathewson [Tue, 30 Apr 2019 16:52:00 +0000 (12:52 -0400)] 
Make keypin.c dirauth-only

6 years agoMake the bwauth.c module dirauth-only.
Nick Mathewson [Tue, 30 Apr 2019 16:48:00 +0000 (12:48 -0400)] 
Make the bwauth.c module dirauth-only.

6 years agoMove voteflags.[ch] to become dirauth only.
Nick Mathewson [Tue, 30 Apr 2019 16:42:33 +0000 (12:42 -0400)] 
Move voteflags.[ch] to become dirauth only.

For various reasons, this was a nontrivial movement.  There are
several places in the code where we do something like "update the
flags on this routerstatus or node if we're an authority", and at
least one where we pretended to be an authority when we weren't.

6 years agosendme: Improve logging messages
David Goulet [Thu, 2 May 2019 12:58:58 +0000 (08:58 -0400)] 
sendme: Improve logging messages

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoRemove changes files that are already in 0.4.0.5 or earlier
Nick Mathewson [Thu, 2 May 2019 12:42:01 +0000 (08:42 -0400)] 
Remove changes files that are already in 0.4.0.5 or earlier

6 years agoMerge remote-tracking branch 'tor-github/pr/989'
Nick Mathewson [Thu, 2 May 2019 12:36:09 +0000 (08:36 -0400)] 
Merge remote-tracking branch 'tor-github/pr/989'

6 years agoMerge remote-tracking branch 'tor-github/pr/950'
Nick Mathewson [Wed, 1 May 2019 13:11:20 +0000 (09:11 -0400)] 
Merge remote-tracking branch 'tor-github/pr/950'

6 years agoMerge branch 'maint-0.4.0'
Nick Mathewson [Tue, 30 Apr 2019 19:54:03 +0000 (15:54 -0400)] 
Merge branch 'maint-0.4.0'

"ours" to avoid version bump

6 years agobump to 0.4.0.5
Nick Mathewson [Tue, 30 Apr 2019 19:53:53 +0000 (15:53 -0400)] 
bump to 0.4.0.5

6 years agoMake the reachability.c module dirauth-only.
Nick Mathewson [Tue, 30 Apr 2019 15:33:00 +0000 (11:33 -0400)] 
Make the reachability.c module dirauth-only.

6 years agoMake the guardfraction.c module dirauth-only.
Nick Mathewson [Tue, 30 Apr 2019 15:31:57 +0000 (11:31 -0400)] 
Make the guardfraction.c module dirauth-only.

6 years agoMake the process_descs.c module dirauth-only.
Nick Mathewson [Tue, 30 Apr 2019 15:31:03 +0000 (11:31 -0400)] 
Make the process_descs.c module dirauth-only.

6 years agoMake the dsigs_parse.c module dirauth-only.
Nick Mathewson [Tue, 30 Apr 2019 15:29:31 +0000 (11:29 -0400)] 
Make the dsigs_parse.c module dirauth-only.

6 years agoMake the recommend_pkg file dirauth-only.
Nick Mathewson [Tue, 30 Apr 2019 15:25:41 +0000 (11:25 -0400)] 
Make the recommend_pkg file dirauth-only.

6 years agoChanges file for ticket30007
Taylor Yu [Fri, 26 Apr 2019 18:25:12 +0000 (13:25 -0500)] 
Changes file for ticket30007

6 years agoClean up formatting after Coccinelle
Taylor Yu [Wed, 10 Apr 2019 22:22:36 +0000 (17:22 -0500)] 
Clean up formatting after Coccinelle

Clean up some minor formatting quirks after the Coccinelle run.

6 years agoRun Coccinelle for control.c refactor
Taylor Yu [Wed, 10 Apr 2019 22:04:09 +0000 (17:04 -0500)] 
Run Coccinelle for control.c refactor

6 years agoCoccinelle scripts for control.c refactor
Taylor Yu [Wed, 10 Apr 2019 17:27:50 +0000 (12:27 -0500)] 
Coccinelle scripts for control.c refactor

6 years agoManually fix some control replies
Taylor Yu [Wed, 10 Apr 2019 20:11:36 +0000 (15:11 -0500)] 
Manually fix some control replies

Manually fix up some reply-generating code that the Coccinelle scripts
won't match.  Some more complicated ones remain -- these are mostly
ones that accumulate data to send, and then call connection_buf_add()
or connection_write_str_to_buf() directly.

6 years agoFactor out control reply output
Taylor Yu [Tue, 9 Apr 2019 17:22:31 +0000 (12:22 -0500)] 
Factor out control reply output

Create a set of abstractions for controller commands and events to
output replies to the control channel.  The control protocol has a
relatively consistent SMTP-like structure, so it's helpful when code
that implements control commands and events doesn't explicitly format
everything on its own.

6 years agoAdd clarifying comments to control_proto.c
Taylor Yu [Mon, 8 Apr 2019 18:39:04 +0000 (13:39 -0500)] 
Add clarifying comments to control_proto.c

Refer to control-spec.txt grammar productions in comments in
control_proto.c for clarity.

6 years agoSplit reply formatting out of control_fmt.c
Taylor Yu [Mon, 8 Apr 2019 16:34:12 +0000 (11:34 -0500)] 
Split reply formatting out of control_fmt.c

Split the core reply formatting code out of control_fmt.c into
control_proto.c.  The remaining code in control_format.c deals with
specific subsystems and will eventually move to join those subsystems.

6 years agoCorrect file name in doxygen comment
Taylor Yu [Fri, 5 Apr 2019 22:27:15 +0000 (17:27 -0500)] 
Correct file name in doxygen comment

6 years agoMerge branch 'maint-0.4.0'
George Kadianakis [Tue, 30 Apr 2019 16:26:30 +0000 (19:26 +0300)] 
Merge branch 'maint-0.4.0'

6 years agoMerge branch 'tor-github/pr/978' into maint-0.4.0
George Kadianakis [Tue, 30 Apr 2019 16:26:14 +0000 (19:26 +0300)] 
Merge branch 'tor-github/pr/978' into maint-0.4.0

6 years agoMerge branch 'tor-github/pr/985'
George Kadianakis [Tue, 30 Apr 2019 16:25:32 +0000 (19:25 +0300)] 
Merge branch 'tor-github/pr/985'

6 years agoMerge branch 'tor-github/pr/937'
George Kadianakis [Tue, 30 Apr 2019 16:21:46 +0000 (19:21 +0300)] 
Merge branch 'tor-github/pr/937'

6 years agoMerge branch 'tor-github/pr/936'
George Kadianakis [Tue, 30 Apr 2019 16:21:15 +0000 (19:21 +0300)] 
Merge branch 'tor-github/pr/936'

6 years agoMerge branch 'tor-github/pr/993'
George Kadianakis [Tue, 30 Apr 2019 16:13:57 +0000 (19:13 +0300)] 
Merge branch 'tor-github/pr/993'

6 years agoMerge branch 'tor-github/pr/983'
George Kadianakis [Tue, 30 Apr 2019 16:13:30 +0000 (19:13 +0300)] 
Merge branch 'tor-github/pr/983'

6 years agoMerge branch 'tor-github/pr/980'
David Goulet [Tue, 30 Apr 2019 15:50:36 +0000 (11:50 -0400)] 
Merge branch 'tor-github/pr/980'

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoMerge branch 'tor-github/pr/909'
David Goulet [Tue, 30 Apr 2019 15:17:45 +0000 (11:17 -0400)] 
Merge branch 'tor-github/pr/909'

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoRename and clarify some functions for periodic events
Nick Mathewson [Fri, 26 Apr 2019 17:17:35 +0000 (13:17 -0400)] 
Rename and clarify some functions for periodic events

When we tell the periodic event manager about an event, we are
"registering" that event.  The event sits around without being
usable, however, until we "connect" the event to libevent.  In the
end, we "disconnect" the event and remove its libevent parts.

Previously, we called these operations "add", "setup", and
"destroy", which led to confusion.

6 years agoRemove now-extraneous calls to initialize_periodic_events().
Nick Mathewson [Fri, 26 Apr 2019 16:46:14 +0000 (12:46 -0400)] 
Remove now-extraneous calls to initialize_periodic_events().

This is now the responsibility of the mainloop's subsystem initializer.

6 years agoChanges file for periodic event movement
Nick Mathewson [Thu, 25 Apr 2019 19:12:10 +0000 (15:12 -0400)] 
Changes file for periodic event movement

6 years agoMove dirauth periodic events into dirauth module.
Nick Mathewson [Thu, 25 Apr 2019 19:09:24 +0000 (15:09 -0400)] 
Move dirauth periodic events into dirauth module.

Closes ticket 30294.

6 years agoTurn 'mainloop' into a subsystem.
Nick Mathewson [Thu, 25 Apr 2019 18:20:41 +0000 (14:20 -0400)] 
Turn 'mainloop' into a subsystem.

We need a little refactoring for this to work, since the
initialization code for the periodic events assumes that libevent is
already initialized, which it can't be until it's configured.

This change, combined with the previous ones, lets other subsystems
declare their own periodic events, without mainloop.c having to know
about them.  Implements ticket 30293.

6 years agoChanges file for 29732.
Nick Mathewson [Mon, 18 Mar 2019 16:50:35 +0000 (12:50 -0400)] 
Changes file for 29732.

6 years agoMake sure that the rng is not replaced if it is already replaced.
Nick Mathewson [Mon, 18 Mar 2019 16:50:11 +0000 (12:50 -0400)] 
Make sure that the rng is not replaced if it is already replaced.

6 years agoMake the deterministic and reproducible rng test code handle fast_rng
Nick Mathewson [Mon, 18 Mar 2019 16:15:46 +0000 (12:15 -0400)] 
Make the deterministic and reproducible rng test code handle fast_rng

6 years agoAdd improved debugging support to crypto_rand_fast code.
Nick Mathewson [Mon, 18 Mar 2019 16:03:48 +0000 (12:03 -0400)] 
Add improved debugging support to crypto_rand_fast code.

6 years agoExtract add-entropy code from crypto_fast_rng to a new function
Nick Mathewson [Mon, 18 Mar 2019 15:54:37 +0000 (11:54 -0400)] 
Extract add-entropy code from crypto_fast_rng to a new function

6 years agoUse preloaded-rng code in test_hs_descriptor.c
Nick Mathewson [Mon, 18 Mar 2019 15:44:11 +0000 (11:44 -0400)] 
Use preloaded-rng code in test_hs_descriptor.c

6 years agoMake rng mock code also cover strongest_rand.
Nick Mathewson [Mon, 18 Mar 2019 15:44:07 +0000 (11:44 -0400)] 
Make rng mock code also cover strongest_rand.

6 years agoUse prefilled PRNG replacement in test_extorport
Nick Mathewson [Mon, 18 Mar 2019 14:10:30 +0000 (10:10 -0400)] 
Use prefilled PRNG replacement in test_extorport

This is the last remaining place where our tests had mocked
crypto_rand.

6 years agoUse prefilled_rng in test_addr.c in place of existing code.
Nick Mathewson [Mon, 18 Mar 2019 14:05:50 +0000 (10:05 -0400)] 
Use prefilled_rng in test_addr.c in place of existing code.

6 years agoAdd a testing PRNG replacement that returns canned data.
Nick Mathewson [Mon, 18 Mar 2019 13:59:18 +0000 (09:59 -0400)] 
Add a testing PRNG replacement that returns canned data.

6 years agoUpdate circuit_timeout test to use deterministic prng
Nick Mathewson [Mon, 18 Mar 2019 13:41:59 +0000 (09:41 -0400)] 
Update circuit_timeout test to use deterministic prng

6 years agoUpdate test_prob_distr to use new reproducible RNG override code
Nick Mathewson [Mon, 18 Mar 2019 13:38:04 +0000 (09:38 -0400)] 
Update test_prob_distr to use new reproducible RNG override code

6 years agoAdd support for deterministic override of crypto_rand() in tests
Nick Mathewson [Mon, 18 Mar 2019 13:37:13 +0000 (09:37 -0400)] 
Add support for deterministic override of crypto_rand() in tests

We had this previously, but we did it differently in different
places. This implementation is pulled from test_prob_distr.c

6 years agoAdd changes file
rl1987 [Sun, 21 Apr 2019 18:06:57 +0000 (21:06 +0300)] 
Add changes file

6 years agoTravis: remove sudo configuration
rl1987 [Wed, 24 Apr 2019 10:29:23 +0000 (13:29 +0300)] 
Travis: remove sudo configuration

See: https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration

6 years agoMerge remote-tracking branch 'tor-github/pr/972'
Nick Mathewson [Mon, 29 Apr 2019 17:36:35 +0000 (13:36 -0400)] 
Merge remote-tracking branch 'tor-github/pr/972'

6 years agopractracker: Update exceptions for #26288
David Goulet [Mon, 29 Apr 2019 16:27:53 +0000 (12:27 -0400)] 
practracker: Update exceptions for #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agosendme: Do not poke at crypto.sendme_digest directly
David Goulet [Mon, 29 Apr 2019 16:11:57 +0000 (12:11 -0400)] 
sendme: Do not poke at crypto.sendme_digest directly

As per review from nickm, keep as much as we can the relay_crypto_t object
opaque.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agosendme: Better function names
David Goulet [Mon, 29 Apr 2019 15:38:11 +0000 (11:38 -0400)] 
sendme: Better function names

From nickm's review, improve the names of some functions.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agosendme: Move note_cell_digest() to relay_crypto module
David Goulet [Mon, 29 Apr 2019 15:29:05 +0000 (11:29 -0400)] 
sendme: Move note_cell_digest() to relay_crypto module

Because this function is poking within the relay_crypto_t object, move the
function to the module so we can keep it opaque as much as possible.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agosendme: Better handle the random padding
David Goulet [Wed, 24 Apr 2019 19:39:10 +0000 (15:39 -0400)] 
sendme: Better handle the random padding

We add random padding to every cell if there is room. This commit not only
fixes how we compute that random padding length/offset but also improves its
safety with helper functions and a unit test.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agosendme: Keep cell digest only if a SENDME is next
David Goulet [Wed, 24 Apr 2019 17:38:47 +0000 (13:38 -0400)] 
sendme: Keep cell digest only if a SENDME is next

This way, we reduce the load by only hashing when we absolutely must.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agosendme: Add helper to note the cell digest
David Goulet [Wed, 24 Apr 2019 15:57:20 +0000 (11:57 -0400)] 
sendme: Add helper to note the cell digest

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agosendme: Helper to know if next cell is a SENDME
David Goulet [Wed, 24 Apr 2019 14:25:29 +0000 (10:25 -0400)] 
sendme: Helper to know if next cell is a SENDME

We'll use it this in order to know when to hash the cell for the SENDME
instead of doing it at every cell.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Add documentation for the circuit FIFO list
David Goulet [Thu, 7 Mar 2019 17:57:15 +0000 (12:57 -0500)] 
prop289: Add documentation for the circuit FIFO list

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Skip the first 4 unused bytes in a cell
David Goulet [Thu, 7 Mar 2019 17:45:16 +0000 (12:45 -0500)] 
prop289: Skip the first 4 unused bytes in a cell

When adding random to a cell, skip the first 4 bytes and leave them zeroed. It
has been very useful in the past for us to keep bytes like this.

Some code trickery was added to make sure we have enough room for this 4 bytes
offset when adding random.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Keep the digest bytes, not the object
David Goulet [Thu, 7 Mar 2019 17:30:13 +0000 (12:30 -0500)] 
prop289: Keep the digest bytes, not the object

The digest object is as large as the entire internal digest object's state,
which is often much larger than the actual set of bytes you're transmitting.

This commit makes it that we keep the digest itself which is 20 bytes.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Move digest matching in its own function
David Goulet [Thu, 7 Mar 2019 17:01:58 +0000 (12:01 -0500)] 
prop289: Move digest matching in its own function

No behavior change but code had to be refactored a bit. Also, the tor_memcmp()
was changed to tor_memneq().

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Rename packaged functions with better name
David Goulet [Thu, 7 Mar 2019 16:45:38 +0000 (11:45 -0500)] 
prop289: Rename packaged functions with better name

The circuit and stream level functions that update the package window have
been renamed to have a "_note_" in them to make their purpose more clear.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Move SENDME cell processing in a separate function
David Goulet [Thu, 7 Mar 2019 16:35:52 +0000 (11:35 -0500)] 
prop289: Move SENDME cell processing in a separate function

No behavior change. Only moving code and fixing part of it in order to use the
parameters passed as pointers.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Use a 20 bytes digest instead of 4
David Goulet [Thu, 7 Mar 2019 16:20:23 +0000 (11:20 -0500)] 
prop289: Use a 20 bytes digest instead of 4

To achieve such, this commit also changes the trunnel declaration to use a
union instead of a seperate object for the v1 data.

A constant is added for the digest length so we can use it within the SENDME
code giving us a single reference.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agotests: Implement unit tests for SENDME v1
David Goulet [Tue, 19 Feb 2019 19:49:38 +0000 (14:49 -0500)] 
tests: Implement unit tests for SENDME v1

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Add random bytes to the unused portion of the cell
David Goulet [Tue, 19 Feb 2019 20:02:11 +0000 (15:02 -0500)] 
prop289: Add random bytes to the unused portion of the cell

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Remember the last cell digest for v1 SENDMEs
David Goulet [Wed, 23 Jan 2019 19:39:04 +0000 (14:39 -0500)] 
prop289: Remember the last cell digest for v1 SENDMEs

In order to do so, depending on where the cell is going, we'll keep the last
cell digest that is either received inbound or sent outbound.

Then it can be used for validation.

Part of #26288

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Match the SENDME digest
David Goulet [Wed, 9 Jan 2019 20:27:51 +0000 (15:27 -0500)] 
prop289: Match the SENDME digest

Now that we keep the last seen cell digests on the Exit side on the circuit
object, use that to match the SENDME v1 transforming this whole process into a
real authenticated SENDME mechanism.

Part of #26841

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Keep track of the last seen cell digests
David Goulet [Wed, 9 Jan 2019 20:08:14 +0000 (15:08 -0500)] 
prop289: Keep track of the last seen cell digests

This makes tor remember the last seen digest of a cell if that cell is the
last one before a SENDME on the Exit side.

Closes #26839

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Support SENDME v1 cell parsing
David Goulet [Wed, 9 Jan 2019 19:03:32 +0000 (14:03 -0500)] 
prop289: Support SENDME v1 cell parsing

This commit makes tor able to parse and handle a SENDME version 1. It will
look at the consensus parameter "sendme_accept_min_version" to know what is
the minimum version it should look at.

IMPORTANT: At this commit, the validation of the cell is not fully
implemented. For this, we need #26839 to be completed that is to match the
SENDME digest with the last cell digest.

Closes #26841

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Support sending SENDME version 1
David Goulet [Wed, 9 Jan 2019 17:22:35 +0000 (12:22 -0500)] 
prop289: Support sending SENDME version 1

This code will obey the consensus parameter "sendme_emit_min_version" to know
which SENDME version it should send. For now, the default is 0 and the
parameter is not yet used in the consensus.

This commit adds the support to send version 1 SENDMEs but aren't sent on the
wire at this commit.

Closes #26840

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Add SENDME trunnel declaration
David Goulet [Tue, 8 Jan 2019 16:13:37 +0000 (11:13 -0500)] 
prop289: Add SENDME trunnel declaration

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agoprop289: Add two consensus parameters
David Goulet [Wed, 9 Jan 2019 17:02:01 +0000 (12:02 -0500)] 
prop289: Add two consensus parameters

In order to be able to deploy the authenticated SENDMEs, these two consensus
parameters are needed to control the minimum version that we can emit and
accept.

See section 4 in prop289 for more details.

Note that at this commit, the functions that return the values aren't used so
compilation fails if warnings are set to errors.

Closes #26842

Signed-off-by: David Goulet <dgoulet@torproject.org>
6 years agosendme: Always close stream if deliver window is negative
David Goulet [Wed, 9 Jan 2019 16:03:49 +0000 (11:03 -0500)] 
sendme: Always close stream if deliver window is negative

Previously, we would only close the stream when our deliver window was
negative at the circuit-level but _not_ at the stream-level when receiving a
DATA cell.

This commit adds an helper function connection_edge_end_close() which
sends an END and then mark the stream for close for a given reason.

That function is now used both in case the deliver window goes below zero for
both circuit and stream level.

Part of #26840

Signed-off-by: David Goulet <dgoulet@torproject.org>