]> git.ipfire.org Git - thirdparty/squid.git/commit
SslBump: Support parsing GREASEd (and future) TLS handshakes (#663)
authorChristos Tsantilas <christos@chtsanti.net>
Fri, 12 Jun 2020 23:32:16 +0000 (23:32 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sat, 20 Jun 2020 09:54:59 +0000 (21:54 +1200)
commit8f80586b2137cd6eaacef4e5908d03a0f7f9c7eb
tree0f6332a81a267377aee94e7e47dff8bcc3efe04f
parente247f8f03e920cf749ac2c749d636ecdf5aeb192
SslBump: Support parsing GREASEd (and future) TLS handshakes (#663)

A peeking or staring Squid aborted TLS connections containing a GREASE
version in the supported_versions handshake extension (e.g., 0x3a3a).
Here is a sample cache.log error (debug_options ALL,1 83,2):

```
parseTlsHandshake: ... check failed: vMajor == 3
    exception location: Handshake.cc(119) ParseProtocolVersion
```

The same problem would apply to some other "unsupported" (and currently
non-existent) TLS versions (e.g., 0x0400). The growing popularity of
GREASE values exposed the bug (just like RFC 8710 was designed to do).

Squid now ignores all unsupported-by-Squid TLS versions in handshake
extensions. Squid still requires a supported TLS version for
framing-related handshake fields -- no changes there.

It is difficult to define "supported" in this context precisely because
a peeking Squid only observes the TLS handshake. Our handshake parser
may report the following versions: SSL v2.0, SSL v3.0, and TLS v1.x
(with x >= 0). This logic allows us to safely parse the handshake (no
framing errors) and continue to make version-based decisions like
disabling OpenSSL TLS v1.3 support when the agents are negotiating TLS
v1.3+ (master cd29a42). Also, access logs benefit from this "support"
going beyond TLS v1.2 even though Squid cannot bump most TLS v1.3+
handshakes.

Squid was and still is compliant with the "MUST NOT treat GREASE values
differently from any unknown value" requirement of RFC 8710.

Also added source code comments to mark other places where unsupported
(for some definition of "support") TLS values, including GREASE values
may appear.

Folks studying debugging logs (where GREASE values may appear) will
probably either recognize their easy-to-remember 0x?A?A pattern or
not really know/care about RFC 8710 and its special values.

This is a Measurement Factory project.
src/security/Handshake.cc