Commit Graph

1709 Commits

Author SHA1 Message Date
Marten Seemann
18c591c75a utils: use time.Duration.Abs (#4217)
This function was added in Go 1.19, and covers some corner cases that
our custom implementation didn't.
2023-12-27 20:49:47 -08: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
Benedikt Spies
31a677cacd qlog: add support for alpn_information event (#4216)
* qlog chosen alpn

* qlog chosen alpn

* qlog: fix capitalization of ALPN

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-12-25 21:02:47 -08:00
Marten Seemann
6ffb9054a2 fuzzing: add frame validation logic (#4206) 2023-12-13 23:09:02 -08:00
Marten Seemann
d234d62d52 qtls: only attempt 0-RTT resumption for 0-RTT enabled session tickets (#4183) 2023-12-09 06:17:47 -08:00
chungthuang
7b9d21fbe6 send large max_datagram_frame size, introduce a DatagramTooLargeError error (#4143)
The size can be overwritten to a lower value for testing.
2023-12-02 06:27:15 -08:00
Marten Seemann
2d7ea37672 wire: reject NEW_CONNECTION_ID frames with zero-length conneciton IDs (#4180) 2023-11-23 02:41:12 -08:00
Marten Seemann
3bf2e19d0d logging: pass the packet number to ConnectionTracer.DroppedPacket (#4171)
In most cases the packet number is not known when a packet is dropped,
but it's useful to log the packet number when dropping a duplicate
packet.
2023-11-17 04:11:16 -08:00
Marten Seemann
9414ea4910 ackhandler: immediately acknowledge ECN-CE marked packets (#4147)
* ackhandler: immediately acknowledge ECN-CE marked packets

* shorter debug statements
2023-11-03 08:28:16 -07:00
Marten Seemann
f23da7da47 congestion: don't use floating point math when calculating pacing times (#4148) 2023-10-31 02:21:42 -07: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
Marten Seemann
1c631cf9cb rename Connection.{Send,Receive}Message to {Send,Receive}Datagram (#4116)
This is more consistent with both the RFC and the rest of the API. For
example, the option in the Config is already name EnableDatagrams, and
the property in the ConnectionState is named SupportsDatagrams.
2023-10-24 21:18:09 -07:00
Marten Seemann
a263164d9f use new gomock feature to generate type-safe methods in mocks (#4057) 2023-10-20 22:55:33 -07:00
Marten Seemann
9a397abc17 update gomock to v0.3.0 (#4087) 2023-09-24 04:38:28 -07:00
Marten Seemann
4a046185b7 ackhandler: fix ECN mangling detection when packets are lost (#4089)
Some of the 10 testing packets are might be lost, while others might be
CE-marked. We need to detect mangling if all testing packets are either
lost are CE-marked.
2023-09-17 22:08:33 -07:00
Marten Seemann
c12f425803 ackhandler: don't fail ECN validation if less than 10 testing packets are lost (#4088)
* ackhandler: don't fail ECN validation less than 10 testing packets lost

* ackhandler: simplify checks for mangling and loss of all testing packets
2023-09-17 23:00:05 +04:00
Marten Seemann
1affe38703 move MaxTokenAge configuration option to the Transport (#4084) 2023-09-16 05:10:20 -07:00
Marten Seemann
9b82196578 make the logging.Tracer and logging.ConnectionTracer a struct (#4082) 2023-09-16 04:58:51 -07:00
Marten Seemann
862e64c7b9 add a Transport config option for the key used to encrypt tokens (#4066)
* add a Transport config option for the key used to encrypt tokens

* handshake: remove unused error return values
2023-09-15 18:33:57 +07:00
Marten Seemann
d52e9f35bc ackhandler: detect ECN mangling (#4080)
* ackhandler: detect ECN mangling

Mangling means that a path is re-marking all ECN-marked packets as CE.

* ackhandler: only detect ECN mangling once all testing packets were sent
2023-09-11 23:18:33 -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
d6ac6300a4 feed ECN feedback into the congestion controller 2023-09-11 21:17:31 +07:00
Marten Seemann
797e275293 congestion: rename OnPacketLost to OnCongestionEvent 2023-09-11 21:14:53 +07:00
Marten Seemann
f9cfa248da implement ECN path validation logic, send ECN-marked 1-RTT packets 2023-09-11 21:14:52 +07:00
Marten Seemann
ffe6546833 add tracing and qlogging of state transitions for ECN validation 2023-09-11 20:31:50 +07:00
Marten Seemann
ad63e2a40a trace and qlog the ECN marking on sent and received packets 2023-09-11 20:31:50 +07:00
Marten Seemann
bed8ebbd4c distinguish coalesced and 1-RTT packets when determining ECN mode 2023-09-11 20:31:50 +07:00
Marten Seemann
b73a4de7ea only add an ECN control message if ECN is supported 2023-09-11 20:31:50 +07:00
Marten Seemann
5dd6d91c11 send and track packets with ECN markings 2023-09-11 20:31:50 +07:00
Marten Seemann
abfe1ef548 remove Config.MaxRetryTokenAge, set it to the handshake timeout (#4064)
There is no good reason to manually set the validity period for Retry
tokens. Retry tokens are only valid on a single connection during the
handshake, so it makes sense to limit their validity to the configured
handshake timeout.
2023-09-10 13:53:12 +07:00
Marten Seemann
e1fcac3e46 set the handshake timeout to twice the handshake idle timeout (#4063) 2023-09-09 06:12:37 -07:00
Marten Seemann
54b76ceb3e ackhandler: use the receive time of the Retry packet for RTT estimation (#4070) 2023-09-09 06:12:19 -07:00
Marten Seemann
96b1943cf5 ackhandler: rename variables to follow RFC 9002 terminology (#4062) 2023-09-03 21:45:41 -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
ced65c0ddc wire: always set the QUIC bit for Version Negotiation packets (#3991)
* wire: always set the QUIC bit for Version Negotiation packets

* Update internal/wire/version_negotiation_test.go
2023-08-20 19:55:57 -07:00
Marten Seemann
fe3c4f271d add a method to retrieve non-QUIC packets from the Transport (#3992) 2023-08-19 01:19:17 -07:00
Ameagari
6880f88089 save the max_datagram_frame_size transport parameter in the session ticket (#4013)
* Add MaxDatagramFrameSize parameter in session ticket

* fix gofumpt issues

* Update integrationtests/self/zero_rtt_test.go

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

* fix: correct comparsion of max_datagram_frame_size

* test: use constant MaxDatagramFrameSize for session ticket test

* fix grammar

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-08-18 19:16:16 -07:00
Marten Seemann
443c6148b6 protocol: add string representation for ECN values (#4008) 2023-08-18 17:17:37 -07:00
Marten Seemann
501cc21c4b expose crypto/tls errors on the TransportError (#4015) 2023-08-18 03:01:49 -07:00
Marten Seemann
bda01bc489 handshake: use the correct hash function for TLS_AES_256_GCM_SHA384 (#4031) 2023-08-15 20:09:01 -07:00
Marten Seemann
1d848392bc ignore QUICConn.SendSessionTicket error if session tickets are disabled (#4030) 2023-08-15 19:53:41 -07:00
elagergren-spideroak
571d3adef4 fix compatibility with API breaking change in Go 1.21 (#4020)
* 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>
2023-08-09 05:22:30 -07:00
Marten Seemann
95ab7bdc9a add tls.ClientHelloInfo.Conn for recursive GetConfigForClient calls (#4016) 2023-08-05 13:00:11 -07:00
Marten Seemann
18d3846d4f set a net.Conn for tls.ClientHelloInfo.Conn used by GetCertificate (#4014) 2023-08-03 20:33:19 -04:00
Ameagari
1c47ebefc0 check transport parameters after 0-RTT resumption (#3985)
* check new transport parameters do not contain redueced limits

* redefine ValidForUpdate and add tests

* fix test assertion and update comment
2023-08-01 18:34:42 -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
0662afba63 stop using math/rand.Seed and Read in tests, bump go.mod version to 1.20 (#3936) 2023-07-01 11:29:41 -07:00