]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/tls: QUIC: fix panics when processing post-handshake messages
authorDamien Neil <dneil@google.com>
Thu, 24 Aug 2023 16:57:58 +0000 (09:57 -0700)
committerDamien Neil <dneil@google.com>
Fri, 25 Aug 2023 17:57:53 +0000 (17:57 +0000)
commite92c0f846c54d88f479b1c48f0dbc001d2ff53e9
treec2db34147b0a9e3f1c90094cbe15c7270a6cde5e
parent777e65feb613ee1c8e2cdd165fd1fbe972f63451
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.

Fixes #62266

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>
src/crypto/tls/quic.go
src/crypto/tls/quic_test.go