]> git.ipfire.org Git - thirdparty/squid.git/commit
Fixed parsing of TLS messages that span multiple records (#457)
authorChristos Tsantilas <christos@chtsanti.net>
Tue, 13 Aug 2019 14:44:22 +0000 (14:44 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 8 Sep 2019 13:18:04 +0000 (01:18 +1200)
commite5f2158e25b4a1c90cd222254e9cbadb076801e4
treec7a6909d283188fd04ec5f5a19bc4459f325f428
parente10887e67fe84f52fa28d8c9b9e3d91e118fee3c
Fixed parsing of TLS messages that span multiple records (#457)

Squid fed the TLS message parser with one TLS record fragment
at a time but allowed InsufficientInput exceptions to bubble up
beyond the TLS message parsing code. If a server handshake
message spans multiple TLS records, and Squid reads all those
records together with the end of the TLS server handshake, then
the higher-level code interprets InsufficientInput as the need
for more TLS records for the record parser (rather than more
fragments for the TLS message parser). The affected transaction
would then time out or otherwise fail while waiting for those
non-existent TLS records to come from the server.

We now parse TLS messages only after accumulating all same-type
TLS records. For truncated handshakes, this may reduce the
level of information extracted by Squid in some cases, but
this approach keeps the code simple. The handshake is still
available for logging if that partial info is needed for triage.

Test case: 1000-sans.badssl.com which sends a huge server certificate.

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