Nick Mathewson [Tue, 6 May 2025 00:38:55 +0000 (20:38 -0400)]
relay_msg: Document and enforce length invariants.
This takes a slightly different approach from suggested in the MR:
we document that a relay_msg_t must _always_ have a valid length,
and note that this warning still applies for relay_msg_copy.
Nick Mathewson [Fri, 18 Apr 2025 01:15:30 +0000 (21:15 -0400)]
Change relay_msg_t to _not_ hold a copy of the message.
Previously we had to memdup every time we parsed a relay_msg_t;
but that's unnecessary, since (most) every time we use it, we have
a longer-lived cell object.
This _did_ require some hacking in relay_msg_copy, but I think the
gain in simplicity is worth it.
Nick Mathewson [Fri, 18 Apr 2025 00:26:20 +0000 (20:26 -0400)]
Fix a bug in conflux_send_switch_command.
Using RELAY_PAYLOAD_SIZE(_MAX) here would send a relay message that used up
more than the actual length of the cell. Instead, send only the actual
CONFLUX_SWITCH message.
Nick Mathewson [Fri, 18 Apr 2025 00:21:06 +0000 (20:21 -0400)]
Rename and hand-audit all users of RELAY_PAYLOAD_SIZE.
Since the maximum number of bytes you can put in a relay message
is no longer constant, it doesn't make sense to have a "size" for this.
Instead, we can only have a "max" or "min" size.
Nick Mathewson [Thu, 17 Apr 2025 17:15:04 +0000 (13:15 -0400)]
prop359: Implement relay cell encoder/decoders
I decided not to use a codec-based approach here.
Since we aren't implementing prop340, there is exactly one cell
per message, so we don't need to keep any state
in between cells or messages.
orbea [Thu, 31 Aug 2023 21:35:52 +0000 (14:35 -0700)]
crypt_openssl_mgt: define DISABLE_ENGINES after OPENSSL_NO_ENGINE
With LibreSSL-3.8.1 these engines are no long available causing a build
failure, but LibreSSL correctly defines OPENSSL_NO_ENGINE as part of its
opensslfeatures.h. However Tor includes crypto_openssl_mgt.h before any
of the openssl includes which would define OPENSSL_NO_ENGINE and then
fails to define DISABLE_ENGINES.
As the define is used in only a single .c file it is best to move it
there.
Nick Mathewson [Sat, 26 Apr 2025 13:37:33 +0000 (09:37 -0400)]
Require OpenSSL >= 1.1.1 or LibreSSL >= 3.7
3.0 is the oldest supported version of OpenSSL; it was first released
in September 2021. OpenSSL 1.1.1 (the previous series) reached EOL in
September 2023, but it is still used in Debian oldstable, which will
be around till September 2026.
LibreSSL 3.7 is not quite supported, but I don't have as firm a conviction
about which LibreSSL versions we should handle. It was released in 2022.
Nick Mathewson [Fri, 25 Apr 2025 14:24:50 +0000 (10:24 -0400)]
Restore a pair of erroneously removed cases
The one in connection_or.c was crucial: it's the
thing that made OR negotiation actually work.
The one in channeltls.c was just defensive programming, but it's
valid defensive programming: by the time we enter from
channel_handle_var_cell, channel_tls_process_vesions_cell,
we have changed our state via enter_v3_handshake_with_cell.
Nick Mathewson [Thu, 24 Apr 2025 18:25:24 +0000 (14:25 -0400)]
Remove support for client cipher classification.
For a long time, clients would lie about the set of ciphersuites
they supported, in a misguided pre-pluggable-transport attempt
to avoid protocol identification.
Such clients are now long gone; clients stopped lying
about ciphersuites after 0.2.3.17-beta.
Nick Mathewson [Thu, 24 Apr 2025 18:06:12 +0000 (14:06 -0400)]
Completely remove support for the v2 link handshake
The v2 link handshake was one of the silliest things we ever did:
in an attempt to avoid sending our funny-looking certs back and forth,
we would first negotiate with a dummy set of certs and ciphers,
and then renegotiate with the ciphersuites we _really_ wanted.
We removed client-side support for this handshake back in
0.2.8.1-alpha, with ticket 11150.
Nick Mathewson [Thu, 24 Apr 2025 17:18:32 +0000 (13:18 -0400)]
Remove server support for the v1 link handshake.
In the v1 handshake we would send two very specialized certificates.
We'd identify that the client wanted to use this handshake by
the ciphers that it sent, or didn't sent.
We already removed client-side support for the v1 link handshake
back in 0.2.8.1-alpha, with ticket 11150.
David Goulet [Thu, 27 Mar 2025 12:49:40 +0000 (08:49 -0400)]
conflux: Avoid non fatal assert in CIRCUIT_IS_CONFLUX()
In the circuit_about_to_free(), we clear the circ->conflux object and then we
end up trying to emit an event on the control port which calls
CIRCUIT_IS_CONFLUX() and non fatal assert on the false branch.
Fixes #41037
Signed-off-by: David Goulet <dgoulet@torproject.org>
resolve scary vanguard-related log msgs on dir auths
After we added layer-two vanguards, directory authorities wouldn't
think any of their vanguards were suitable for circuits, leading
to a "Failed to find node for hop #2 of our path. Discarding
this circuit." log message once per second from startup until
they made a fresh consensus. Now they look to their existing
consensus on startup, letting them build circuits properly from
the beginning.