* also send session ticket when 0-RTT is disabled for go1.21
* allow session ticket without transport parameters
* do not include transport parameters for non-0RTT session ticket
* remove the test assertion because it is not supported for go1.20
* Update internal/handshake/session_ticket.go
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* add a 0-RTT argument to unmarshaling session tickets
* bump sessionTicketRevision to 4
* check if non-0-RTT session ticket has expected length
* change parameter order
* add test checks
---------
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* add Go 1.21 compatibility
Signed-off-by: Eric Lagergren <elagergren@spideroak-inc.com>
* refactor for Go 1.20
Signed-off-by: Eric Lagergren <elagergren@spideroak-inc.com>
---------
Signed-off-by: Eric Lagergren <elagergren@spideroak-inc.com>
tls.CipherSuiteName calls tls.CipherSuites, which in turn allocates a
large slice of values. We only need the name when we're logging, and
doing so, reduces the amount of allocations (and therefore garbage
created) during a QUIC handshake by roughly 5%.
The speedup comes from multiple sources:
1. We now preallocate a byte slice, instead of appending multiple times.
2. Marshaling into a byte slice is faster than using a bytes.Buffer.
3. quicvarint.Write allocates, while quicvarint.Append doesn't.
When receiving a handshake message after another handshake messages that
doesn't cause any action from the TLS stack (i.e. Certificate and
CertificateVerify), the handshake would run into a deadlock if the first
of these handshake messages caused an error in the TLS stack.
We need to make sure that we wait until a message has been fully
processed before proceeding with the handshake.
The RTTStats are used by the logging package. In order to instrument the
congestion package, the RTTStats can't be part of that package any more
(to avoid an import loop).
Application data is now retrieved and restored via two callbacks on the
qtls.Config. This allows us the get rid of the rather complex wrapping
of the qtls.ClientSessionCache. Furthermore, it makes sure that we only
restore the application data when qtls decides to actually use the
ticket.