Commit Graph

32972 Commits

Author SHA1 Message Date
teor
0acfd7dcee
Merge branch 'maint-0.4.1' 2019-08-08 11:20:07 +10:00
teor
40d7f1e3a6
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-08-08 11:19:58 +10:00
teor
0a661cde1d
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-08-08 11:19:38 +10:00
teor
e83eabc9bf
Merge remote-tracking branch 'tor-github/pr/1044' into maint-0.3.5
Merge changed chutney and stem script lines from 29280 with changed
stem script lines from 30591.
2019-08-08 11:17:46 +10:00
teor
5cbc0b3881
Merge branch 'maint-0.4.1' 2019-08-08 11:11:42 +10:00
teor
6d0883e9e9
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-08-08 11:11:35 +10:00
teor
e27a74b1b1
Merge branch 'maint-0.3.5' into maint-0.4.0 2019-08-08 11:11:27 +10:00
teor
1bc2ae7be7
Merge branch 'maint-0.2.9' into maint-0.3.5
Merge rust additions in 0.3.5 with sudo deletions in 0.2.9.
2019-08-08 11:10:15 +10:00
teor
97e7be2717
Merge remote-tracking branch 'tor-github/pr/1157' into maint-0.4.0 2019-08-08 11:07:34 +10:00
teor
e15b9b1790
Merge remote-tracking branch 'tor-github/pr/1156' into maint-0.3.5 2019-08-08 11:07:11 +10:00
teor
8d22c09abf
Merge remote-tracking branch 'tor-github/pr/1155' into maint-0.2.9 2019-08-08 10:55:24 +10:00
teor
518b69b57c
Merge remote-tracking branch 'tor-github/pr/991' into maint-0.2.9 2019-08-08 10:54:12 +10:00
Nick Mathewson
35cfe2e776 Merge remote-tracking branch 'tor-github/pr/1208' 2019-08-07 09:49:49 -04:00
Nick Mathewson
25c97b18f1 changes file for ticket 31320 2019-08-06 13:13:36 -04:00
Nick Mathewson
f557680aa9 Merge remote-tracking branch 'tor-github/pr/1203' 2019-08-06 13:12:42 -04:00
Nick Mathewson
484b654048 test_token_bucket: negate after casting to signed type.
Previously we tried multiplying by -1 before casting to int32_t,
which would cause us to cast the -1 to an unsigned before we
multiplied.  This gave us compiler warnings on windows.

Fixes bug 31353; bug not in any released Tor.
2019-08-06 11:42:04 -04:00
Nick Mathewson
66437710af test_util: Do not check for ENETUNREACH unless it exists.
Fixes bug 31352; bug not in any released Tor.
2019-08-06 11:35:50 -04:00
Nick Mathewson
79569d86b3 Merge branch 'ticket31343_035' into ticket31343_040 2019-08-06 11:18:40 -04:00
Nick Mathewson
bc9492a938 Merge branch 'ticket31343_029' into ticket31343_035 2019-08-06 11:15:20 -04:00
Nick Mathewson
0849d2a2fd Avoid using labs() on time_t in channeltls.c
On some windows builds, time_t is 64 bits but long is not.  This is
causing appveyor builds to fail.

Also, one of our uses of labs() on time_t was logically incorrect:
it was telling us to accept NETINFO cells up to three minutes
_before_ the message they were responding to, which doesn't make
sense.

This patch adds a time_abs() function that we should eventually move
to intmath.h or something.  For now, though, it will make merges
easier to have it file-local in channeltls.c.

Fixes bug 31343; bugfix on 0.2.4.4-alpha.
2019-08-06 11:11:06 -04:00
Nick Mathewson
88f9b123d6 Merge branch 'maint-0.4.1' 2019-08-06 09:19:11 -04:00
Nick Mathewson
21531f35f3 Merge branch 'ticket31311_041' into maint-0.4.1 2019-08-06 09:19:05 -04:00
David Goulet
2b225aaa77 practracker: Make it happy after rebase
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 08:01:26 -04:00
David Goulet
c45f0b4ec1 hs-v3: Rename HS DoS default defines
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet
90b5422e8e test: Series of fixes for hs_dos.c unit tests
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet
e537968548 dos: Update HS intro circuits if parameters change
In case the consensus parameters for the rate/burst changes, we need to update
all already established introduction circuits to the newest value.

This commit introduces a "get all intro circ" function from the HS circuitmap
(v2 and v3) so it can be used by the HS DoS module to go over all circuits and
adjust the INTRODUCE2 token bucket parameters.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet
be8bd2a46e hs-v3: Add enable/disable HS DoS introduce parameter
Following prop305 values.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet
c5b00c5a51 hs-v3: Add consensus parameters for DoS defenses
Part of #15516

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet
fec0a7b7cb test: Add hs_dos.c unit tests
Currently test the only available function which is hs_dos_can_send_intro2()
within the HS anti-DoS subsystem.

Closes #15516

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
David Goulet
9f738be893 hs: Limit the amount of relayed INTRODUCE2
This commit add the hs_dos.{c|h} file that has the purpose of having the
anti-DoS code for onion services.

At this commit, it only has one which is a function that decides if an
INTRODUCE2 can be sent on the given introduction service circuit (S<->IP)
using a simple token bucket.

The rate per second is 25 and allowed burst to 200.

Basic defenses on #15516.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-08-06 07:58:14 -04:00
George Kadianakis
d7afdb3b0f Merge branch 'tor-github/pr/1195' 2019-08-06 14:51:47 +03:00
David Goulet
4ee65a6f87 Merge branch 'tor-github/pr/1193' 2019-08-06 07:42:20 -04:00
Ali Raheem
57c34e80da #31320 Add IPv6 examples 2019-08-05 19:24:42 +01:00
George Kadianakis
8248812188 Rename handle_relay_command to handle_relay_cell_command .
As per David's review.
2019-08-05 18:03:23 +03:00
George Kadianakis
1e970d17b8 Test that regular cells get ignored in padding circuits. 2019-08-05 18:03:23 +03:00
George Kadianakis
ce477da8a7 Ignore regular cells in padding circuits.
Padding circuits were regular cells that got closed before their padding
machine could finish. This means that they can still receive regular cells from
their past life, but they have no way or reason to answer them anymore. Hence
let's ignore them before they even get to the proper subsystems.
2019-08-05 18:03:23 +03:00
George Kadianakis
7a032c5e48 Split connection_edge_process_relay_cell() in two functions.
One function does the validation, the other does the handling.
2019-08-05 18:02:33 +03:00
Nick Mathewson
d5ccd0fa84 Add exceptions for current .h practracker problems. 2019-08-05 10:32:39 -04:00
Nick Mathewson
9a1e9b1d6c Teach practracker about .h files
I'm using 500 as a file size limit, and 15 as an include limit.
This affects comparatively few files, but I think they are the worst
ones.

Closes ticket 31175.
2019-08-05 10:31:02 -04:00
Nick Mathewson
54ad92a240 Merge branch 'maint-0.4.1' 2019-08-05 09:59:40 -04:00
George Kadianakis
74c0595965 Ignore regular cells in padding circuits.
Padding circuits were regular cells that got closed before their padding
machine could finish. This means that they can still receive regular cells from
their past life, but they have no way or reason to answer them anymore. Hence
let's ignore them before they even get to the proper subsystems.
2019-08-05 13:48:58 +03:00
Nick Mathewson
1440c2cb34 Adjust test_practracker.sh to work on windows
The required change is to ignore trailing CRs when diffing files.
2019-08-01 15:43:54 -04:00
Nick Mathewson
fa60fee8d5 practracker: Add unit tests to test script, and test script to makefile
This makes all of the practracker tests get run by make check, and
hence by our CI.

Closes ticket 31304.
2019-08-01 14:01:43 -04:00
Nick Mathewson
5d98b54725 Port practracker unit tests to python 3 2019-08-01 14:00:48 -04:00
Nick Mathewson
30da1b61c6 Distribute practracker unit and integration tests. 2019-08-01 13:59:26 -04:00
Nick Mathewson
49c696fb46 Merge branch 'ticket31311_041' into ticket31304 2019-08-01 13:48:58 -04:00
Nick Mathewson
3945282419 make dist: only include files from practracker dir intentionally.
Previously, we included temporary files and whatnot, which is not
good.

Fixes bug 31311; bugfix on 0.4.1.1-alpha.
2019-08-01 13:47:05 -04:00
Nick Mathewson
223afc2d8f practracker: add envvar TOR_PRACTRACKER_OPTIONS
We have Makefile.am use this to decide how to invoke practracker on
the Tor source.
2019-08-01 12:57:26 -04:00
Nick Mathewson
e57209dc32 Regenerate the practracker exceptions.txt file 2019-08-01 10:25:42 -04:00
Nick Mathewson
a4e4896e66 practracker: restore exceptions.txt header when running --regen 2019-08-01 10:25:20 -04:00