Commit Graph

26692 Commits

Author SHA1 Message Date
David Goulet
16351d655d sendme: Turn log warning into debug
When sending the stream level SENDME, it is possible the cirucit was marked
for close or any other failures that can occur. These events can occur
naturally.

Fixes #40142

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-17 13:23:34 -05:00
David Goulet
07006785fd Merge branch 'tor-gitlab/mr/203' into maint-0.4.5 2020-11-17 12:25:48 -05:00
David Goulet
d04a27bed2 config: Really ignore non ORPorts when removing duplicates
The function in charge of removing duplicate ORPorts from our configured ports
was skipping all non ORPorts port but only for the outer loop thus resulting
in comparing an ORPort with a non-ORPort which lead to problems.

For example, tor configured with the following would fail:

  ORPort auto
  DirPort auto

Both end up being the same configuration except that one is a OR listener and
one is a Dir listener. Thus because of the missing check in the inner loop,
they looked exactly the same and thus one is removed.

Fixes #40195

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-17 09:40:16 -05:00
Nick Mathewson
b13f32ee97 Merge branch 'ticket40071_045_01_squashed' into master 2020-11-17 07:58:37 -05:00
David Goulet
bc5f26ff70 relay: Launch dummy circuit only when descriptor build fails
First, this commit moves the launch_dummy_circuit_as_needed() function into
relay_find_addr.c and renames it to relay_addr_learn_from_dirauth(). This is
an attempt to centralize anything relate with address discovery in the right
module.

Second, when building a descriptor and we fail to discover our address,
immediately launch a dummy circuit to an authority in an attempt to learn our
descriptor.

It is still only done every 20 minutes even though the descriptor build is
done every minute. We ought to avoid load on the authority and if we can't
learn in the first place our address from them, chances are more things are
wrong.

Related to #40071

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-17 07:58:26 -05:00
David Goulet
a5538a3603 relay: Look at our cache when looking for an IP change
Regularly, tor looks if its IP has changed. It does the entire auto discovery
process again. However, it is possible that it does not find anything.

Instead of thinking the IP changed to an unknown address, look at our cache
and see if that value has changed.

The reason for this is because if tor gets its address as a suggestion from a
directory authority, it is because the auto discovery failed and thus that
address should be consider for the IP change check.

Related to #40071

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-17 07:58:26 -05:00
David Goulet
4b98140733 relay: Use testing circuit instead of dummy descriptor fetch
Tor now can learn its address from a NETINFO cell coming from an authority.
Thus, instead from launching a dummy descriptor fetch to learn the address
from the directory response (unauthenticated), we simply now launch a one-hop
testing circuit.

Related to #40071

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-17 07:58:26 -05:00
Nick Mathewson
41bea71adc Merge remote-tracking branch 'tor-gitlab/mr/197' into master 2020-11-16 22:43:09 -05:00
Nick Mathewson
c79957581e Merge branch 'maint-0.4.4' into master 2020-11-16 22:42:23 -05:00
Nick Mathewson
9001732394 Merge branch 'maint-0.4.3' into maint-0.4.4 2020-11-16 22:42:22 -05:00
Nick Mathewson
7c0778ef7e Merge branch 'maint-0.3.5' into maint-0.4.3 2020-11-16 22:42:22 -05:00
Nick Mathewson
fcae26adf7 Merge remote-tracking branch 'tor-gitlab/mr/195' into maint-0.3.5 2020-11-16 22:42:15 -05:00
David Goulet
d425dbf04a port: Don't ignore ports of a different family
Commit c3a0f75796 added this feature for ORPort
that we ignore any port that is not the family of our default address when
parsing the port. So if port_parse_config() was called with an IPv4 default
address, all IPv6 address would be ignored.

That makes sense for ORPort since we call twice port_parse_config() for
0.0.0.0 and [::] but for the rest of the ports, it is not good since a
perfectly valid configuration can be:

  SocksPort 9050
  SocksPort [::1]:9050

Any non-ORPort only binds by default to an IPv4 except the ORPort that binds
to both IPv4 and IPv6 by default.

The fix here is to always parse all ports within port_parse_config() and then,
specifically for ORPort, remove the duplicates or superseding ones. The
warning is only emitted when a port supersedes another.

A unit tests is added to make sure SocksPort of different family always exists
together.

Fixes #40183

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-13 08:38:22 -05:00
Neel Chauhan
46ccde66a9 Use connection_or_change_state() in v3 handshaking state change 2020-11-12 12:06:34 -05:00
Samanta Navarro
4a0cd79588 Fix typos.
Typos found with codespell.

Please keep in mind that this should have impact on actual code
and must be carefully evaluated:

src/core/or/lttng_circuit.inc
-    ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER)
+    ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-11-12 11:44:09 -05:00
Nick Mathewson
ffa7b15950 Deliberately close OR connections if proxies leave extra data
We already did this, but we did it by accident, which is pretty
risky: if we hadn't, then our code would have treated extra data in
the inbuf as having been transmitted as TLS-authenticated data.

Closes ticket 40017; Found by opara.
2020-11-12 11:07:33 -05:00
Nick Mathewson
f2168d28f7 Fake the current time when we're loading TEST_DESCRIPTORS.
Fixes bug 40187; bugfix on 0.4.5.1-alpha.
2020-11-12 09:28:27 -05:00
Nick Mathewson
7d8290f0ac Merge remote-tracking branch 'tor-gitlab/mr/183' into master 2020-11-12 08:47:05 -05:00
Nick Mathewson
3f1544bbd9 Bump to 0.4.4.6-dev 2020-11-12 08:13:07 -05:00
Nick Mathewson
fd22fa183b Bump to 0.4.3.7-dev 2020-11-12 08:12:11 -05:00
Nick Mathewson
862c44e4ec Bump to 0.3.5.12-dev 2020-11-12 08:11:01 -05:00
Nick Mathewson
210a94b231 Bump to 0.4.4.6 2020-11-09 17:13:02 -05:00
Nick Mathewson
6338c35e9d Bump to 0.4.3.7 2020-11-09 17:12:41 -05:00
Nick Mathewson
665083be9f Bump to 0.3.5.12 2020-11-09 17:12:18 -05:00
Nick Mathewson
ec0f000445 Merge branch 'maint-0.4.3' into maint-0.4.4 2020-11-09 16:17:42 -05:00
Nick Mathewson
0b2c64effd Merge branch 'maint-0.3.5' into maint-0.4.3 2020-11-09 16:13:42 -05:00
Nick Mathewson
52e439c13e Merge remote-tracking branch 'tor-gitlab/mr/189' into maint-0.3.5 2020-11-09 16:13:24 -05:00
Alexander Færøy
0702cf10db Merge remote-tracking branch 'tor-gitlab/mr/192' 2020-11-09 14:15:03 +00:00
Alexander Færøy
5e65a746aa Merge remote-tracking branch 'tor-gitlab/mr/190' 2020-11-09 14:12:45 +00:00
Nick Mathewson
b22568a545 Rename OpenSSL_version_num() as defined in Tor
This way, if we guess wrong about whether the library has it,
we don't conflict with the library's headers.

Fixes #40181; bug not in any released version.
2020-11-06 10:31:32 -05:00
Nick Mathewson
31a6a101a0 Handle a change in the implementation of hashlib in Python 3.9
Previously, hashlib.shake_256 was a class (if present); now it can
also be a function.  This change invalidated our old
compatibility/workaround code, and made one of our tests fail.

Fixes bug 40179; bugfix on 0.3.1.6-rc when the workaround code was
added.
2020-11-05 09:34:36 -05:00
George Kadianakis
dd119b277b Merge remote-tracking branch 'tor-gitlab/mr/185' into master 2020-11-03 16:06:12 +02:00
George Kadianakis
4f5a116618 Merge remote-tracking branch 'tor-gitlab/mr/187' into master 2020-11-03 13:04:09 +02:00
David Goulet
474369e3fa Merge branch 'tor-gitlab/mr/186' 2020-11-02 13:14:02 -05:00
David Goulet
8b240fbe40 Merge branch 'tor-gitlab/mr/188' 2020-11-02 13:09:15 -05:00
David Goulet
dc6438b549 or: Missing .inc file in include.am
Fixes #40173

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-11-02 08:25:48 -05:00
Nick Mathewson
7a75a1064f Fix another duplicate typedef.
Fixes #40177; bugfix on 0.4.5.1-alpha.
2020-11-02 07:15:10 -05:00
Nick Mathewson
aa85284038 Update to 0.4.5.1-alpha-dev 2020-11-01 16:41:56 -05:00
Daniel Pinto
f3b9be4422 Implement WIN32 tor_cond_wait using condition variables #30187
Fix bug where running a relay on Windows would use 100% CPU
after some time. Makes Windows >= Vista the required Windows
version to build and run tor.
2020-11-01 03:10:25 +00:00
Nick Mathewson
e01f586e05 Bump version to 0.4.5.1-alpha 2020-10-30 11:05:22 -04:00
Nick Mathewson
148b5b03a3 Merge branch 'bug40080_035' 2020-10-30 10:51:20 -04:00
George Kadianakis
54e6109499 Merge remote-tracking branch 'tor-gitlab/mr/174' into master 2020-10-30 14:14:14 +02:00
Nick Mathewson
df16376004 Fix duplicate typedef in metrics_store_entry.h
Fixes #40171. Bug not in any released Tor.
2020-10-28 16:36:14 -04:00
Nick Mathewson
f7d0bde4f0 Remove "GETINFO network-status".
It was deprecated 0.3.1.1-alpha.

According to #22473, nothing uses it.

Closes #22473.
2020-10-28 11:48:23 -04:00
Alexander Færøy
b0e6ec627c Merge branch 'maint-0.4.3' into maint-0.4.4 2020-10-28 15:39:37 +00:00
Alexander Færøy
4876409c2a Merge branch 'maint-0.3.5' into maint-0.4.3 2020-10-28 15:39:37 +00:00
Nick Mathewson
3f442987f1 Log a warning if Tor was built with any "risky" compile-time options
These options are meant for testing builds only, and are likely to
cause trouble if used in a production environment.

Closes #18888.
2020-10-28 11:34:30 -04:00
Alexander Færøy
c37d05d0c6 Merge remote-tracking branch 'tor-gitlab/mr/171' 2020-10-28 15:15:39 +00:00
Nick Mathewson
c48d25ac8d Fix a previously overstrict log message check.
OpenSSL doesn't seem to report error locations in the same way as
before, which broke one of our tests.

Fixes bug 40170; bugfix on 0.2.8.1-alpha.
2020-10-28 10:47:39 -04:00
Nick Mathewson
2b4a3d07b2 Do not define OPENSSL_VERSION in compat_openssl.h
Apparently it conflicts with definitions elsewhere in Openssl 3.0.0.
2020-10-28 10:32:06 -04:00