Commit Graph

2299 Commits

Author SHA1 Message Date
David Goulet
93df26b11a dirvote: Fix memleak when computing consensus
Fixes #40966

Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-08-05 11:59:30 -04:00
David Goulet
d587ba01a7 bridge: Always put transport-info line
Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-06-18 15:15:32 -04:00
Alexander Færøy
3c8035b452 Add changes file for tpo/core/tor#11101. 2024-06-18 15:15:32 -04:00
Alexander Færøy
b4f8518f8f Add implementation and version metadata to bridge extra-info.
This patch adds two new keys to bridges' extra-info document:
"transport-version" and "transport-implementation".

These two new values always appear together (if one is missing, the
other one will be missing too) and is parsed from PT's STATUS
TYPE=version messages.

See: tpo/core/tor#11101.
2024-06-18 15:15:20 -04:00
Alexander Færøy
f459344488 Include "IMPLEMENTATION" parameter to STATUS TYPE=version PT messages. 2024-06-18 15:15:20 -04:00
Alexander Færøy
d27ce6b8f0 Drop requirement for TRANSPORT being present in STATUS messages. 2024-06-18 15:15:20 -04:00
Alexander Færøy
b6e260e699 Add support for PT STATUS TYPE=version messages.
This patch adds support for handling the version status message. Once we
receive such message, we add the given version string to the
managed_proxy_t instance. Note this value can be NULL and the value can
change throughout the lifetime of the PT as multiple status version
messages are handled.

See: tpo/core/tor#11101
2024-06-18 15:15:20 -04:00
David Goulet
bedc6a90d2 circuit: Remove log_warn triggered by a proto violation
Fixes #40932

Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-04-16 13:49:42 -04:00
David Goulet
269b4561a1 conflux: Avoid noting a cell was sent on a closed circuit
It turns out that circuit_package_relay_cell() returns 0 in order to drop a
cell but there is a code path, if the circuit queue is full, that also silently
closes the circuit and returns 0.

This lead to Conflux thinking a cell was sent but actually the cell was not and
the circuit was closed leading to the hard assert.

And so this function makes sure that circuit_package_relay_cell() and
append_cell_to_circuit_queue() returns a value that indicate what happened with
the cell and circuit so the caller can make an informed decision with it.

This change makes it that we do NOT enter the Conflux subsystem if the cell is
not queued on the circuit.

Fixes #40921

Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-04-15 14:24:45 -04:00
Sebastian Hahn
1abc9a3bd3 dirauth: Warn when failing to post during a vote
The only way to figure out that posting a vote or signatures to another
dirauth failed is by counting how many success messages there are on
notice level, and noticing that it is fewer than the number of
configured dirauths.

Closes #40910.
2024-02-01 10:34:30 +01:00
David Goulet
fbca1df9dd dirauth: Reject 0.4.7.x series at the authority level
Signed-off-by: David Goulet <dgoulet@torproject.org>
2024-01-30 10:56:16 -05:00
juga
56819b0a50 bwauth: Allow "node_id" KeyValue without "$"
Allow "node_id" KeyValue without the dollar sign at the start of the
hexdigit in the BandwidthFiles, in order to easier database queries
combining Tor documents in which the relays fingerprint doesn't
include it.
Bugfix on all supported versions of Tor.

Closes #40891
2024-01-30 10:47:13 -05:00
David Goulet
be751a46e3 Merge branch 'ticket40883_048_01' into maint-0.4.8 2023-11-09 09:14:19 -05:00
David Goulet
6df27ae953 Merge branch 'tor-gitlab/mr/778' into maint-0.4.8 2023-11-09 09:10:52 -05:00
David Goulet
83aecca561 hs: Always check if the hs_ident is available when processing a cell
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-11-08 11:17:48 -05:00
David Goulet
e62b8bce5a hs: Fix assert in hs_metrics_update_by_ident()
The hs_metrics_failed_rdv() macro could pass a NULL value for the identity key
when a building circuit would end up in a failure path *before* the "hs_ident"
was able to be set which leading to this assert.

This was introduced in 0.4.8.1-alpha with the addition of rendezvous circuit
failure metrics for the MetricsPort.

This fixes TROVE-2023-006 for which its severity is considered high.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-11-07 13:50:28 -05:00
David Goulet
24dc829b9a Merge branch 'maint-0.4.7' into maint-0.4.8 2023-11-03 09:04:27 -04:00
Alexander Færøy
7aa496a2e0 Fix TROVE-2023-004: Remote crash when compiled against OpenSSL
Fixes #40874

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-11-03 08:52:38 -04:00
Mike Perry
6bfadc7a5d Bug 40876: Extra logging 2023-11-01 19:57:08 +00:00
Mike Perry
d7f14a54fb Bug 40876: Don't reduce primary list for temporary restrictions 2023-11-01 19:57:07 +00:00
Nick Mathewson
8c22fd4a4d Fix the spelling of maxunmeasur(e)dbw.
This has been misspelled when using consensus method 31 or later
since 0.4.6.1-alpha.  Fixes bug 40869.

This commit is a backport of b9b0abd6c2 to 0.4.8.
2023-10-11 10:08:53 -04:00
David Goulet
2c8430cb2f Merge branch 'tor-gitlab/mr/759' into maint-0.4.8 2023-09-18 09:11:02 -04:00
David Goulet
fff805c7dd Merge branch 'maint-0.4.7' into maint-0.4.8 2023-09-14 15:34:25 -04:00
Mike Perry
ee0797bf0e Bug 40858: Cache sendme_inc to avoid purging intro points.
Bug found and fixed by @hyunsoo.kim676.
2023-09-14 19:16:06 +00:00
Alexander Færøy
87fb8b6417 Remove defensive assertion in relay_key_is_unavailable_().
This patch removes a call to `tor_assert_nonfatal_unreached()` in
`relay_key_is_unavailable_()` that is only called when Tor is compiled
without relay support.

Unfortunately, the non-fatal assertion causes a BUG log
message to appear for clients when they start up without relay support
for each CPU worker we spawn. This makes it spotting issues during
bootstrap harder particularly for our iOS developers.

Since the call sites to `get_master_identity_key()` handles `NULL`
values already, we do not think this will be an issue later on.

Reported by Benjamin Erhart (@tla) from Guardian Project.

Fixes tpo/core/tor#40848.
2023-09-12 16:42:35 +02:00
Nick Mathewson
d6c89b1ae1 Make networkstatus_getinfo_by_purpose report published_on again.
When we implemented prop275 in 0.4.8.1-alpha, we changed the
behavior of networkstatus_getinfo_helper_single to omit meaningful
published_on times, replacing them with "2038-01-01".  This is
necessary when we're formatting a routerstatus with no additional
info, since routerstatus objects no longer include a published_on.

But in networkstatus_getinfo_by_purpose, we do have a routerinfo
that does have a published_on.  This patch uses that information
to report published_on times in our output when we're making a
"virtual" networkstatus for a big file of routerinfo_t objects.
This is mostly important for bridge authorities, since when
they dump a secret list of the bridges, they want to include
published_on times.

Closes #40855. Bugfix on 0.4.8.1-alpha.
2023-09-12 08:46:31 -04:00
Micah Elizabeth Scott
3e18507dc7 Extend DoS protection to partially-open channels
tor only marks a channel as 'open' once the TLS and OR handshakes have both
completed, and normal "client" (ORPort) DoS protection is not enabled until
the channel becomes open. This patch adds an additional earlier initialization
path for DoS protection on incoming TLS connections.

This leaves the existing dos_new_client_conn() call sites intact, but adds a
guard against multiple-initialization using the existing
tracked_for_dos_mitigation flag. Other types of channels shouldn't be affected
by this patch.
2023-08-09 18:07:34 -07:00
Mike Perry
74d6fd534a Bug 40828: Add more log scrubbing to protocol warnings 2023-07-31 14:12:39 +00:00
David Goulet
28dfa07069 Merge branch 'maint-0.4.7' 2023-07-24 10:18:53 -04:00
David Goulet
d6fd7d1035 Fix all -Werror=enum-int-mismatch warnings
Close #40824

Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-07-24 09:44:42 -04:00
David Goulet
e6a9e00690 Merge branch 'warn-bridge-exit' into 'main'
Warn when operating as bridge and exit

Closes #40819

See merge request tpo/core/tor!730
2023-07-20 14:40:13 +00:00
trinity-1686a
1901720fb9
Warn when operating as bridge and exit 2023-07-17 19:40:26 +02:00
trinity-1686a
9ea80b465f
fix non-fatal assertion when rotate_onion_key fails 2023-07-16 22:29:23 +02:00
David Goulet
e4a8a128b1 Merge branch 'maint-0.4.7' 2023-07-12 08:17:23 -04:00
Roger Dingledine
3335829347 replace L2 vanguards that aren't Fast or Stable
Rotate to a new L2 vanguard whenever an existing one loses the
Stable or Fast flag. Previously, we would leave these relays in the
L2 vanguard list but never use them, and if all of our vanguards
end up like this we wouldn't have any middle nodes left to choose
from so we would fail to make onion-related circuits.

Fixes bug 40805; bugfix on 0.4.7.1-alpha.
2023-07-05 23:00:38 -04:00
David Goulet
8286d88ed0 Merge branch 'ticket40773' into 'main'
Fix compilation error on older gcc versions and MSVC.

See merge request tpo/core/tor!717
2023-06-19 18:32:44 +00:00
Neel Chauhan
a91315f931 Fix the spacing in the 'Your Tor identity key fingerprint is' log line' 2023-06-07 10:02:33 -07:00
Gabriela Moldovan
45ee8a10e2
Fix compilation error on older gcc versions and MSVC.
This fixes an "initializer is not a constant" compilation error that manifests
itself on gcc versions < 8.1 and MSVC (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69960#c18).

Fixes bug #40773

Signed-off-by: Gabriela Moldovan <gabi@torproject.org>
2023-06-05 15:03:39 +01:00
Micah Elizabeth Scott
415c0354b2 hs_pow: Add CompiledProofOfWorkHash torrc option
This exposes the new fallback behavior in hashx via a new AUTOBOOL
configuration option, available to both clients and services. The
default should be fine for nearly everyone, but it might be necessary
to enable or disable the compiler manually for diagnostic purposes.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-05-28 20:02:03 -07:00
Micah Elizabeth Scott
a397a92be2 hs_pow: Update for equix API to fix issue 40794
This change adapts the hs_pow layer and unit tests to API changes
in hashx and equix which modify the fault recovery responsibilities
and reporting behaivor.

This and the corresponding implementation changes in hashx and equix
form the fix for #40794, both solving the segfault and giving hashx a
way to report those failures up the call chain without them being
mistaken for a different error (unusable seed) that would warrant a
retry.

To handle these new late compiler failures with a minimum of fuss or
inefficiency, the failover is delegated to the internals of hashx and
tor needs only pass in a EQUIX_CTX_TRY_COMPILE flag to get the behavior
that tor was previously responsible for implementing.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-05-28 20:02:02 -07:00
friendly73
273227afe1 Forgot about the stub names 2023-05-25 11:03:35 -04:00
friendly73
3d5d8d59c1 Added relay prefix to new metrics functions 2023-05-25 11:03:35 -04:00
friendly73
7e57b9dbbf Fixed enum type not found in relay_stub 2023-05-25 11:03:35 -04:00
friendly73
5b76ce1843 Added void stubs for the relay metrics functions to fix building without relay module 2023-05-25 11:03:35 -04:00
friendly73
8cbfc90686 Fixed new arguments for metrics_store_add 2023-05-25 11:03:35 -04:00
friendly73
1899b6230d Removed getter abstraction and moved from rephist to relay_metrics. 2023-05-25 11:03:35 -04:00
friendly73
2f8a88448d Fixed est intro getter using wrong array 2023-05-25 11:03:35 -04:00
friendly73
24bc66f663 Fixed REND1 metric label value 2023-05-25 11:03:35 -04:00
friendly73
36076d3c46 Added INTRO and REND metrics for relay. 2023-05-25 11:03:35 -04:00
David Goulet
a1042f4873 Merge branch 'tor-gitlab/mr/443' 2023-05-25 10:50:15 -04:00