]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.21] crypto/tls: QUIC: fix panics when processing post-handshake...
authorDamien Neil <dneil@google.com>
Thu, 24 Aug 2023 16:57:58 +0000 (09:57 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 30 Aug 2023 21:27:45 +0000 (21:27 +0000)
commit91a4e74b98179f63a27dbff1ad68ddd0ed64363a
treebb884a7695084bb4e660bae8aa8775afa368d238
parent6385a6fb18cc2c2080d6d8c008c49e1cf20e04a0
[release-branch.go1.21] crypto/tls: QUIC: fix panics when processing post-handshake messages

The check for fragmentary post-handshake messages in QUICConn.HandleData
was reversed, resulting in a potential panic when HandleData receives
a partial message.

In addition, HandleData wasn't checking the size of buffered
post-handshake messages. Produce an error when a post-handshake
message is larger than maxHandshake.

TestQUICConnectionState was using an onHandleCryptoData hook
in runTestQUICConnection that was never being called.
(I think it was inadvertently removed at some point while
the CL was in review.) Fix this test while making the hook
more general.

For #62266
Fixes #62290

Change-Id: I210b70634e50beb456ab3977eb11272b8724c241
Reviewed-on: https://go-review.googlesource.com/c/go/+/522595
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Marten Seemann <martenseemann@gmail.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
(cherry picked from commit e92c0f846c54d88f479b1c48f0dbc001d2ff53e9)
Reviewed-on: https://go-review.googlesource.com/c/go/+/523039
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/crypto/tls/quic.go
src/crypto/tls/quic_test.go