]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
4 years agorelay: Add number of open and max sockets metrics
David Goulet [Wed, 5 May 2021 17:57:19 +0000 (13:57 -0400)] 
relay: Add number of open and max sockets metrics

With this commit, a relay will emit metrics that give the total number
of sockets and total number of opened sockets.

Related to #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Add the onionskins processing metrics
David Goulet [Wed, 5 May 2021 17:33:33 +0000 (13:33 -0400)] 
relay: Add the onionskins processing metrics

With this commit, a relay now emits metrics event on the MetricsPort
related to how many onionskins were handled (processed or dropped) for
each handshake type.

Related to #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Add the OOM invocation metrics
David Goulet [Thu, 15 Apr 2021 18:23:47 +0000 (14:23 -0400)] 
relay: Add the OOM invocation metrics

With this commit, a relay now emits metrics event on the MetricsPort
related to the OOM invocation for:

  - DNS cache
  - GeoIP database
  - Cell queues
  - HSDir caches

Everytime the OOM is invoked, the number of bytes is added to the
metrics counter for that specific type of invocation.

Related to #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Code and objects to initialize metrics store
David Goulet [Thu, 15 Apr 2021 16:46:23 +0000 (12:46 -0400)] 
relay: Code and objects to initialize metrics store

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Groundwork for relay metrics support
David Goulet [Thu, 15 Apr 2021 12:58:20 +0000 (08:58 -0400)] 
relay: Groundwork for relay metrics support

The basic functions for the relay subsystem to expose metrics onto the
MetricsPort.

Part of #40367

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agometrics: Add a reset store helper function
David Goulet [Wed, 5 May 2021 16:57:44 +0000 (12:57 -0400)] 
metrics: Add a reset store helper function

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agometrics: Move helper function to lib/metrics
David Goulet [Thu, 15 Apr 2021 13:05:55 +0000 (09:05 -0400)] 
metrics: Move helper function to lib/metrics

It is a common function that a lot of subsystem can use which is to
format a label so move it out of the HS subsystem into the more generic
metrics library.

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agometrics: Print once the Promtheus comments
David Goulet [Thu, 6 May 2021 14:54:50 +0000 (10:54 -0400)] 
metrics: Print once the Promtheus comments

An entry can have multiple labels but only print once the comments at
the first one. This follows the Promtheus best practices.

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMissing changes file for #40330
Nick Mathewson [Tue, 11 May 2021 14:17:28 +0000 (10:17 -0400)] 
Missing changes file for #40330

4 years agoMake client heartbeat stats tied to the heartbeat period.
Nick Mathewson [Tue, 11 May 2021 14:08:52 +0000 (10:08 -0400)] 
Make client heartbeat stats tied to the heartbeat period.

Patch from cypherpunks. Closes #40330.

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Mon, 10 May 2021 18:30:09 +0000 (14:30 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'ticket40374_046' into maint-0.4.6
Nick Mathewson [Mon, 10 May 2021 18:30:00 +0000 (14:30 -0400)] 
Merge branch 'ticket40374_046' into maint-0.4.6

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Mon, 10 May 2021 14:55:00 +0000 (10:55 -0400)] 
Merge branch 'maint-0.4.6'

"ours" to avoid version bump.

4 years agoBump to 0.4.6.3-rc-dev
Nick Mathewson [Mon, 10 May 2021 14:53:39 +0000 (10:53 -0400)] 
Bump to 0.4.6.3-rc-dev

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
Nick Mathewson [Mon, 10 May 2021 14:53:10 +0000 (10:53 -0400)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

"ours" to avoid version bump.

4 years agoUpdate to 0.4.5.8-dev
Nick Mathewson [Mon, 10 May 2021 14:53:00 +0000 (10:53 -0400)] 
Update to 0.4.5.8-dev

4 years agocopy changelog and releasenotes forward
Nick Mathewson [Mon, 10 May 2021 14:12:45 +0000 (10:12 -0400)] 
copy changelog and releasenotes forward

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'
Alexander Færøy [Mon, 10 May 2021 10:58:29 +0000 (10:58 +0000)] 
Merge remote-tracking branch 'tor-gitlab/mr/369'

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
Nick Mathewson [Fri, 7 May 2021 17:08:25 +0000 (13:08 -0400)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Fri, 7 May 2021 17:08:25 +0000 (13:08 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'ticket40382_045' into maint-0.4.5
Nick Mathewson [Fri, 7 May 2021 17:08:14 +0000 (13:08 -0400)] 
Merge branch 'ticket40382_045' into maint-0.4.5

4 years agoAdd a sandbox workaround for Glibc 2.33
Nick Mathewson [Fri, 7 May 2021 16:09:41 +0000 (12:09 -0400)] 
Add a sandbox workaround for Glibc 2.33

This change permits the newfstatat() system call, and fixes issues
40382 (and 40381).

This isn't a free change.  From the commit:

    // Libc 2.33 uses this syscall to implement both fstat() and stat().
    //
    // The trouble is that to implement fstat(fd, &st), it calls:
    //     newfstatat(fs, "", &st, AT_EMPTY_PATH)
    // We can't detect this usage in particular, because "" is a pointer
    // we don't control.  And we can't just look for AT_EMPTY_PATH, since
    // AT_EMPTY_PATH only has effect when the path string is empty.
    //
    // So our only solution seems to be allowing all fstatat calls, which
    // means that an attacker can stat() anything on the filesystem. That's
    // not a great solution, but I can't find a better one.

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
Nick Mathewson [Fri, 7 May 2021 14:41:34 +0000 (10:41 -0400)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Fri, 7 May 2021 14:41:34 +0000 (10:41 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Fri, 7 May 2021 14:41:34 +0000 (10:41 -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 [Fri, 7 May 2021 14:41:33 +0000 (10:41 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoReindent a few lines to fix a GCC warning.
Nick Mathewson [Fri, 7 May 2021 14:39:20 +0000 (10:39 -0400)] 
Reindent a few lines to fix a GCC warning.

As of GCC 11.1.1, the compiler warns us about code like this:

     if (a)
         b;
         c;

and that's a good thing: we wouldn't want to "goto fail".  But we
had an instance if this in circuituse.c, which was making our
compilation sad.

Fixes bug 40380; bugfix on 0.3.0.1-alpha.

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
Nick Mathewson [Fri, 7 May 2021 13:53:58 +0000 (09:53 -0400)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Fri, 7 May 2021 13:53:58 +0000 (09:53 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Fri, 7 May 2021 13:53:58 +0000 (09: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 [Fri, 7 May 2021 13:53:57 +0000 (09:53 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoUpdate geoip files to match ipfire location db, 2021/05/07.
Nick Mathewson [Fri, 7 May 2021 13:53:46 +0000 (09:53 -0400)] 
Update geoip files to match ipfire location db, 2021/05/07.

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Fri, 7 May 2021 13:42:39 +0000 (09:42 -0400)] 
Merge branch 'maint-0.4.6'

"ours" merge to avoid version bump.

4 years agoBump to 0.4.6.3-rc
Nick Mathewson [Fri, 7 May 2021 13:42:18 +0000 (09:42 -0400)] 
Bump to 0.4.6.3-rc

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
Nick Mathewson [Fri, 7 May 2021 13:39:45 +0000 (09:39 -0400)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

"ours" to avoid version bump.

4 years agoBump to 0.4.5.8.
Nick Mathewson [Fri, 7 May 2021 13:39:33 +0000 (09:39 -0400)] 
Bump to 0.4.5.8.

4 years agoMerge branch 'maint-0.4.6'
David Goulet [Fri, 7 May 2021 13:05:21 +0000 (09:05 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'tor-gitlab/mr/375' into maint-0.4.6
David Goulet [Fri, 7 May 2021 13:05:16 +0000 (09:05 -0400)] 
Merge branch 'tor-gitlab/mr/375' into maint-0.4.6

4 years agoMerge branch 'maint-0.4.6'
David Goulet [Fri, 7 May 2021 13:04:45 +0000 (09:04 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
David Goulet [Fri, 7 May 2021 13:03:39 +0000 (09:03 -0400)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

4 years agoLog warning when connecting to soon-to-be-deprecated v2 onions.
George Kadianakis [Wed, 5 May 2021 07:50:29 +0000 (10:50 +0300)] 
Log warning when connecting to soon-to-be-deprecated v2 onions.

4 years agoAdd warning when trying to connect to deprecated v2 onions.
George Kadianakis [Wed, 5 May 2021 08:10:28 +0000 (11:10 +0300)] 
Add warning when trying to connect to deprecated v2 onions.

4 years agoPrepare for #40373: Re-introduce parsing for v2 onion addresses.
George Kadianakis [Wed, 5 May 2021 08:05:09 +0000 (11:05 +0300)] 
Prepare for #40373: Re-introduce parsing for v2 onion addresses.

Welcome back ONION_V2_HOSTNAME! :)

4 years agoMerge branch 'maint-0.4.6'
George Kadianakis [Wed, 5 May 2021 07:21:48 +0000 (10:21 +0300)] 
Merge branch 'maint-0.4.6'

4 years agohs: Fix ADD_ONION with client authorization
David Goulet [Tue, 4 May 2021 14:37:26 +0000 (10:37 -0400)] 
hs: Fix ADD_ONION with client authorization

Turns out that passing client authorization keys to ADD_ONION for v3 was
not working because we were not setting the "is_client_auth_enabled"
flag to true once the clients were configured. This lead to the
descriptor being encoded without the clients.

This patch removes that flag and instead adds an inline function that
can be used to check if a given service has client authorization
enabled.

This will be much less error prone of needing to keep in sync the client
list and a flag instead.

Fixes #40378

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoRemove NEED_SKEY_1024 parsing.
Nick Mathewson [Fri, 23 Apr 2021 19:55:51 +0000 (15:55 -0400)] 
Remove NEED_SKEY_1024 parsing.

Only v2 onion services needed this, and they are now gone.

Closes #40374.

4 years agoRemove HSv2 leftovers after merging #18346
David Goulet [Fri, 23 Apr 2021 16:54:10 +0000 (12:54 -0400)] 
Remove HSv2 leftovers after merging #18346

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'tor-gitlab/mr/327'
David Goulet [Fri, 23 Apr 2021 16:48:55 +0000 (12:48 -0400)] 
Merge branch 'tor-gitlab/mr/327'

Conflicts:
  src/test/test.c

  Minor comment issue.

4 years agoMerge branch 'maint-0.4.6'
George Kadianakis [Fri, 23 Apr 2021 10:00:24 +0000 (13:00 +0300)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
George Kadianakis [Fri, 23 Apr 2021 10:00:23 +0000 (13:00 +0300)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

4 years agohs: Fix memory leak in client cache
David Goulet [Tue, 20 Apr 2021 17:13:54 +0000 (13:13 -0400)] 
hs: Fix memory leak in client cache

Fixes #40356

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Wed, 21 Apr 2021 14:34:28 +0000 (10:34 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
Nick Mathewson [Wed, 21 Apr 2021 14:34:28 +0000 (10:34 -0400)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Wed, 21 Apr 2021 14:34:28 +0000 (10:34 -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 [Wed, 21 Apr 2021 14:34:14 +0000 (10:34 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/363' into maint-0.3.5
George Kadianakis [Wed, 21 Apr 2021 13:48:22 +0000 (16:48 +0300)] 
Merge remote-tracking branch 'tor-gitlab/mr/363' into maint-0.3.5

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Mon, 19 Apr 2021 15:43:39 +0000 (11:43 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoMerge branch 'mr_347_squashed' into maint-0.4.6
Nick Mathewson [Mon, 19 Apr 2021 15:40:44 +0000 (11:40 -0400)] 
Merge branch 'mr_347_squashed' into maint-0.4.6

4 years agorelay: Emit log warning if Address is internal and can't be used
David Goulet [Thu, 25 Mar 2021 14:15:50 +0000 (10:15 -0400)] 
relay: Emit log warning if Address is internal and can't be used

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge remote-tracking branch 'jigsaw/fix-40317_046-saveconf-sandbox-one-backup'
Nick Mathewson [Mon, 19 Apr 2021 15:32:21 +0000 (11:32 -0400)] 
Merge remote-tracking branch 'jigsaw/fix-40317_046-saveconf-sandbox-one-backup'

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
Nick Mathewson [Mon, 19 Apr 2021 15:30:00 +0000 (11:30 -0400)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Mon, 19 Apr 2021 15:30:00 +0000 (11:30 -0400)] 
Merge branch 'maint-0.4.6'

4 years agoTweak changes/ticket40369 to be a bug.
Nick Mathewson [Mon, 19 Apr 2021 15:29:46 +0000 (11:29 -0400)] 
Tweak changes/ticket40369 to be a bug.

4 years agoscripts/build/combine_libs: use $AR rather than ar
Emery Hemingway [Fri, 16 Apr 2021 13:17:43 +0000 (15:17 +0200)] 
scripts/build/combine_libs: use $AR rather than ar

Using a custom ar at $AR may be necessary for cross-compilation.

Closes #40369

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge remote-tracking branch 'tor-gitlab/mr/364'
George Kadianakis [Mon, 19 Apr 2021 14:38:16 +0000 (17:38 +0300)] 
Merge remote-tracking branch 'tor-gitlab/mr/364'

4 years agoMerge branch 'maint-0.4.5' into maint-0.4.6
George Kadianakis [Mon, 19 Apr 2021 14:33:46 +0000 (17:33 +0300)] 
Merge branch 'maint-0.4.5' into maint-0.4.6

4 years agoMerge branch 'maint-0.4.6'
George Kadianakis [Mon, 19 Apr 2021 14:33:46 +0000 (17:33 +0300)] 
Merge branch 'maint-0.4.6'

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/355' into maint-0.4.5
George Kadianakis [Mon, 19 Apr 2021 14:32:56 +0000 (17:32 +0300)] 
Merge remote-tracking branch 'tor-gitlab/mr/355' into maint-0.4.5

4 years agoStop calling evdns_set_random_bytes_fn()
Nick Mathewson [Fri, 16 Apr 2021 21:26:59 +0000 (17:26 -0400)] 
Stop calling evdns_set_random_bytes_fn()

This function has been a no-op since Libevent 2.0.4-alpha, when
libevent got an arc4random() implementation.  Libevent has finally
removed it, which will break our compilation unless we stop calling
it.  (This is currently breaking compilation in OSS-fuzz.)

Closes #40371.

4 years agoBump to 0.4.7.0-alpha-dev tor-0.4.7.0-alpha-dev
Nick Mathewson [Thu, 15 Apr 2021 16:44:26 +0000 (12:44 -0400)] 
Bump to 0.4.7.0-alpha-dev

4 years agoMerge branch 'maint-0.4.6'
Nick Mathewson [Thu, 15 Apr 2021 16:42:33 +0000 (12:42 -0400)] 
Merge branch 'maint-0.4.6'

"ours" to avoid version bump.

4 years agoBump to 0.4.6.2-alpha-dev
Nick Mathewson [Thu, 15 Apr 2021 16:42:23 +0000 (12:42 -0400)] 
Bump to 0.4.6.2-alpha-dev

4 years agoAdd 0.4.6 to git-list-tor-branches.sh
Nick Mathewson [Thu, 15 Apr 2021 16:40:45 +0000 (12:40 -0400)] 
Add 0.4.6 to  git-list-tor-branches.sh

4 years agotwo more changelog fixes from arma tor-0.4.6.2-alpha
Nick Mathewson [Wed, 14 Apr 2021 19:22:26 +0000 (15:22 -0400)] 
two more changelog fixes from arma

4 years agochangelog edits from arma
Nick Mathewson [Wed, 14 Apr 2021 19:15:15 +0000 (15:15 -0400)] 
changelog edits from arma

4 years agolight changelog edits
Nick Mathewson [Wed, 14 Apr 2021 18:24:32 +0000 (14:24 -0400)] 
light changelog edits

4 years agoStart a changes file for 0.4.6.2-alpha
Nick Mathewson [Wed, 14 Apr 2021 14:58:15 +0000 (10:58 -0400)] 
Start a changes file for 0.4.6.2-alpha

4 years agoBump version to 0.4.6.2-alpha.
Nick Mathewson [Wed, 14 Apr 2021 14:55:48 +0000 (10:55 -0400)] 
Bump version to 0.4.6.2-alpha.

4 years agogeoip script: add options to output AS numbers.
Nick Mathewson [Wed, 14 Apr 2021 14:28:44 +0000 (10:28 -0400)] 
geoip script: add options to output AS numbers.

The --include-asn option includes AS numbers in the geoip mapping.

The --output-asn option makes the program generate a number-to-name
mapping file.

Additionally, the script now outputs ?? CC entries for networks that
are listed but which have no country known.

4 years agoMerge branch 'maint-0.4.5'
David Goulet [Wed, 14 Apr 2021 12:39:17 +0000 (08:39 -0400)] 
Merge branch 'maint-0.4.5'

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
David Goulet [Wed, 14 Apr 2021 12:39:16 +0000 (08:39 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
David Goulet [Wed, 14 Apr 2021 12:39:16 +0000 (08:39 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agofallbackdir: Remove two unspec lines
David Goulet [Wed, 14 Apr 2021 12:39:04 +0000 (08:39 -0400)] 
fallbackdir: Remove two unspec lines

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoFix test naming, and fix tests on windows.
Nick Mathewson [Tue, 13 Apr 2021 21:38:31 +0000 (17:38 -0400)] 
Fix test naming, and fix tests on windows.

This is a bugfix against my fix for #40133, which has not yet
appeared in 0.3.5.

4 years agoClean up the CONNECTION_TESTCASE_ARG macro.
Nick Mathewson [Tue, 13 Apr 2021 21:34:03 +0000 (17:34 -0400)] 
Clean up the CONNECTION_TESTCASE_ARG macro.

4 years agoMerge branch 'maint-0.4.5'
Nick Mathewson [Tue, 13 Apr 2021 21:00:56 +0000 (17:00 -0400)] 
Merge branch 'maint-0.4.5'

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Tue, 13 Apr 2021 20:59:16 +0000 (16:59 -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 [Tue, 13 Apr 2021 20:59:15 +0000 (16:59 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agofallbackdir: Renegerate list with 200 relays
David Goulet [Tue, 13 Apr 2021 19:15:58 +0000 (15:15 -0400)] 
fallbackdir: Renegerate list with 200 relays

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Move "overload-general" from extra-info to server descriptor.
Alexander Færøy [Mon, 12 Apr 2021 18:36:05 +0000 (18:36 +0000)] 
relay: Move "overload-general" from extra-info to server descriptor.

Fixes #40364

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Tue, 13 Apr 2021 14:36:01 +0000 (10:36 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoMerge branch 'maint-0.4.5'
Nick Mathewson [Tue, 13 Apr 2021 14:36:01 +0000 (10:36 -0400)] 
Merge branch 'maint-0.4.5'

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Tue, 13 Apr 2021 14:36:00 +0000 (10:36 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoUpdate geoip files to match ipfire location db, 2021/04/13.
Nick Mathewson [Tue, 13 Apr 2021 14:35:50 +0000 (10:35 -0400)] 
Update geoip files to match ipfire location db, 2021/04/13.

4 years agoMerge branch 'maint-0.4.5'
Nick Mathewson [Tue, 13 Apr 2021 13:41:13 +0000 (09:41 -0400)] 
Merge branch 'maint-0.4.5'

4 years agoscripts: Add default include path to ccls generated file
David Goulet [Mon, 12 Apr 2021 16:55:52 +0000 (12:55 -0400)] 
scripts: Add default include path to ccls generated file

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoguard: Don't check bridge transport name when selecting eligible guards
David Goulet [Thu, 8 Apr 2021 18:08:28 +0000 (14:08 -0400)] 
guard: Don't check bridge transport name when selecting eligible guards

This is related to ticket #40360 which found this problem when a Bridge entry
with a transport name (let say obfs4) is set without a fingerprint:

  Bridge obfs4 <IP>:<PORT> cert=<...> iat-mode=0

(Notice, no fingerprint between PORT and "cert=")

Problem: commit 09c6d0324626ffa349c7eed66d9ede92ecd71583 added a check in
get_sampled_guard_for_bridge() that would return NULL if the selected bridge
did not have a valid transport name (that is the Bridge transport name that
corresponds to a ClientTransportPlugin).

Unfortuantely, this function is also used when selecting our eligible guards
which is done *before* the transport list is populated and so the added check
for the bridge<->transport name is querying an empty list of transports
resulting in always returning NULL.

For completion, the logic is: Pick eligible guards (use bridge(s) if need be)
then for those, initiate a connection to the pluggable transport proxy and
then populate the transport list once we've connected.

Back to get_sampled_guard_for_bridge(). As said earlier, it is used when
selecting our eligible guards in a way that prevents us from selecting
duplicates. In other words, if that function returns non-NULL, the selection
continues considering the bridge was sampled before. But if it returns NULL,
the relay is added to the eligible list.

This bug made it that our eligible guard list was populated with the *same*
bridge 3 times like so (remember no fingerprint):

  [info] entry_guards_update_primary(): Primary entry guards have changed. New primary guard list is:
  [info] entry_guards_update_primary():   1/3: [bridge] ($0000000000000000000000000000000000000000)
  [info] entry_guards_update_primary():   2/3: [bridge] ($0000000000000000000000000000000000000000)
  [info] entry_guards_update_primary():   3/3: [bridge] ($0000000000000000000000000000000000000000)

When tor starts, it will find the bridge fingerprint by connecting to it and
will then update the primary guard list by calling
entry_guard_learned_bridge_identity() which then goes and update only 1 single
entry resulting in this list:

  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($<FINGERPRINT>) is still listed.
  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($0000000000000000000000000000000000000000) is still listed.
  [debug] sampled_guards_update_consensus_presence(): Sampled guard [bridge] ($0000000000000000000000000000000000000000) is still listed.

And here lies the problem, now tor is stuck attempting to wait for a valid
descriptor for at least 2 guards where the second one is a bunch of zeroes and
thus tor will never fully bootstraps:

  [info] I learned some more directory information, but not enough to build a
  circuit: We're missing descriptors for 1/2 of our primary entry guards
  (total microdescriptors: 6671/6703). That's ok. We will try to fetch missing
  descriptors soon.

Now, why passing the fingerprint then works? This is because the list of
guards contains 3 times the same bridge but they all have a fingerprint and so
the descriptor can be found and tor can bootstraps.

The solution here is to entirely remove the transport name check in
get_sampled_guard_for_bridge() since the transport_list is empty at that
point. That way, the eligible guard list only gets 1 entry, the bridge, and
can then go on to bootstrap properly.

It is OK to do so since when launching a bridge descriptor fetch, we validate
that the bridge transport name is OK and thus avoid connecting to a bridge
without a ClientTransportPlugin. If we wanted to keep the check in place, we
would need to populate the transport_list much earlier and this would require
a much bigger refactoring.

Fixes #40360

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge remote-tracking branch 'tor-gitlab/mr/354'
George Kadianakis [Thu, 8 Apr 2021 11:37:30 +0000 (14:37 +0300)] 
Merge remote-tracking branch 'tor-gitlab/mr/354'

4 years agoMerge branch 'maint-0.4.5'
George Kadianakis [Thu, 8 Apr 2021 11:29:08 +0000 (14:29 +0300)] 
Merge branch 'maint-0.4.5'