80 Commits

Author SHA1 Message Date
gr1ffon
4ba42a8456 replace repo 2025-11-14 04:04:40 +03:00
Marten Seemann
42b198b8d1 use default RTT (100ms) for 0-RTT if no prior estimate (#5388)
* utils: initialize the {Smoothed, Latest, Min}RTT to 100ms

* utils: use time.Duration.Nanoseconds instead of uint64

No functional change expected.

* congestion: better check to avoid division by zero
2025-10-16 09:32:46 +02:00
Ameame
8ef0a71581 store the RTT in the token, not in the session ticket (#5065)
* remove RTT from session ticket

* save RTT in token

* use mus as rtt unit in token

* move RTT from session state to token on client side

* Rename the rtt variables

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update internal/handshake/token_generator.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update token_generator.go

* Update connection.go

* Update token_generator.go

* correct slice  access in fuzz.go

* rearrange connection constructor parameters

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2025-05-16 12:25:58 +02:00
Marten Seemann
d35b5ac187 use ed25519 instead of RSA in tests and examples (#5050)
Also adds a golangci-lint depguard rules that forbids
importing crypto/rsa.
2025-04-20 05:55:08 +02:00
Marten Seemann
5dbb46dcc1 utils: remove unused now parameter from RTTStats.UpdateRTT (#4780) 2024-12-22 14:50:31 +08:00
Marten Seemann
8754d28a6a handshake: migrate tests away from Ginkgo (#4667) 2024-10-11 21:44:30 -07:00
Marten Seemann
f5ceb73171 handshake: generate CRYPTO_ERRORs for internal_error TLS alerts (#4601)
* handshake: generate CRYPTO_ERRORs for internal_error TLS alerts

* remove stray comment
2024-08-03 17:04:03 -07:00
Marten Seemann
87f2894af5 handshake: remove gomock tls.ClientSessionCache implementation (#4619) 2024-08-03 16:43:30 -07:00
Marten Seemann
459a6f3df9 fix the server's 0-RTT rejection logic when using GetConfigForClient (#4550) 2024-06-03 03:42:58 -07:00
Marten Seemann
0d1e27d77c introduce Transport.ConnContext, use client's context on the connection (#4507)
* introduce Transport.ConnContext, use client's context on the connection

* panic if ConnContext returns nil
2024-05-26 21:30:19 -07:00
Marten Seemann
4f4da0423f ci: disable exhaustive linter for test files (#4499) 2024-05-06 21:36:22 -07:00
Marten Seemann
d795250479 drop support for Go 1.20, build on Go 1.22rc1 on CI (#4195)
* drop support for Go 1.20

* ci: udpate CircleCI to Go 1.21

* qtls: remove unnecessary type aliases

* ci: build using Go 1.22rc1
2023-12-27 20:31:58 -08:00
Marten Seemann
ef800d6f71 handshake: set MinVersion on the Config returned by GetConfigForClient (#4134) 2023-10-26 22:35:07 -07:00
Marten Seemann
d309060cde handshake: clone the tls.Config returned by GetConfigForClient (#4133)
We modify this tls.Config, so we should clone it first. Otherwise, this could
cause conflicts with how the application is using that config.
2023-10-26 22:22:20 -07:00
Marten Seemann
746290b78a never allow 0-RTT when using Dial, even if the session ticket allows it (#4125)
When resuming a TLS session using Dial (and not DialEarly), 0-RTT should
be disabled at the TLS layer, even if the session ticket allows for
0-RTT resumption.

This bug is not critical, since Dial doesn't return an EarlyConnection,
so the client wouldn't be able to actually send 0-RTT data in practice.
2023-10-25 08:20:23 -07:00
Ameagari
d1f6ea997c save the RTT in non-0-RTT session tickets (#4042)
* 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>
2023-09-11 08:05:31 -07:00
Marten Seemann
2797f85fc0 switch from unmaintained golang/mock to go.uber.org/mock (#4050) 2023-08-28 02:23:55 -07:00
Marten Seemann
95ab7bdc9a add tls.ClientHelloInfo.Conn for recursive GetConfigForClient calls (#4016) 2023-08-05 13:00:11 -07:00
Marten Seemann
f3a0ce1599 set a net.Conn with the correct addresses on the tls.ClientHelloInfo (#4001) 2023-07-31 13:32:10 -07:00
Marten Seemann
469a6153b6 use a synchronous API for the crypto setup (#3939) 2023-07-21 10:00:42 -07:00
Marten Seemann
3d89e545d3 use the new crypto/tls QUIC Transport (#3860) 2023-07-01 11:15:00 -07:00
Marten Seemann
7a0ef5f867 make Config.Allow0RTT a bool, not a callback 2023-05-02 15:56:49 +02:00
Marten Seemann
1f57d4e789 protocol: remove VersionTLS, used during the gQUIC -> TLS 1.3 transition (#3764) 2023-04-19 07:24:34 -07:00
Marten Seemann
3d9380ec3c reject invalid active_connection_id_limit transport parameter values (#3687) 2023-02-01 17:03:19 -08:00
Marten Seemann
58cedf7a4f rename module, adjust import paths to quic-go/quic-go (#3680) 2023-01-21 19:53:57 -08:00
Marten Seemann
b52d34008f add Allow0RTT opt in the quic.Config to control 0-RTT on the server side (#3635) 2023-01-04 16:18:11 -08:00
Marten Seemann
870fbe7ab0 migrate to Ginkgo v2 2022-10-11 16:38:44 +04:00
Marten Seemann
c225299c84 handle TLS errors that occur before the ClientHello has been written 2022-05-20 12:27:00 +02:00
Marten Seemann
0c6b3dfa93 run the updated version of gofumpt 2022-04-02 20:18:37 +01:00
Marten Seemann
592fb9cad9 introduce a dedicated qerr.TransportError and qerr.ApplicationError 2021-05-01 09:38:48 +07:00
Marten Seemann
31ac5ca60d allow 0-RTT when the server's connection receive limit is increased 2021-03-17 18:53:54 +08:00
Marten Seemann
c968b18a21 select the H3 ALPN based on the QUIC version in use (for the H3 server) 2020-10-29 13:44:23 +07:00
Marten Seemann
77f7476bf7 include the error code in the string for CRYPTO_ERRORs 2020-09-25 20:23:05 +07:00
Marten Seemann
c9bfde9ac0 fix handling of multiple handshake messages in the case of errors
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.
2020-09-13 20:13:57 +07:00
Marten Seemann
977dbc828c move all dependencies on qtls to a separate package 2020-08-18 14:26:23 +07:00
Marten Seemann
741dc28d74 move the RTTStats to the utils package
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).
2020-07-23 11:53:08 +07:00
Marten Seemann
a1bb39d6ab introduce a protocol.StatelessResetToken 2020-07-10 19:55:20 +07:00
Marten Seemann
07d4fd0991 use the new qtls interface for (re)storing app data with a session state
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.
2020-07-01 14:00:08 +07:00
Marten Seemann
b391cce35c always send the original_destination_connection_id TP as a server 2020-05-29 19:50:14 +07:00
Marten Seemann
d277e013ab fix race condition in the crypto setup tests 2020-05-05 18:13:14 +07:00
Marten Seemann
0ef4f06189 move the transport parameters from the handshake to the wire package 2020-03-13 16:20:11 +07:00
Marten Seemann
2cee7dd88a Merge pull request #2408 from lucas-clemente/update-golang-ci
update GolangCI-Lint to v1.23.8
2020-03-10 16:53:41 +07:00
Marten Seemann
273a320f98 add support for the key_updated event for TLS key updates 2020-03-08 17:09:07 +07:00
Marten Seemann
0b3340493a update GolangCI-Lint to v1.23.8 2020-03-05 10:20:15 +07:00
Marten Seemann
6fe4878f0e update to qtls based on Go 1.14's TLS implementation 2020-02-28 16:48:29 +07:00
Marten Seemann
f034e8ba19 set the LocalAddr that is used in the tls.ClientHelloInfo.Conn 2020-02-16 14:10:30 +07:00
Marten Seemann
8cde4ab638 refactor how session tickets are sent
Previously, RunHandshake() would send the session tickets. Now, the
session initiates the sending of the session ticket. This simplifies the
setup a bit, and it will make it possible to include the RTT estimate in
the session ticket without accessing the RTTStats concurrently.
2020-02-10 17:42:09 +07:00
Marten Seemann
22abcfe6fb drop 0-RTT write keys when receiving the 1-RTT keys 2020-01-01 18:04:02 +04:00
Marten Seemann
44aa12850e restore the server's transport parameters from the session ticket 2020-01-01 18:04:02 +04:00
Marten Seemann
9b0a4a8813 move unmarshaling of the transport parameters to the crypto setup 2020-01-01 18:04:01 +04:00