Commit Graph

9262 Commits

Author SHA1 Message Date
Nick Mathewson 49800cf539 Merge remote-tracking branch 'tor-github/pr/1864/head' 2020-04-29 19:16:40 -04:00
teor 528a1fe985 changes: file for 33817 2020-04-29 22:43:09 +10:00
teor 6c458d2d6e log/util_bug: Make IF_BUG_ONCE() support ALL_BUGS_ARE_FATAL
... and DISABLE_ASSERTS_IN_UNIT_TESTS.

Make all of tor's assertion macros support the ALL_BUGS_ARE_FATAL and
DISABLE_ASSERTS_IN_UNIT_TESTS debugging modes.

Implements these modes for IF_BUG_ONCE(). (It used to log a non-fatal
warning, regardless of the debugging mode.)

Fixes bug 33917; bugfix on 0.2.9.1-alpha.
2020-04-29 22:43:09 +10:00
teor 587a7fbcf6 core/or: Check extends for zero addresses and ports
Check for invalid zero IPv4 addresses and ports, when sending and
receiving extend cells.

Fixes bug 33900; bugfix on 0.2.4.8-alpha.
2020-04-29 22:43:09 +10:00
teor bd6ab90ad4 core/or: Support IPv6 EXTEND2 cells
Allow clients and relays to send dual-stack and IPv6-only EXTEND2 cells.
Parse dual-stack and IPv6-only EXTEND2 cells on relays.

Relays do not make connections or extend circuits via IPv6: that's the
next step.

Closes ticket 33901.
2020-04-29 22:43:09 +10:00
Nick Mathewson 4dd4dbf046 Merge remote-tracking branch 'onionk/inbufoverflow1-043' into ticket33131_044 2020-04-24 08:15:53 -04:00
Nick Mathewson 7f9eaec538 Merge remote-tracking branch 'tor-github/pr/1862/head' 2020-04-24 08:14:59 -04:00
Nick Mathewson b2849f449b Merge branch 'maint-0.4.3' 2020-04-21 12:22:37 -04:00
teor 42507429ce channeltls: Stop truncating IPv6 in logs
Stop truncating IPv6 addresses and ports in channel and connection logs.

Fixes bug 33918; bugfix on 0.2.4.4-alpha.
2020-04-21 12:22:30 -04:00
teor 8c55d34e0a core/or: Accurately log remote relay IPv6 addresses
Log IPv6 addresses on connections where this relay is the responder.

Previously, responding relays would replace the remote IPv6 address with
the IPv4 address from the consensus.

(The port is replaced with the IPv6 ORPort from the consensus, we will
resolve this issue in 33898.)

Fixes bug 33899; bugfix on 0.3.1.1-alpha.
2020-04-14 12:21:49 +10:00
teor 41fa07f751 core/or: Allow IPv6 connections to be canonical
Consider IPv6 addresses when checking if a connection is canonical.

In 17604, relays assumed that a remote relay could consider an IPv6
connection canonical, but did not set the canonical flag on their side
of the connection.

Fixes bug 33899; bugfix on 0.3.1.1-alpha.
2020-04-14 12:16:48 +10:00
Nick Mathewson e22a8d9c95 Merge branch 'maint-0.4.3' 2020-04-13 14:14:41 -04:00
Nick Mathewson 55cb6c3fcd Merge branch 'bug33545_043_squashed' into maint-0.4.3 2020-04-13 14:13:44 -04:00
George Kadianakis 37bcc9f3d2 hs-v3: Don't allow registration of an all-zeroes client auth key.
The client auth protocol allows attacker-controlled x25519 private keys being
passed around, which allows an attacker to potentially trigger the all-zeroes
assert for client_auth_sk in hs_descriptor.c:decrypt_descriptor_cookie().

We fixed that by making sure that an all-zeroes client auth key will not be
used.

There are no guidelines for validating x25519 private keys, and the assert was
there as a sanity check for code flow issues (we don't want to enter that
function with an unitialized key if client auth is being used). To avoid such
crashes in the future, we also changed the assert to a BUG-and-err.
2020-04-13 14:13:33 -04:00
Nick Mathewson 80031db32a Merge remote-tracking branch 'tor-github/pr/1801/head' 2020-04-09 11:50:20 -04:00
Nick Mathewson c2aea6134a Merge remote-tracking branch 'tor-github/pr/1723/head' into maint-0.4.3 2020-04-09 08:30:14 -04:00
teor f6efb3a184 Merge branch 'pr1854_squashed' into maint-0.4.3
Squashed PR 1854, and fixed a minor typo (IPv4 -> IPv6).
2020-04-09 11:05:59 +10:00
David Goulet cd2121a126 client: Revert setting PreferIPv6 on by default
This change broke torsocks that by default is expecting an IPv4 for hostname
resolution because it can't ask tor for a specific IP version with the SOCKS5
extension.

PreferIPv6 made it that sometimes the IPv6 could be returned to torsocks that
was expecting an IPv4.

Torsocks is probably a very unique case because the runtime flow is that it
hijacks DNS resolution (ex: getaddrinfo()), gets an IP and then sends it back
for the connect() to happen.

The libc has DNS resolution functions that allows the caller to request a
specific INET family but torsocks can't tell tor to resolve the hostname only
to an IPv4 or IPv6 and thus by default fallsback to IPv4.

Reverting this change into 0.4.3.x series but we'll keep it in the 0.4.4.x
series in the hope that we add this SOCKS5 extension to tor for DNS resolution
and then change torsocks to use that.

Fixes #33804

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-09 11:05:32 +10:00
teor 2d6f00e45b Merge branch 'maint-0.4.2' into maint-0.4.3 2020-04-09 11:03:34 +10:00
teor 2d7e08d57e Merge branch 'maint-0.4.1' into maint-0.4.2 2020-04-09 11:03:27 +10:00
teor 987f2fa50a Merge branch 'maint-0.3.5' into maint-0.4.1 2020-04-09 11:03:20 +10:00
teor d380acaeca Merge remote-tracking branch 'tor-github/pr/1784' into maint-0.3.5 2020-04-09 11:02:49 +10:00
teor aa560a5ade changes: file for 33633 2020-04-09 11:00:04 +10:00
George Kadianakis 7a82c972ef Merge branch 'tor-github/pr/1857' 2020-04-08 18:15:37 +03:00
David Goulet 92ae8cea30 changes: Add changes file for #32542
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-08 18:15:21 +03:00
George Kadianakis 0b0b8a5b6d Merge branch 'tor-github/pr/1855' 2020-04-08 16:31:37 +03:00
MrSquanchee cbd3f88831 Added tests for tor_addr_is_null/valid()
Added tests for tor_addr_is_valid(),
and added tests for tor_addr_is_null(),
which is not modfied.
Ticket 33679
2020-04-07 23:11:17 +05:30
David Goulet 6fbf624b50 hs-v3: Fix typo in log info when PublishHidServDescriptors is set to 0
Fixes #33779

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-07 13:17:21 -04:00
teor 065ccda4f6 Merge branch 'pr1838_squashed' 2020-04-07 17:36:17 +10:00
Nick Mathewson f9c57313d0 add changes file for 31634 2020-04-07 17:35:55 +10:00
teor a84fd949ed Merge branch 'maint-0.4.3' 2020-04-04 13:23:56 +10:00
teor b1e1c6b505 changes: file for ticket 33782
Avoid conflicts between the fake sockets in tor's unit tests, and real
file descriptors. Resolves issues running unit tests with GitHub
Actions, where the process that embeds or launches the tests has
already opened a large number of file descriptors.

Fixes bug 33782; bugfix on 0.2.8.1-alpha.

Found and fixed by Putta Khunchalee.
2020-04-04 13:20:06 +10:00
teor a8a92b9456 Merge branch 'maint-0.4.3' 2020-04-01 23:03:51 +10:00
David Goulet 6c5c503a4c configure: Fix enabled module variable expansion
Fixes #33646

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-04-01 23:02:24 +10:00
David Goulet ca8e6451f2 Merge branch 'maint-0.4.3' 2020-03-30 13:38:58 -04:00
George Kadianakis 42e56f5bac hs-v3: Relax severity of a log message when decoding descriptors.
Make it LOG_PROTOCOL_WARN and also add the expiration timestamp in there to
ease debugging in the future.
2020-03-30 13:38:29 -04:00
David Goulet ec8d41e699 changes: Add file for ticket 33014
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-03-30 13:36:54 -04:00
rl1987 9061303080 Put *.a wildcard entry into .gitignore instead of listing all .a files 2020-03-28 14:01:07 +02:00
David Goulet cf58b0b369 Merge branch 'maint-0.4.3' 2020-03-26 09:15:01 -04:00
David Goulet e472737297 Merge branch 'tor-github/pr/1794' into maint-0.4.3 2020-03-26 09:14:25 -04:00
Nick Mathewson 048714d2ce Merge branch 'maint-0.4.1' into maint-0.4.2 2020-03-25 10:56:27 -04:00
Nick Mathewson b2cda32693 Merge branch 'maint-0.4.3' 2020-03-25 10:56:27 -04:00
Nick Mathewson 03b0d1840a Merge branch 'maint-0.4.2' into maint-0.4.3 2020-03-25 10:56:27 -04:00
cypherpunks d3ded1cc1c Merge branch 'maint-0.4.3' 2020-03-24 05:51:12 +00:00
cypherpunks fd3e0c1542 core/mainloop: Limit growth of conn->inbuf
If the buf_t's length could potentially become greater than INT_MAX - 1,
it sets off an IF_BUG_ONCE in buf_read_from_tls().

All of the rest of the buffers.c code has similar BUG/asserts for this
invariant.
2020-03-24 05:19:24 +00:00
George Kadianakis a4d60ff854 Merge branch 'maint-0.4.3' 2020-03-23 16:57:27 +02:00
George Kadianakis 29420ab396 Merge branch 'tor-github/pr/1788' into maint-0.4.3 2020-03-23 16:56:59 +02:00
Nick Mathewson a0efba9bd0 Merge remote-tracking branch 'tor-github/pr/1797/head' 2020-03-23 09:05:45 -04:00
teor 4b914dea02 Merge branch 'bug32588_043' into bug32588_master 2020-03-21 04:02:08 +10:00
teor 52f61ec83e Merge branch 'bug32588_042' into bug32588_043
Merge static function declaration deletions from bug32588_042 and
maint-0.4.3 in app/config/config.c.
2020-03-21 04:01:00 +10:00