Nick Mathewson [Sun, 20 Apr 2025 22:17:22 +0000 (18:17 -0400)]
Support for counter mode with raw AES.
We'll want this for CGO because we want the ability to use the same AES
key several times with multiple different IVs: neither OpenSSL's EVP
interface nor NSS's PK11 API has a good interface to do that.
(This is usually expressed in terms of "seeking" to a new position
on the stream, but there isn't an API for that either.)
Nick Mathewson [Tue, 6 May 2025 13:01:37 +0000 (09:01 -0400)]
Remove attempt to override TLS 1.3 server ciphersuites
This was unnecessary _and_ broken!
It was unnecessary because the default list of TLS 1.3 ciphersuites
has always been pretty reasonable.
It was broken because:
- SSL_CTX_set_cipher_list only affects the list of TLS 1.2 ciphersuites.
- There have _never_ been a set of macros named TLS1_3_TXT_*
in any openssl version, as far as I can tell.
Nick Mathewson [Tue, 6 May 2025 12:36:19 +0000 (08:36 -0400)]
OpenSSL: Require TLS ≥ 1.2
TLS 1.2 was added in OpenSSL version 1.0.1,
which was our minimal supported openssl version for a long time:
so we can be sure that all clients and relays have it.
(I'd like to require TLS 1.3, but that would break everybody
who built with 1.0.1.)
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.