]>
git.ipfire.org Git - thirdparty/tor.git/log
teor [Thu, 30 Apr 2020 12:22:09 +0000 (22:22 +1000)]
Merge branch 'pr1870_squashed'
Neel Chauhan [Sun, 26 Apr 2020 20:06:11 +0000 (13:06 -0700)]
Define and use TOR_ADDRPORT_BUF_LEN
teor [Thu, 30 Apr 2020 03:55:26 +0000 (13:55 +1000)]
practracker: Accept the connection buf refactor
Accept a few extra lines from the connection_buf_read_from_socket()
refactor.
Cleanup after 33131.
teor [Thu, 30 Apr 2020 03:54:40 +0000 (13:54 +1000)]
relay: Fix a comment typo in the selftest.c header
Nick Mathewson [Wed, 29 Apr 2020 23:16:40 +0000 (19:16 -0400)]
Merge remote-tracking branch 'tor-github/pr/1864/head'
teor [Wed, 29 Apr 2020 20:52:43 +0000 (06:52 +1000)]
practracker: Allow an extra line in tor_addr_parse_mask_ports()
We added a cast, and wrapped a line.
teor [Wed, 29 Apr 2020 20:47:46 +0000 (06:47 +1000)]
relay: Refactor can extend over IPv6 checks
Split "can extend over IPv6" and "has advertised IPv6 ORPort" into
separate functions. They currently have the same result, but this may
change in 33818 with ExtendAllowIPv6Addresses.
Part of 33817.
teor [Wed, 29 Apr 2020 20:31:05 +0000 (06:31 +1000)]
channel: Refactor matches target address function
Refactor channel_matches_target_addr_for_extend() to return a boolean
result.
Part of 33817.
teor [Wed, 29 Apr 2020 20:26:40 +0000 (06:26 +1000)]
relay: Refactor extend address validity function
Rename the function, and give it a boolean return value.
No behaviour change.
Part of 33817.
teor [Wed, 29 Apr 2020 20:17:18 +0000 (06:17 +1000)]
net: Make all address bytes functions take uint8_t *
Part of 33817.
teor [Wed, 29 Apr 2020 19:54:39 +0000 (05:54 +1000)]
Rename tor_addr_get_ipv6_bytes to tor_addr_copy_ipv6_bytes
This is an automated commit, generated by this command:
./scripts/maint/rename_c_identifier.py \
tor_addr_get_ipv6_bytes tor_addr_copy_ipv6_bytes
teor [Wed, 15 Apr 2020 10:03:22 +0000 (20:03 +1000)]
changes: file for 33817
teor [Wed, 29 Apr 2020 11:37:31 +0000 (21:37 +1000)]
relay: Refactor choosing extend IPs
Flatten the logic in circuit_choose_ip_ap_for_extend().
Part of 33817.
teor [Wed, 29 Apr 2020 11:25:10 +0000 (21:25 +1000)]
relay: Add tests for choosing extend IPs
Part of 33817.
teor [Wed, 29 Apr 2020 10:29:15 +0000 (20:29 +1000)]
relay: Refactor circuit_open_connection_for_extend()
Refactor circuit_open_connection_for_extend(), splitting out the IP
address choice code into a new function.
Adds unit tests. No behaviour changes in tor.
Part of 33817.
teor [Wed, 29 Apr 2020 10:10:14 +0000 (20:10 +1000)]
relay: Add IP version tests for circuit extends
Add IPv4-only and IPv6-only tests for
circuit_open_connection_for_extend().
Part of 33817.
teor [Wed, 29 Apr 2020 05:56:40 +0000 (15:56 +1000)]
relay: Choose between IPv4 and IPv6 extends at random
When an EXTEND2 cell has an IPv4 and an IPv6 address, choose one of them
uniformly at random.
Part of 33817.
teor [Wed, 15 Apr 2020 22:13:02 +0000 (08:13 +1000)]
relay/circuitbuild: Refactor open connection for extend
Re-use the newly created extend_info to launch the connection in
circuit_open_connection_for_extend().
No behaviour change.
Part of 33817.
teor [Wed, 15 Apr 2020 09:07:58 +0000 (19:07 +1000)]
test/circuitbuild: Disable some tests when ALL_BUGS_ARE_FATAL
Some tests use IF_BUG_ONCE(), which is fatal when ALL_BUGS_ARE_FATAL,
after the fixes in 33917.
Also run "make autostyle" on these changes.
Part of 33817.
teor [Wed, 15 Apr 2020 07:45:29 +0000 (17:45 +1000)]
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.
teor [Wed, 15 Apr 2020 03:04:33 +0000 (13:04 +1000)]
relay/circuitbuild: Re-use IPv6 connections for circuits
Search for existing connections using the remote IPv4 and IPv6
addresses.
Part of 33817.
teor [Wed, 15 Apr 2020 03:07:10 +0000 (13:07 +1000)]
relay/circuitbuild: Report IPv6 addresses in a debug log
Part of 33817.
teor [Wed, 15 Apr 2020 02:08:46 +0000 (12:08 +1000)]
channel: Make channel_matches_target_addr_for_extend() static
It isn't used outside channel.c.
Part of 33817.
teor [Wed, 15 Apr 2020 01:34:12 +0000 (11:34 +1000)]
relay/circuitbuild: Consider IPv6-only extends valid
Allow extend cells with IPv6-only link specifiers.
Warn and fail if both IPv4 and IPv6 are invalid.
Also warn if the IPv4 or IPv6 addresses are unexpectedly internal,
but continue with the valid address.
Part of 33817.
teor [Wed, 15 Apr 2020 00:07:26 +0000 (10:07 +1000)]
test/circuitbuild: Show bad addresses in some logs
Disable SafeLogging for some extend tests, so we can check the actual
addresses.
Part of 33817.
teor [Tue, 14 Apr 2020 23:55:09 +0000 (09:55 +1000)]
relay: Log the address in circuit protocol warnings
Always log the address family in extend protocol warnings.
If SafeLogging is 0, also log the address and port.
Diagnostics for 33817.
teor [Tue, 14 Apr 2020 23:52:57 +0000 (09:52 +1000)]
net: Add fmt_addrport_ap() and fmt_addr_family()
Add fmt_addrport_ap(), a macro that takes a tor_addr_port_t, and uses
it to call fmt_addrport().
Add fmt_addr_family(), a function that returns a string constant
describing the address family.
Utility functions for 33817.
teor [Tue, 14 Apr 2020 23:52:25 +0000 (09:52 +1000)]
net: Remove an extra space in address.h
teor [Tue, 14 Apr 2020 23:13:16 +0000 (09:13 +1000)]
relay: Refactor address checks into a function
No behaviour change.
Part of 33817.
teor [Tue, 14 Apr 2020 22:58:32 +0000 (08:58 +1000)]
relay: Refactor address and port checks
tor_addr_port_is_valid_ap(ap, 0) checks if the address or port are
zero, exactly like the previous code.
Preparation for 33817.
teor [Tue, 14 Apr 2020 05:53:17 +0000 (15:53 +1000)]
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.
teor [Tue, 14 Apr 2020 08:44:06 +0000 (18:44 +1000)]
test/cell_formats: Expand the IPv6-only EXTEND2 test
Part of 33901.
teor [Tue, 14 Apr 2020 05:08:42 +0000 (15:08 +1000)]
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.
Nick Mathewson [Wed, 29 Apr 2020 12:32:44 +0000 (08:32 -0400)]
Merge remote-tracking branch 'tor-github/pr/1868/head'
teor [Wed, 29 Apr 2020 12:07:35 +0000 (22:07 +1000)]
Run "make autostyle"
teor [Wed, 29 Apr 2020 05:57:44 +0000 (15:57 +1000)]
rand: Clarify the crypto_rand_uint() range
teor [Wed, 29 Apr 2020 05:53:27 +0000 (15:53 +1000)]
nodelist: Remove an outdated comment
Part of 33817.
teor [Tue, 28 Apr 2020 11:11:10 +0000 (21:11 +1000)]
channeltls: Clarify a relay impersonation defence
Clarify the comments in channel_tls_matches_target_method(), and make
it clear that the attack is a covert attack.
Nick Mathewson [Fri, 24 Apr 2020 12:15:53 +0000 (08:15 -0400)]
Merge remote-tracking branch 'onionk/inbufoverflow1-043' into ticket33131_044
Nick Mathewson [Fri, 24 Apr 2020 12:14:59 +0000 (08:14 -0400)]
Merge remote-tracking branch 'tor-github/pr/1862/head'
Nick Mathewson [Tue, 21 Apr 2020 16:22:37 +0000 (12:22 -0400)]
Merge branch 'maint-0.4.3'
teor [Wed, 15 Apr 2020 03:06:01 +0000 (13:06 +1000)]
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.
teor [Wed, 15 Apr 2020 09:45:56 +0000 (19:45 +1000)]
test/channel: Fix a comment typo
Nick Mathewson [Tue, 14 Apr 2020 15:52:00 +0000 (11:52 -0400)]
Merge remote-tracking branch 'tor-github/pr/1860/head'
teor [Tue, 14 Apr 2020 05:42:52 +0000 (15:42 +1000)]
Run practracker regen
Lock-in improvements.
Accept some small function size increases.
Allow a small amount of extra file size increase.
teor [Tue, 14 Apr 2020 04:55:37 +0000 (14:55 +1000)]
core/or: Update file comment in connection_or.c
Fix a typo, and say "v3 (and later) handshake".
Comment-only change.
teor [Tue, 14 Apr 2020 02:21:49 +0000 (12:21 +1000)]
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.
teor [Tue, 14 Apr 2020 02:16:48 +0000 (12:16 +1000)]
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.
teor [Tue, 14 Apr 2020 00:37:20 +0000 (10:37 +1000)]
core/or: Remove unused function prototype
Remove the unused function prototype for connection_or_get_for_extend().
There is no function implementation.
Part of 33817.
Nick Mathewson [Mon, 13 Apr 2020 21:02:38 +0000 (17:02 -0400)]
Merge branch 'maint-0.4.3'
"ours" to avoid version bump.
Nick Mathewson [Mon, 13 Apr 2020 21:02:20 +0000 (17:02 -0400)]
bump to 0.4.3.4-rc-dev
Nick Mathewson [Mon, 13 Apr 2020 21:01:35 +0000 (17:01 -0400)]
copy 0.4.3.4-rc changelog forward.
Nick Mathewson [Mon, 13 Apr 2020 18:14:41 +0000 (14:14 -0400)]
Merge branch 'maint-0.4.3'
Nick Mathewson [Mon, 13 Apr 2020 18:13:44 +0000 (14:13 -0400)]
Merge branch 'bug33545_043_squashed' into maint-0.4.3
George Kadianakis [Mon, 30 Mar 2020 13:33:30 +0000 (16:33 +0300)]
hs-v3: Change all-zeroes hard-assert to a BUG-and-err.
And also disallow all-zeroes keys from the filesystem; add a test for it too.
George Kadianakis [Mon, 30 Mar 2020 13:09:52 +0000 (16:09 +0300)]
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.
Neel Chauhan [Sun, 12 Apr 2020 19:43:21 +0000 (12:43 -0700)]
Fix typo in router_build_fresh_unsigned_routerinfo() comment
Nick Mathewson [Thu, 9 Apr 2020 15:50:20 +0000 (11:50 -0400)]
Merge remote-tracking branch 'tor-github/pr/1801/head'
Nick Mathewson [Thu, 9 Apr 2020 12:38:59 +0000 (08:38 -0400)]
Merge branch 'maint-0.4.3'
"ours" to avoid version bump
Nick Mathewson [Thu, 9 Apr 2020 12:38:41 +0000 (08:38 -0400)]
bump to 0.4.3.4-rc
Nick Mathewson [Thu, 9 Apr 2020 12:33:36 +0000 (08:33 -0400)]
Merge branch 'maint-0.4.3'
Nick Mathewson [Thu, 9 Apr 2020 12:33:11 +0000 (08:33 -0400)]
Add fsync to list of syscalls permitted by sandbox
(Our fix for 33087 requires this, I believe.)
Nick Mathewson [Thu, 9 Apr 2020 12:30:14 +0000 (08:30 -0400)]
Merge remote-tracking branch 'tor-github/pr/1723/head' into maint-0.4.3
Nick Mathewson [Thu, 9 Apr 2020 11:54:23 +0000 (07:54 -0400)]
Make sure that we free 'addr' at the end of a pair of addr tests
Fixes a couple of Coverity warnings about possible memory leaks.
Bug not in any released Tor.
David Goulet [Wed, 8 Apr 2020 13:58:17 +0000 (09:58 -0400)]
hs-v3: Several fixes after #32542 review
asn: Accidentally left this commit out when merging #32542, so cherry-picking
it now.
Signed-off-by: David Goulet <dgoulet@torproject.org>
teor [Thu, 9 Apr 2020 09:42:36 +0000 (19:42 +1000)]
Merge branch 'maint-0.4.3'
"ours" merge, because we only want to remove check-best-practices
from check-local in 0.4.2 and 0.4.3.
teor [Thu, 9 Apr 2020 09:41:19 +0000 (19:41 +1000)]
Merge branch 'maint-0.4.2' into maint-0.4.3
Remove check-best-practices from check-local in maint-0.4.3.
(The check-local jobs are all on separate lines in 0.4.3.)
Nick Mathewson [Wed, 19 Jun 2019 18:29:08 +0000 (14:29 -0400)]
remove practracker from check-local (0.4.2 and 0.4.3 only)
practracker shouldn't be running in release or maint branches.
teor [Thu, 9 Apr 2020 01:06:51 +0000 (11:06 +1000)]
Merge branch 'maint-0.4.3'
"ours" merge, to avoid taking PR 1854, which reverts
"Prefer IPv6 by default" for 0.4.3 only.
teor [Thu, 9 Apr 2020 01:05:59 +0000 (11:05 +1000)]
Merge branch 'pr1854_squashed' into maint-0.4.3
Squashed PR 1854, and fixed a minor typo (IPv4 -> IPv6).
David Goulet [Tue, 7 Apr 2020 13:04:01 +0000 (09:04 -0400)]
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>
teor [Thu, 9 Apr 2020 01:03:40 +0000 (11:03 +1000)]
Merge branch 'maint-0.4.3'
teor [Thu, 9 Apr 2020 01:03:34 +0000 (11:03 +1000)]
Merge branch 'maint-0.4.2' into maint-0.4.3
teor [Thu, 9 Apr 2020 01:03:27 +0000 (11:03 +1000)]
Merge branch 'maint-0.4.1' into maint-0.4.2
teor [Thu, 9 Apr 2020 01:03:20 +0000 (11:03 +1000)]
Merge branch 'maint-0.3.5' into maint-0.4.1
teor [Thu, 9 Apr 2020 01:02:49 +0000 (11:02 +1000)]
Merge remote-tracking branch 'tor-github/pr/1784' into maint-0.3.5
teor [Tue, 17 Mar 2020 07:45:49 +0000 (17:45 +1000)]
relay: Run practracker --regen
Lock in some file and function size improvements.
Accept some small file size and dependency increases.
Part of 33633.
teor [Tue, 17 Mar 2020 07:43:02 +0000 (17:43 +1000)]
relay: Run "make autostyle"
But only take the changes from the relay module.
Part of 33633.
teor [Tue, 7 Apr 2020 08:26:57 +0000 (18:26 +1000)]
test/circuitbuild: Add a test for onionskin_answer()
Part of 33633.
teor [Wed, 18 Mar 2020 09:15:14 +0000 (19:15 +1000)]
changes: file for 33633
teor [Mon, 6 Apr 2020 09:21:13 +0000 (19:21 +1000)]
relay/circuitbuild: Refactor circuit_extend()
Make the "else" case explicit at the end of the function.
Part of 33633.
teor [Mon, 6 Apr 2020 09:20:14 +0000 (19:20 +1000)]
test/circuitbuild: Add tests for circuit_extend()
Part of 33633.
teor [Mon, 6 Apr 2020 09:14:27 +0000 (19:14 +1000)]
core/or: Make some functions mockable
Preparation for testing circuit_extend().
Part of 33633.
teor [Mon, 6 Apr 2020 09:11:17 +0000 (19:11 +1000)]
channel: Rewrite the channel_get_for_extend() comments
Explain what the function does now.
Fix some typos.
Part of 33633.
teor [Fri, 3 Apr 2020 09:02:26 +0000 (19:02 +1000)]
test/circuitbuild: Add tests for open_connection_for_extend
Part of 33633.
teor [Fri, 3 Apr 2020 09:01:19 +0000 (19:01 +1000)]
circuitbuild: Make some functions mockable
Part of 33633.
teor [Fri, 3 Apr 2020 04:36:29 +0000 (14:36 +1000)]
test/circuitbuild: Add tests for extend_lspec_valid
Part of 33633.
teor [Fri, 3 Apr 2020 04:35:46 +0000 (14:35 +1000)]
test/circuitbuild: Make some tests fork
Since we're testing IF_BUG_ONCE(), we need to fork.
Part of 33633.
teor [Thu, 2 Apr 2020 03:39:17 +0000 (13:39 +1000)]
test/circuitbuild: Tests for adding
ed25519 keys
Add tests for circuit_extend_add_ed25519_helper().
Part of 33633.
teor [Thu, 2 Apr 2020 03:38:49 +0000 (13:38 +1000)]
nodelist: Make some functions mockable
Part of 33633.
teor [Wed, 1 Apr 2020 12:36:33 +0000 (22:36 +1000)]
test/circuitbuild: Add a test for extend_state_valid
Part of 33633.
teor [Wed, 1 Apr 2020 12:35:07 +0000 (22:35 +1000)]
test/circuitbuid: Fix new_route_len_unhandled_exit
Make test_new_route_len_unhandled_exit more robust, by always tearing
down logs. (Rather than just tearing them down on success.)
teor [Wed, 1 Apr 2020 11:14:51 +0000 (21:14 +1000)]
test/circuitbuild: Refactor test case array
Avoid repeating test names.
Part of 33633.
teor [Fri, 3 Apr 2020 04:31:45 +0000 (14:31 +1000)]
relay: End circuitbuild logs with "."
Consistent logs make testing easier.
Part of 33633.
teor [Wed, 1 Apr 2020 12:25:10 +0000 (22:25 +1000)]
relay: Check for NULL arguments in circuitbuild
Part of 33633.
teor [Wed, 1 Apr 2020 11:37:47 +0000 (21:37 +1000)]
relay: Make circuitbuild functions STATIC
Allow the circuitbuild_relay functions to be accessed by the unit tests.
Part of 33633.
teor [Wed, 18 Mar 2020 09:07:57 +0000 (19:07 +1000)]
relay: Remove a redundant function return value
Part of 33633.
teor [Wed, 18 Mar 2020 09:06:41 +0000 (19:06 +1000)]
relay: Split out opening a connection for an extend
Part of 33633.
teor [Wed, 18 Mar 2020 08:48:01 +0000 (18:48 +1000)]
relay: Refactor some long lines from circuit_extend()
Part of 33633.
teor [Wed, 18 Mar 2020 08:44:42 +0000 (18:44 +1000)]
relay: Split link specifier checks from circuit_extend()
Part of 33633.