]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
4 years agoMerge remote-tracking branch 'tor-gitlab/mr/338' into maint-0.4.5
Alexander Færøy [Thu, 21 Oct 2021 12:35:26 +0000 (12:35 +0000)] 
Merge remote-tracking branch 'tor-gitlab/mr/338' into maint-0.4.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
Alexander Færøy [Wed, 20 Oct 2021 21:47:17 +0000 (21:47 +0000)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoAnnounce URL to bridge status page when starting Tor as a bridge relay.
Alexander Færøy [Mon, 23 Nov 2020 23:41:17 +0000 (23:41 +0000)] 
Announce URL to bridge status page when starting Tor as a bridge relay.

This patch makes Tor announce the relay specific bridge status page URL
when Tor is starting up before bootstrap occours.

See: tor#30477

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
Alexander Færøy [Wed, 20 Oct 2021 17:36:06 +0000 (17:36 +0000)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoRemove unused function: dns_randfn_() in dns.c.
Alexander Færøy [Mon, 10 May 2021 13:07:24 +0000 (13:07 +0000)] 
Remove unused function: dns_randfn_() in dns.c.

This patch unbreaks the current build after tor!369 landed.

See: https://bugs.torproject.org/tpo/core/tor/40371

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/369' into maint-0.3.5
Alexander Færøy [Wed, 20 Oct 2021 17:35:35 +0000 (17:35 +0000)] 
Merge remote-tracking branch 'tor-gitlab/mr/369' into maint-0.3.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
David Goulet [Tue, 19 Oct 2021 14:29:15 +0000 (10:29 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agohs: Improve warning for bad service version
David Goulet [Thu, 14 Oct 2021 13:56:10 +0000 (09:56 -0400)] 
hs: Improve warning for bad service version

Now that we don't have version 2, it gives us:

  [warn] HiddenServiceVersion must be between 3 and 3, not 2.

This commit changes it to:

  [warn] HiddenServiceVersion must be 3, not 2.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agochanges: Add file for ticket 40476
David Goulet [Thu, 30 Sep 2021 15:21:13 +0000 (11:21 -0400)] 
changes: Add file for ticket 40476

Closes #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agotest: Don't run HSv2 Chutney test networks
David Goulet [Thu, 30 Sep 2021 15:12:46 +0000 (11:12 -0400)] 
test: Don't run HSv2 Chutney test networks

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agotest: Fix unit tests after disabling version 2
David Goulet [Thu, 30 Sep 2021 15:09:48 +0000 (11:09 -0400)] 
test: Fix unit tests after disabling version 2

Some tests were removed because they were testing something not usable
anymore.

Some tests remains to make sure that things are indeed disabled.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs: Improve warning for bad service version
David Goulet [Thu, 14 Oct 2021 13:56:10 +0000 (09:56 -0400)] 
hs: Improve warning for bad service version

Now that we don't have version 2, it gives us:

  [warn] HiddenServiceVersion must be between 3 and 3, not 2.

This commit changes it to:

  [warn] HiddenServiceVersion must be 3, not 2.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agochanges: Add file for ticket 40476
David Goulet [Thu, 30 Sep 2021 15:21:13 +0000 (11:21 -0400)] 
changes: Add file for ticket 40476

Closes #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agotest: Don't run HSv2 Chutney test networks
David Goulet [Thu, 30 Sep 2021 15:12:46 +0000 (11:12 -0400)] 
test: Don't run HSv2 Chutney test networks

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agotest: Fix unit tests after disabling version 2
David Goulet [Thu, 30 Sep 2021 15:09:48 +0000 (11:09 -0400)] 
test: Fix unit tests after disabling version 2

Some tests were removed because they were testing something not usable
anymore.

Some tests remains to make sure that things are indeed disabled.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable version 2 HSPOST and HSFETCH command
David Goulet [Tue, 19 Oct 2021 13:20:53 +0000 (09:20 -0400)] 
hs-v2: Disable version 2 HSPOST and HSFETCH command

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable version 2 directory
David Goulet [Thu, 30 Sep 2021 14:46:17 +0000 (10:46 -0400)] 
hs-v2: Disable version 2 directory

Relay do not accept both stores and lookups of version 2 descriptor.
This effectively disable version 2 HSDir supports for relays.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable version 2 introduction point
David Goulet [Thu, 30 Sep 2021 14:40:19 +0000 (10:40 -0400)] 
hs-v2: Disable version 2 introduction point

Upon receiving a v2 introduction request, the relay will close the
circuit and send back a tor protocol error.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable version 2 service
David Goulet [Tue, 19 Oct 2021 13:11:12 +0000 (09:11 -0400)] 
hs-v2: Disable version 2 service

The minimum service version is raised from 2 to 3 which effectively
disable loading or creating an onion service v2.

As for ADD_ONION, for version 2, a 551 error is returned:

  "551 Failed to add Onion Service"

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable SOCKS connection for v2 addresses
David Goulet [Thu, 30 Sep 2021 14:26:37 +0000 (10:26 -0400)] 
hs-v2: Disable SOCKS connection for v2 addresses

This effectively turns off the ability of tor to use HSv2 as a client by
invalidating the v2 onion hostname passed through a SOCKS request.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'tor-gitlab/mr/392' into maint-0.4.5
David Goulet [Wed, 6 Oct 2021 19:45:13 +0000 (15:45 -0400)] 
Merge branch 'tor-gitlab/mr/392' into maint-0.4.5

4 years agoMerge branch 'tor-gitlab/mr/393' into maint-0.4.5
David Goulet [Wed, 6 Oct 2021 19:41:12 +0000 (15:41 -0400)] 
Merge branch 'tor-gitlab/mr/393' into maint-0.4.5

4 years agoMerge branch 'tor-gitlab/mr/420' into maint-0.4.5
David Goulet [Wed, 6 Oct 2021 19:35:30 +0000 (15:35 -0400)] 
Merge branch 'tor-gitlab/mr/420' into maint-0.4.5

4 years agohs-v2: Only log once the connection warning to v2
David Goulet [Mon, 4 Oct 2021 18:38:50 +0000 (14:38 -0400)] 
hs-v2: Only log once the connection warning to v2

Closes #40474

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable version 2 HSPOST and HSFETCH command
David Goulet [Thu, 30 Sep 2021 14:59:24 +0000 (10:59 -0400)] 
hs-v2: Disable version 2 HSPOST and HSFETCH command

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable version 2 directory
David Goulet [Thu, 30 Sep 2021 14:46:17 +0000 (10:46 -0400)] 
hs-v2: Disable version 2 directory

Relay do not accept both stores and lookups of version 2 descriptor.
This effectively disable version 2 HSDir supports for relays.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable version 2 introduction point
David Goulet [Thu, 30 Sep 2021 14:40:19 +0000 (10:40 -0400)] 
hs-v2: Disable version 2 introduction point

Upon receiving a v2 introduction request, the relay will close the
circuit and send back a tor protocol error.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable version 2 service
David Goulet [Thu, 30 Sep 2021 14:32:05 +0000 (10:32 -0400)] 
hs-v2: Disable version 2 service

The minimum service version is raised from 2 to 3 which effectively
disable loading or creating an onion service v2.

As for ADD_ONION, for version 2, a 551 error is returned:

  "551 Failed to add Onion Service"

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agohs-v2: Disable SOCKS connection for v2 addresses
David Goulet [Thu, 30 Sep 2021 14:26:37 +0000 (10:26 -0400)] 
hs-v2: Disable SOCKS connection for v2 addresses

This effectively turns off the ability of tor to use HSv2 as a client by
invalidating the v2 onion hostname passed through a SOCKS request.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
David Goulet [Mon, 13 Sep 2021 17:34:44 +0000 (13:34 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoOnly check for bindable ports if we are unsure if it will fail.
Alexander Færøy [Thu, 4 Feb 2021 23:11:11 +0000 (23:11 +0000)] 
Only check for bindable ports if we are unsure if it will fail.

We currently assume that the only way for Tor to listen on ports in the
privileged port range (1 to 1023), on Linux, is if we are granted the
NET_BIND_SERVICE capability. Today on Linux, it's possible to specify
the beginning of the unprivileged port range using a sysctl
configuration option. Docker (and thus the CI service Tor uses) recently
changed this sysctl value to 0, which causes our tests to fail as they
assume that we should NOT be able to bind to a privileged port *without*
the NET_BIND_SERVICE capability.

In this patch, we read the value of the sysctl value via the /proc/sys/
filesystem iff it's present, otherwise we assume the default
unprivileged port range begins at port 1024.

See: tor#40275

4 years agoUse Debian bullseye for our hardened build.
Alexander Færøy [Mon, 16 Aug 2021 13:52:58 +0000 (13:52 +0000)] 
Use Debian bullseye for our hardened build.

4 years agoForce amd64 for CI builds.
Alexander Færøy [Mon, 13 Sep 2021 16:05:58 +0000 (18:05 +0200)] 
Force amd64 for CI builds.

4 years agodir: Do not flag non-running failing HSDir
David Goulet [Tue, 17 Aug 2021 16:43:58 +0000 (12:43 -0400)] 
dir: Do not flag non-running failing HSDir

When a directory request fails, we flag the relay as non Running so we
don't use it anymore.

This can be problematic with onion services because there are cases
where a tor instance could have a lot of services, ephemeral ones, and
keeps failing to upload descriptors, let say due to a bad network, and
thus flag a lot of nodes as non Running which then in turn can not be
used for circuit building.

This commit makes it that we never flag nodes as non Running on a onion
service directory request (upload or fetch) failure as to keep the
hashring intact and not affect other parts of tor.

Fortunately, the onion service hashring is _not_ selected by looking at
the Running flag but since we do a 3-hop circuit to the HSDir, other
services on the same instance can influence each other by removing nodes
from the consensus for path selection.

This was made apparent with a small network that ran out of nodes to
used due to rapid succession of onion services uploading and failing.
See #40434 for details.

Fixes #40434

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
David Goulet [Mon, 16 Aug 2021 20:34:19 +0000 (16:34 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoBump version to -dev
David Goulet [Mon, 16 Aug 2021 20:34:10 +0000 (16:34 -0400)] 
Bump version to -dev

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoBump version to -dev
David Goulet [Mon, 16 Aug 2021 20:33:58 +0000 (16:33 -0400)] 
Bump version to -dev

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoAlways teardown capture of logs in CAPTURE().
Alexander Færøy [Mon, 16 Aug 2021 15:27:38 +0000 (15:27 +0000)] 
Always teardown capture of logs in CAPTURE().

This will hopefully solve an issue where our gmtime related tests are
failing on 32-bit builds.

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
Alexander Færøy [Mon, 16 Aug 2021 13:58:32 +0000 (13:58 +0000)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoUse debian:buster instead of debian:stable for now.
Alexander Færøy [Mon, 16 Aug 2021 13:57:56 +0000 (13:57 +0000)] 
Use debian:buster instead of debian:stable for now.

4 years agoDisable message checking for some 32-bit tests about timegm failure.
Nick Mathewson [Mon, 16 Aug 2021 13:46:56 +0000 (09:46 -0400)] 
Disable message checking for some 32-bit tests about timegm failure.

Since we merged 40383, we don't expect these to give the same
warning on every platform.

4 years agoMake the version 0.4.5.10, not 0.4.5.10-dev.
Nick Mathewson [Mon, 16 Aug 2021 12:18:57 +0000 (08:18 -0400)] 
Make the version 0.4.5.10, not 0.4.5.10-dev.

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
Nick Mathewson [Mon, 16 Aug 2021 12:18:09 +0000 (08:18 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

"ours" to avoid version bump

4 years agoMake the version 0.3.6.16, not 0.3.6.16-dev.
Nick Mathewson [Mon, 16 Aug 2021 12:17:59 +0000 (08:17 -0400)] 
Make the version 0.3.6.16, not 0.3.6.16-dev.

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
David Goulet [Fri, 13 Aug 2021 13:44:53 +0000 (09:44 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoUpdate version to 0.3.5.16
David Goulet [Fri, 13 Aug 2021 13:43:44 +0000 (09:43 -0400)] 
Update version to 0.3.5.16

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoUpdate version to 0.4.5.10
David Goulet [Fri, 13 Aug 2021 13:42:52 +0000 (09:42 -0400)] 
Update version to 0.4.5.10

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
David Goulet [Thu, 12 Aug 2021 16:13:25 +0000 (12:13 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoUpdate GeoIP files to match IPFire location DB as per 2021/08/12.
Alexander Færøy [Thu, 12 Aug 2021 15:36:52 +0000 (15:36 +0000)] 
Update GeoIP files to match IPFire location DB as per 2021/08/12.

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
Alexander Færøy [Wed, 11 Aug 2021 13:15:58 +0000 (13:15 +0000)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/417' into maint-0.3.5
Alexander Færøy [Wed, 11 Aug 2021 13:15:35 +0000 (13:15 +0000)] 
Merge remote-tracking branch 'tor-gitlab/mr/417' into maint-0.3.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
Alexander Færøy [Wed, 11 Aug 2021 13:14:26 +0000 (13:14 +0000)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agoDisable ed25519-donna's batch verification.
George Kadianakis [Fri, 30 Jul 2021 13:35:48 +0000 (16:35 +0300)] 
Disable ed25519-donna's batch verification.

Fixes bug 40078.

As reported by hdevalence our batch verification logic can cause an assert
crash.

The assert happens because when the batch verification of ed25519-donna fails,
the code in `ed25519_checksig_batch()` falls back to doing a single
verification for each signature.

The crash occurs because batch verification failed, but then all signatures
individually verified just fine.

That's because batch verification and single verification use a different
equation which means that there are sigs that can pass single verification
but fail batch verification.

Fixing this would require modding ed25519-donna which is not in scope for
this ticket, and will be soon deprecated in favor of arti and
ed25519-dalek, so my branch instead removes batch verification.

4 years agofallbackdir: Regenerate list
David Goulet [Wed, 11 Aug 2021 13:04:40 +0000 (09:04 -0400)] 
fallbackdir: Regenerate list

New list for all stable releases.

Closes #40447

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'maint-0.3.5' into maint-0.4.5
Alexander Færøy [Wed, 11 Aug 2021 13:06:12 +0000 (13:06 +0000)] 
Merge branch 'maint-0.3.5' into maint-0.4.5

4 years agorelay: Reduce streaming compression ratio from HIGH to LOW
David Goulet [Thu, 18 Feb 2021 17:49:33 +0000 (12:49 -0500)] 
relay: Reduce streaming compression ratio from HIGH to LOW

Fixes #40301

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Reduce streaming compression ratio from HIGH to LOW
David Goulet [Thu, 18 Feb 2021 17:49:33 +0000 (12:49 -0500)] 
relay: Reduce streaming compression ratio from HIGH to LOW

Fixes #40301

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge remote-tracking branch 'tor-gitlab/mr/409' into maint-0.4.5
George Kadianakis [Tue, 6 Jul 2021 10:51:58 +0000 (13:51 +0300)] 
Merge remote-tracking branch 'tor-gitlab/mr/409' into maint-0.4.5

4 years agoMerge branch 'mr/395' into maint-0.4.5
George Kadianakis [Tue, 6 Jul 2021 10:42:29 +0000 (13:42 +0300)] 
Merge branch 'mr/395' into maint-0.4.5

4 years agoUse native timegm when available.
Nick Mathewson [Tue, 1 Jun 2021 20:18:23 +0000 (16:18 -0400)] 
Use native timegm when available.

Continue having a tor_gmtime_impl() unit test so that we can detect
any problems in our replacement function; add a new test function to
make sure that gmtime<->timegm are a round-trip on now-ish times.

This is a fix for bug #40383, wherein we ran into trouble because
tor_timegm() does not believe that time_t should include a count of
leap seconds, but FreeBSD's gmtime believes that it should.  This
disagreement meant that for a certain amount of time each day,
instead of calculating the most recent midnight, our voting-schedule
functions would calculate the second-most-recent midnight, and lead
to an assertion failure.

I am calling this a bugfix on 0.2.0.3-alpha when we first started
calculating our voting schedule in this way.

4 years agoSuppress a clang 12 warning about "suspicious concatenation".
Nick Mathewson [Thu, 1 Jul 2021 17:03:19 +0000 (13:03 -0400)] 
Suppress a clang 12 warning about "suspicious concatenation".

My clang doesn't like it when we write code like this:

    char *list[] = {
       "abc",
       "def",
       "ghi"
       "jkl"
    }

It wonders whether we meant to put a comma between "ghi" and "jkl"
or not, and gives a warning.

To suppress this warning (since in this case, we did mean to omit
the comma), we just wrap the two strings in parentheses.

Closes #40426; bugfix on 0.4.0.4-rc.

4 years agoMissing changes file for #40409
Nick Mathewson [Wed, 30 Jun 2021 12:14:57 +0000 (08:14 -0400)] 
Missing changes file for #40409

4 years agoSuppress strict-prototypes warning on NSS pk11pub.h header
Nick Mathewson [Mon, 28 Jun 2021 13:08:31 +0000 (09:08 -0400)] 
Suppress strict-prototypes warning on NSS pk11pub.h header

We already did this in a couple of places, but there are more that
we didn't get.  This is necessary for systems with versions of
NSS that don't do their prototypes properly.

Fixes #40409; bugfix on 0.3.5.1-alpha.

4 years agoEnable deterministic RNG for address set tests.
Alexander Færøy [Fri, 25 Jun 2021 16:29:53 +0000 (16:29 +0000)] 
Enable deterministic RNG for address set tests.

This patch enables the deterministic RNG for address set tests,
including the tests which uses address set indirectly via the nodelist
API.

This should prevent random test failures in the highly unlikely case of
a false positive which was seen in tor#40419.

See: tpo/core/tor#40419.

4 years agoBump to 0.4.5.9-dev
Nick Mathewson [Mon, 14 Jun 2021 15:47:41 +0000 (11:47 -0400)] 
Bump to 0.4.5.9-dev

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Mon, 14 Jun 2021 15:47:29 +0000 (11:47 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4 maint-0.4.4
Nick Mathewson [Mon, 14 Jun 2021 15:46:20 +0000 (11:46 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

"ours" to avoid version bump.

4 years agoBump to 0.3.5.15-dev
Nick Mathewson [Mon, 14 Jun 2021 15:45:30 +0000 (11:45 -0400)] 
Bump to 0.3.5.15-dev

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Thu, 10 Jun 2021 16:30:29 +0000 (12:30 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Thu, 10 Jun 2021 16:30:11 +0000 (12:30 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoFix TROVE-2021-006: Out-of-bounds read on v3 desc parsing
George Kadianakis [Tue, 18 May 2021 14:06:57 +0000 (17:06 +0300)] 
Fix TROVE-2021-006: Out-of-bounds read on v3 desc parsing

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Thu, 10 Jun 2021 13:55:55 +0000 (09:55 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoResolve remaining merge conflicts in relay.c
Nick Mathewson [Thu, 10 Jun 2021 13:55:35 +0000 (09:55 -0400)] 
Resolve remaining merge conflicts in relay.c

(My bad!)

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Thu, 10 Jun 2021 12:53:07 +0000 (08:53 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Thu, 10 Jun 2021 12:52:39 +0000 (08:52 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

Conflicts resolved:
src/core/or/relay.c

4 years agoTROVE-2021-003: Check layer_hint before half-closed end and resolve cells
David Goulet [Thu, 3 Jun 2021 13:33:21 +0000 (09:33 -0400)] 
TROVE-2021-003: Check layer_hint before half-closed end and resolve cells

This issue was reported by Jann Horn part of Google's Project Zero.

Jann's one-sentence summary: entry/middle relays can spoof RELAY_END cells on
half-closed streams, which can lead to stream confusion between OP and
exit.

Fixes #40389

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Thu, 10 Jun 2021 12:42:15 +0000 (08:42 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Thu, 10 Jun 2021 12:42:15 +0000 (08:42 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoMerge branch 'bug40391_035' into maint-0.3.5
Nick Mathewson [Thu, 10 Jun 2021 12:41:59 +0000 (08:41 -0400)] 
Merge branch 'bug40391_035' into maint-0.3.5

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Thu, 10 Jun 2021 12:37:34 +0000 (08:37 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Thu, 10 Jun 2021 12:37:26 +0000 (08:37 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoMerge branch 'bug40390_035_squashed' into maint-0.3.5
Nick Mathewson [Thu, 10 Jun 2021 12:34:25 +0000 (08:34 -0400)] 
Merge branch 'bug40390_035_squashed' into maint-0.3.5

4 years agoAssert on _all_ failures from RAND_bytes().
Nick Mathewson [Mon, 17 May 2021 12:50:01 +0000 (08:50 -0400)] 
Assert on _all_ failures from RAND_bytes().

Previously, we would detect errors from a missing RNG
implementation, but not failures from the RNG code itself.

Fortunately, it appears those failures do not happen in practice
when Tor is using OpenSSL's default RNG implementation.  Fixes bug
40390; bugfix on 0.2.8.1-alpha. This issue is also tracked as
TROVE-2021-004. Reported by Jann Horn at Google's Project Zero.

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Thu, 10 Jun 2021 12:21:48 +0000 (08:21 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Thu, 10 Jun 2021 12:21:47 +0000 (08:21 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoUpdate geoip files to match ipfire location db, 2021/06/10.
Nick Mathewson [Thu, 10 Jun 2021 12:20:13 +0000 (08:20 -0400)] 
Update geoip files to match ipfire location db, 2021/06/10.

4 years agoBump to 0.4.5.9.
Nick Mathewson [Mon, 7 Jun 2021 17:31:10 +0000 (13:31 -0400)] 
Bump to 0.4.5.9.

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Mon, 7 Jun 2021 17:30:36 +0000 (13:30 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

"ours" to avoid version bump.

4 years agoBump to 0.4.4.9
Nick Mathewson [Mon, 7 Jun 2021 17:30:18 +0000 (13:30 -0400)] 
Bump to 0.4.4.9

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Mon, 7 Jun 2021 17:29:49 +0000 (13:29 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoBump to 0.3.5.15.
Nick Mathewson [Mon, 7 Jun 2021 17:29:35 +0000 (13:29 -0400)] 
Bump to 0.3.5.15.

4 years agochanges file for #40175
Nick Mathewson [Tue, 1 Jun 2021 16:16:06 +0000 (12:16 -0400)] 
changes file for #40175

4 years agoStop using the "x$FOO" idiom in git-resquash.sh
Nick Mathewson [Fri, 28 May 2021 12:02:08 +0000 (08:02 -0400)] 
Stop using the "x$FOO" idiom in git-resquash.sh

The new version of shellcheck says that that this idiom is
unnecessary, and its presence here is making the shellcheck tests
fail.

No changes file needed, since this is not user-facing code.

4 years agoUpgrade and rate-limit compression failure message.
Nick Mathewson [Thu, 27 May 2021 14:49:37 +0000 (10:49 -0400)] 
Upgrade and rate-limit compression failure message.

Without this message getting logged at 'WARN', it's hard to
contextualize the messages we get about compression bombs, so this
message should fix #40175.

I'm rate-limiting this, however, since it _could_ get spammy if
somebody on the network starts acting up.  (Right now it should be
very quiet; I've asked Sebastian to check it, and he says that he
doesn't hit this message in practice.)

Closes #40175.

4 years agoPrefer mmap()ed consensus files over cached_dir_t entries.
Nick Mathewson [Wed, 26 May 2021 17:02:56 +0000 (13:02 -0400)] 
Prefer mmap()ed consensus files over cached_dir_t entries.

Cached_dir_t is a somewhat "legacy" kind of storage when used for
consensus documents, and it appears that there are cases when
changing our settings causes us to stop updating those entries.

This can cause trouble, as @arma found out in #40375, where he
changed his settings around, and consensus diff application got
messed up: consensus diffs were being _requested_ based on the
latest consensus, but were being (incorrectly) applied to a
consensus that was no longer the latest one.

This patch is a minimal fix for backporting purposes: it has Tor do
the same search when applying consensus diffs as we use to request
them.  This should be sufficient for correct behavior.

There's a similar case in GETINFO handling; I've fixed that too.

Fixes #40375; bugfix on 0.3.1.1-alpha.

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Alexander Færøy [Tue, 25 May 2021 13:25:23 +0000 (13:25 +0000)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Alexander Færøy [Tue, 25 May 2021 13:25:23 +0000 (13:25 +0000)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoRemove the function `tor_tls_assert_renegotiation_unblocked`.
Nick Mathewson [Tue, 25 May 2021 11:38:31 +0000 (07:38 -0400)] 
Remove the function `tor_tls_assert_renegotiation_unblocked`.

It was used nowhere outside its own unit tests, and it was causing
compilation issues with recent OpenSSL 3.0.0 alphas.

Closes ticket 40399.

4 years agoUse a more secure hash function for the circuitmux hashtable.
Nick Mathewson [Tue, 18 May 2021 12:40:09 +0000 (08:40 -0400)] 
Use a more secure hash function for the circuitmux hashtable.

Fixes bug 40931; bugfix on 0.2.4.4-alpha. Also tracked as
TROVE-2021-005.

This issue was reported by Jann Horn from Google's Project Zero.

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/387' into maint-0.4.5
Nick Mathewson [Mon, 17 May 2021 13:09:42 +0000 (09:09 -0400)] 
Merge remote-tracking branch 'tor-gitlab/mr/387' into maint-0.4.5