]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
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 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 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 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.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 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/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 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 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 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.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 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 agoTry making our configure.ac script build with AC 2.70.
Nick Mathewson [Wed, 7 Apr 2021 14:18:44 +0000 (10:18 -0400)] 
Try making our configure.ac script build with AC 2.70.

In versions <=2.69, according to the autoconf docs, AC_PROG_CC_C99
is needed with some compilers, if they require extra arguments to
build C99 programs.  In versions >=2.70, AC_PROG_CC checks for these
compilers automatically, and so the AC_PROG_CC_C99 macro is
obsolete.

So, what can you do if you want your script to work right with both
autoconf versions?  IIUC, neither including AC_PROG_CC_C99 macro nor
leaving it out will give you the right behavior with both versions.
It looks like you need to look at the autoconf version explicitly.

(Now, the autoconf manual implies that it's "against autoconf
philosophy" to look at the autoconf version rather than trying the
behavior to see if it works, but they don't actually tell you how to
detect recoverably at autoconf-time whether a macro is obsolete or
not, and I can't find a way to do that.)

So, is it safe to use m4_version_prereq, like I do here?  It isn't
listed in the autoconf 2.63 manual (which is the oldest version we
support).  But a mailing list message [1] (which added the
documentation back in 2008) implies that m4_version_prereq has been
there since "at least back to autoconf 2.59".

https://lists.gnu.org/archive/html/autoconf-patches/2008-12/msg00025.html

So I think this will work.

I am basing this patch against Tor 0.3.5 since, if autoconf 2.70
becomes widespread before 0.3.5 is unsupported, we might need this
patch to continue 0.3.5 development.  But I don't think we should
backport farther than 0.4.5 until/unless that actually happens.

This is part of a fix for #40355.

4 years agoFix glob processing on BSD systems. #40318
Daniel Pinto [Thu, 25 Mar 2021 01:23:04 +0000 (01:23 +0000)] 
Fix glob processing on BSD systems. #40318

On Linux systems, glob automatically ignores the errors ENOENT and
ENOTDIR because they are expected during glob expansion. But BSD
systems do not ignore these, resulting in glob failing when globs
expand to invalid paths. This is fixed by adding a custom error
handler that ignores only these two errors and removing the
GLOB_ERR flag as it makes glob fail even if the error handler
ignores the error and is unnecessary as the error handler will
make glob fail on all other errors anyway.

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Wed, 24 Mar 2021 16:25:05 +0000 (12:25 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agochannel: Fix use after free in channel_do_open_actions()
David Goulet [Tue, 23 Mar 2021 13:19:41 +0000 (09:19 -0400)] 
channel: Fix use after free in channel_do_open_actions()

Fortunately, our tor_free() is setting the variable to NULL after so we were
in a situation where NULL was always used instead of the transport name.

This first appeared in 894ff2dc8422cb86312c512698acd76476224f87 and results in
basically no bridge with a transport being able to use DoS defenses.

Fixes #40345

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge remote-tracking branch 'tor-gitlab/mr/333' into maint-0.4.5
George Kadianakis [Wed, 17 Mar 2021 11:43:38 +0000 (13:43 +0200)] 
Merge remote-tracking branch 'tor-gitlab/mr/333' into maint-0.4.5

4 years agoBump version to 0.4.5.7-dev
Nick Mathewson [Tue, 16 Mar 2021 13:18:27 +0000 (09:18 -0400)] 
Bump version to 0.4.5.7-dev

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Tue, 16 Mar 2021 13:18:06 +0000 (09:18 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

"ours" to avoid version bump.

4 years agoBump version to 0.4.4.8-dev
Nick Mathewson [Tue, 16 Mar 2021 13:17:56 +0000 (09:17 -0400)] 
Bump version to 0.4.4.8-dev

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Tue, 16 Mar 2021 13:17:40 +0000 (09:17 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

"ours" to avoid version bump.

4 years agoBump to 0.3.5.14-dev
Nick Mathewson [Tue, 16 Mar 2021 13:17:31 +0000 (09:17 -0400)] 
Bump to 0.3.5.14-dev

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Mon, 15 Mar 2021 13:41:38 +0000 (09:41 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoRemove check-best-practices from check-local in 0.4.4
Nick Mathewson [Mon, 15 Mar 2021 13:41:19 +0000 (09:41 -0400)] 
Remove check-best-practices from check-local in 0.4.4

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

4 years agoMerge branch 'bug40316_035_v2' into maint-0.3.5
Nick Mathewson [Mon, 15 Mar 2021 12:58:54 +0000 (08:58 -0400)] 
Merge branch 'bug40316_035_v2' into maint-0.3.5

4 years agoFix detection of point to insert signatures on a pending consensus.
Nick Mathewson [Wed, 3 Mar 2021 20:14:31 +0000 (15:14 -0500)] 
Fix detection of point to insert signatures on a pending consensus.

We were looking for the first instance of "directory-signature "
when instead the correct behavior is to look for the first instance
of "directory-signature " at the start of a line.

Unfortunately, this can be exploited as to crash authorities while
they're voting.

Fixes #40316; bugfix on 0.2.2.4-alpha.  This is TROVE-2021-002,
also tracked as CVE-2021-28090.

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Mon, 15 Mar 2021 12:54:00 +0000 (08:54 -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 [Mon, 15 Mar 2021 12:54:00 +0000 (08:54 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoClarify new intended strategy with TROVE-2021-001
Nick Mathewson [Mon, 15 Mar 2021 12:53:36 +0000 (08:53 -0400)] 
Clarify new intended strategy with TROVE-2021-001

We're going to disable this feature in all versions for now.

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Mon, 15 Mar 2021 12:52:29 +0000 (08:52 -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 [Mon, 15 Mar 2021 12:52:28 +0000 (08:52 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoMerge branch 'bug40286_disable_min_035' into maint-0.3.5
Nick Mathewson [Mon, 15 Mar 2021 12:41:03 +0000 (08:41 -0400)] 
Merge branch 'bug40286_disable_min_035' into maint-0.3.5

4 years agoBump to 0.4.5.7
Nick Mathewson [Mon, 15 Mar 2021 11:41:54 +0000 (07:41 -0400)] 
Bump to 0.4.5.7

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Mon, 15 Mar 2021 11:40:56 +0000 (07:40 -0400)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

"ours" to avoid version bump.

4 years agoBump to 0.4.4.8
Nick Mathewson [Mon, 15 Mar 2021 11:40:48 +0000 (07:40 -0400)] 
Bump to 0.4.4.8

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
Nick Mathewson [Mon, 15 Mar 2021 11:40:06 +0000 (07:40 -0400)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

"ours" to avoid version bump.

4 years agoBump to 0.3.5.14
Nick Mathewson [Mon, 15 Mar 2021 11:39:45 +0000 (07:39 -0400)] 
Bump to 0.3.5.14

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Fri, 12 Mar 2021 16:36:34 +0000 (11:36 -0500)] 
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, 12 Mar 2021 16:36:34 +0000 (11:36 -0500)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoRemove maxmind license; add ipfire location database license (cc by-sa 4.0)
Nick Mathewson [Fri, 12 Mar 2021 16:36:28 +0000 (11:36 -0500)] 
Remove maxmind license; add ipfire location database license (cc by-sa 4.0)

4 years agoUse the right ticket number.
Nick Mathewson [Fri, 12 Mar 2021 16:31:36 +0000 (11:31 -0500)] 
Use the right ticket number.

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Nick Mathewson [Fri, 12 Mar 2021 16:30:22 +0000 (11:30 -0500)] 
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, 12 Mar 2021 16:30:21 +0000 (11:30 -0500)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoupdate geoip-2021-03-12 to mention provider transition.
Nick Mathewson [Fri, 12 Mar 2021 16:29:09 +0000 (11:29 -0500)] 
update geoip-2021-03-12 to mention provider transition.

4 years agoUpdate geoip files to match ipfire location db, 2021/03/12.
Nick Mathewson [Fri, 12 Mar 2021 16:26:07 +0000 (11:26 -0500)] 
Update geoip files to match ipfire location db, 2021/03/12.

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/335' into maint-0.4.5
Nick Mathewson [Wed, 10 Mar 2021 20:27:50 +0000 (15:27 -0500)] 
Merge remote-tracking branch 'tor-gitlab/mr/335' into maint-0.4.5

4 years agoMerge branch 'tor-gitlab/mr/331' into maint-0.4.5
David Goulet [Wed, 10 Mar 2021 15:06:44 +0000 (10:06 -0500)] 
Merge branch 'tor-gitlab/mr/331' into maint-0.4.5

4 years agohs: Remove hamrless BUG() that can happen
David Goulet [Wed, 10 Mar 2021 14:12:29 +0000 (09:12 -0500)] 
hs: Remove hamrless BUG() that can happen

When reloading a service, we can re-register a service and thus end up again
in the metrics store initialization code path which is fine. No need to BUG()
anymore.

Fixes #40334

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoDon't warn about missing guard state if controller picked first hop
Nick Mathewson [Mon, 8 Mar 2021 18:41:20 +0000 (13:41 -0500)] 
Don't warn about missing guard state if controller picked first hop

See comments about why this needs a new flag and we can't just use
CIRCUIT_PURPOSE_CONTROLLER.

Fixes #40285; bugfix on 0.3.2.1-alpha.

4 years agoFix documentation formatting for VirtualAddrNetworkIPv6
Nick Mathewson [Mon, 8 Mar 2021 16:15:37 +0000 (11:15 -0500)] 
Fix documentation formatting for VirtualAddrNetworkIPv6

Fixes bug #40256; bugfix on 0.2.9.4-alpha.

4 years agoFix parsing bug in linux get_total_system_memory().
Nick Mathewson [Wed, 3 Mar 2021 19:52:15 +0000 (14:52 -0500)] 
Fix parsing bug in linux get_total_system_memory().

Use find_str_at_start_of_line(), not strstr() here: we don't want
to match "MemTotal: " if it appears in the middle of a line.

Fixes #40315; bugfix on 0.2.5.4-alpha.

4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
David Goulet [Mon, 1 Mar 2021 13:33:47 +0000 (08:33 -0500)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoMerge branch 'maint-0.3.5' into maint-0.4.4
David Goulet [Mon, 1 Mar 2021 13:33:41 +0000 (08:33 -0500)] 
Merge branch 'maint-0.3.5' into maint-0.4.4

4 years agoMerge branch 'tor-gitlab/mr/321' into maint-0.4.5
David Goulet [Wed, 24 Feb 2021 18:55:21 +0000 (13:55 -0500)] 
Merge branch 'tor-gitlab/mr/321' into maint-0.4.5

4 years agoMerge branch 'tor-gitlab/mr/326' into maint-0.4.5
David Goulet [Tue, 23 Feb 2021 17:27:59 +0000 (12:27 -0500)] 
Merge branch 'tor-gitlab/mr/326' into maint-0.4.5

4 years agoRemove mallinfo() from codebase
David Goulet [Tue, 23 Feb 2021 16:02:33 +0000 (11:02 -0500)] 
Remove mallinfo() from codebase

Now deprecated in libc >= 2.33

Closes #40309

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoRemove mallinfo() from codebase
David Goulet [Tue, 23 Feb 2021 16:02:33 +0000 (11:02 -0500)] 
Remove mallinfo() from codebase

Now deprecated in libc >= 2.33

Closes #40309

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Avoid a directory early fetch
David Goulet [Tue, 23 Feb 2021 14:37:17 +0000 (09:37 -0500)] 
relay: Avoid a directory early fetch

The directory_fetches_from_authorities() is used to know if a client or relay
should fetch data from an authority early in the boot process.

We had a condition in that function that made a relay trigger that fetch if it
didn't know its address (so we can learn it). However, when this is called,
the address discovery has not been done yet so it would always return true for
a relay.

Furthermore, it would always trigger a log notice that the IPv4 couldn't be
found which was inevitable because the address discovery process has not been
done yet (done when building our first descriptor).

It is also important to point out that starting in 0.4.5.1-alpha, asking an
authority for an address is done during address discovery time using a one-hop
circuit thus independent from the relay deciding to fetch or not documents
from an authority.

Small fix also is to reverse the "IPv(4|6)Only" flag in the notice so that if
we can't find IPv6 it would output to use IPv4Only.

Fixes #40300

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge remote-tracking branch 'tor-gitlab/mr/316' into maint-0.4.5
Nick Mathewson [Mon, 22 Feb 2021 20:37:31 +0000 (15:37 -0500)] 
Merge remote-tracking branch 'tor-gitlab/mr/316' into maint-0.4.5

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/309' into maint-0.4.5
Alexander Færøy [Mon, 22 Feb 2021 19:12:53 +0000 (19:12 +0000)] 
Merge remote-tracking branch 'tor-gitlab/mr/309' into maint-0.4.5

4 years agorelay: Move log notice after suggested address lookup
David Goulet [Mon, 22 Feb 2021 14:13:54 +0000 (09:13 -0500)] 
relay: Move log notice after suggested address lookup

When trying to find our address to publish, we would log notice if we couldn't
find it from the cache but then we would look at the suggested cache (which
contains the address from the authorities) in which we might actually have the
address.

Thus that log notice was misplaced. Move it down after the suggested address
cache lookup.

Closes #40300

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoDisable the dump_desc() function.
Nick Mathewson [Fri, 19 Feb 2021 17:31:19 +0000 (12:31 -0500)] 
Disable the dump_desc() function.

It can be called with strings that should have been
length-delimited, but which in fact are not.  This can cause a
CPU-DoS bug or, in a worse case, a crash.

Since this function isn't essential, the best solution for older
Tors is to just turn it off.

Fixes bug 40286; bugfix on 0.2.2.1-alpha when dump_desc() was
introduced.

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/308' into maint-0.4.5
George Kadianakis [Fri, 19 Feb 2021 11:26:33 +0000 (13:26 +0200)] 
Merge remote-tracking branch 'tor-gitlab/mr/308' into maint-0.4.5

4 years agoMake our configure.ac script use the portable `=` comparison
Nick Mathewson [Wed, 17 Feb 2021 17:36:23 +0000 (12:36 -0500)] 
Make our configure.ac script use the portable `=` comparison

Back in 0.4.5.1-alpha we added an `==` comparison, which isn't
portable.

Fixes bug #40298; bugfix on 0.4.5.1-alpha.

4 years agorelay: No longer test dirport reachability for authorities
Roger Dingledine [Wed, 10 Feb 2021 08:10:12 +0000 (03:10 -0500)] 
relay: No longer test dirport reachability for authorities

Now that exit relays don't allow exit connections to directory authority
DirPorts, the follow-up step is to make directory authorities stop doing
DirPort reachability checks.

Fixes #40287

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agometrics: Handle the connection finished flushing event
David Goulet [Wed, 17 Feb 2021 14:54:05 +0000 (09:54 -0500)] 
metrics: Handle the connection finished flushing event

Turns out, we forgot to add the METRICS connection type fo the finished
flushing handler.

Fixes #40295

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoBump to 0.4.5.6-dev
Nick Mathewson [Mon, 15 Feb 2021 18:00:14 +0000 (13:00 -0500)] 
Bump to 0.4.5.6-dev

4 years agoBump to 0.4.5.6.
Nick Mathewson [Mon, 15 Feb 2021 14:55:09 +0000 (09:55 -0500)] 
Bump to 0.4.5.6.

4 years agoMerge branch 'tor-gitlab/mr/304' into maint-0.4.5
David Goulet [Fri, 12 Feb 2021 18:13:50 +0000 (13:13 -0500)] 
Merge branch 'tor-gitlab/mr/304' into maint-0.4.5

4 years agotest: Fix duplicate ORPort test
David Goulet [Thu, 11 Feb 2021 21:32:17 +0000 (16:32 -0500)] 
test: Fix duplicate ORPort test

The comment of that specific unit test wanted 4 ORPorts but for some reasons
we tested for 3 which before the previous commit related to #40289, test would
pass but it was in fact wrong.

Now the code is correct and 4 was in fact correct expected number of ports.

Related to #40289

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoconfig: Do not compare for duplicate ORPorts with different addresses
David Goulet [Thu, 11 Feb 2021 21:14:56 +0000 (16:14 -0500)] 
config: Do not compare for duplicate ORPorts with different addresses

We were just looking at the family which is not correct because it is possible
to have two explicit ORPort for the same family but different addresses. One
example is:

  ORPort 127.0.0.1:9001 NoAdvertise
  ORPort 1.2.3.4:9001 NoListen

Thus, this patch now ignores ports that have different addresses iff they are
both explicits. That is, if we have this example, also two different
addresses:

  ORPort 9001
  ORPort 127.0.0.1:9001 NoAdvertise

The first one is implicit and second one is explicit and thus we have to
consider them for removal which in this case would remove the "ORPort 9001" in
favor of the second port.

Fixes #40289

Signe-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'tor-gitlab/mr/302' into maint-0.4.5
David Goulet [Fri, 12 Feb 2021 17:56:15 +0000 (12:56 -0500)] 
Merge branch 'tor-gitlab/mr/302' into maint-0.4.5

4 years agoMerge branch 'tor-gitlab/mr/303' into maint-0.4.5
David Goulet [Fri, 12 Feb 2021 17:54:52 +0000 (12:54 -0500)] 
Merge branch 'tor-gitlab/mr/303' into maint-0.4.5

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/293' into maint-0.4.5
Alexander Færøy [Fri, 12 Feb 2021 15:23:02 +0000 (15:23 +0000)] 
Merge remote-tracking branch 'tor-gitlab/mr/293' into maint-0.4.5

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/294' into maint-0.4.5
George Kadianakis [Fri, 12 Feb 2021 11:53:45 +0000 (13:53 +0200)] 
Merge remote-tracking branch 'tor-gitlab/mr/294' into maint-0.4.5

4 years agoMerge remote-tracking branch 'tor-gitlab/mr/295' into maint-0.4.5
George Kadianakis [Fri, 12 Feb 2021 11:44:03 +0000 (13:44 +0200)] 
Merge remote-tracking branch 'tor-gitlab/mr/295' into maint-0.4.5

4 years agoconfig: Set flag for implicit port address
David Goulet [Thu, 11 Feb 2021 21:12:59 +0000 (16:12 -0500)] 
config: Set flag for implicit port address

Fun bug where we thought we were using the default "false" value when an
implicit address was detected but if we had an explicit address before, the
flag was set to true and then we would only use that value.

And thus, for some configurations, implicit addresses would be flagged as
explicit and then configuring ports goes bad.

Related to #40289

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Allow RFC1918 addresses for non public relays
David Goulet [Wed, 10 Feb 2021 16:46:32 +0000 (11:46 -0500)] 
relay: Allow RFC1918 addresses for non public relays

In other words, if PublishServerDescriptor is set to 0 and AssumeReachable to
1, then allow a relay to hold a RFC1918 address.

Reasons for this are documented in #40208

Fixes #40208

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agorelay: Don't look at omit flag when building descriptor
David Goulet [Wed, 10 Feb 2021 16:06:52 +0000 (11:06 -0500)] 
relay: Don't look at omit flag when building descriptor

That comes from 685c4866acf8489c58aca41ec01aa5a53e39220a which added that
check correctly except for when we build a descriptor.

We already omit the IPv6 address, if we need to, when we encode the descriptor
but we need to keep the actual discovered address in the descriptor so we can
notice future IP changes and be able to assess that we are not publishable as
long as we don't specifically set the omit flag.

This lead to also having tor noticing that our IP changed from <nothing> (no
IPv6 in the descriptor) to a discovered one which would trigger every minute.

Fixes #40279, #40288

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge remote-tracking branch 'tor-gitlab/mr/296' into maint-0.4.5
Nick Mathewson [Mon, 8 Feb 2021 19:30:11 +0000 (14:30 -0500)] 
Merge remote-tracking branch 'tor-gitlab/mr/296' into maint-0.4.5

4 years agoconn: Properly close MetricsPort socket on EOF
David Goulet [Wed, 27 Jan 2021 14:34:34 +0000 (09:34 -0500)] 
conn: Properly close MetricsPort socket on EOF

Handle the EOF situation for a metrics connection. Furthermore, if we failed
to fetch the data from the inbuf properly, mark the socket as closed because
the caller, connection_process_inbuf(), assumes that we did so on error.

Fixes #40257

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoDon't log supported-protover warnings if consensus is older than Tor.
Nick Mathewson [Mon, 8 Feb 2021 16:52:53 +0000 (11:52 -0500)] 
Don't log supported-protover warnings if consensus is older than Tor.

Previously we would warn in this case... but there's really no
justification for doing so, and it can only cause confusion.

Fixes bug #40281; bugfix on 0.4.0.1-alpha.

4 years agorelay: Look at the omit IPv6 flag when publishing
David Goulet [Mon, 8 Feb 2021 16:51:45 +0000 (11:51 -0500)] 
relay: Look at the omit IPv6 flag when publishing

In two instances we must look at this flag:

1. When we build the descriptor so the IPv6 is NOT added to the descriptor in
   case we judge that we need to omit the address but still publish.

2. When we are deciding if the descriptor is publishable. This flags tells us
   that the IPv6 was not found reachable but we should still publish.

Fixes #40279

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoRemove DirCache=1 from list of supported versions.
Nick Mathewson [Mon, 8 Feb 2021 16:40:35 +0000 (11:40 -0500)] 
Remove DirCache=1 from list of supported versions.

Closes #40221

4 years agorelay: Fix Coverity warning for unchecked returned value
David Goulet [Mon, 8 Feb 2021 16:09:29 +0000 (11:09 -0500)] 
relay: Fix Coverity warning for unchecked returned value

Signed-off-by: David Goulet <dgoulet@torproject.org>
4 years agoMerge branch 'maint-0.4.4' into maint-0.4.5
Alexander Færøy [Fri, 5 Feb 2021 19:18:47 +0000 (19:18 +0000)] 
Merge branch 'maint-0.4.4' into maint-0.4.5

4 years agoDelete changes/40241_v2 as it breaks CI.
Alexander Færøy [Fri, 5 Feb 2021 19:18:13 +0000 (19:18 +0000)] 
Delete changes/40241_v2 as it breaks CI.

Unreviewed build fix. Discussed the cnage on IRC with Nick.