Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: quic-go v0.39.1 #18

Merged
merged 47 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d7334c1
move the DisableVersionNegotiationPackets flag to the Transport (#4047)
marten-seemann Aug 31, 2023
090e505
move GSO control message handling to the oobConn (#4056)
marten-seemann Aug 31, 2023
6cde437
integration tests: fix connection timeout in 0-RTT test (#4060)
tanghaowillow Sep 2, 2023
96b1943
ackhandler: rename variables to follow RFC 9002 terminology (#4062)
marten-seemann Sep 4, 2023
591d864
ci: update GitHub checkout and setup-go actions to v4 (#4067)
marten-seemann Sep 5, 2023
6cac231
update qtls-go1-20 to v0.3.4 (#4068)
marten-seemann Sep 6, 2023
dc0369c
remove TLS post-handshake message reassembly logic (#4073)
marten-seemann Sep 7, 2023
54b76ce
ackhandler: use the receive time of the Retry packet for RTT estimati…
marten-seemann Sep 9, 2023
e1fcac3
set the handshake timeout to twice the handshake idle timeout (#4063)
marten-seemann Sep 9, 2023
abfe1ef
remove Config.MaxRetryTokenAge, set it to the handshake timeout (#4064)
marten-seemann Sep 10, 2023
a7f8078
randomize the serialization order of control frames (#4069)
marten-seemann Sep 11, 2023
f919473
add support for writing the ECN control message (Linux, macOS)
marten-seemann Jul 30, 2023
5dd6d91
send and track packets with ECN markings
marten-seemann Aug 12, 2023
b73a4de
only add an ECN control message if ECN is supported
marten-seemann Aug 31, 2023
8df7624
add a QUIC_GO_DISABLE_ECN env to disable ECN support
marten-seemann Sep 1, 2023
bed8ebb
distinguish coalesced and 1-RTT packets when determining ECN mode
marten-seemann Sep 1, 2023
ad63e2a
trace and qlog the ECN marking on sent and received packets
marten-seemann Sep 1, 2023
ffe6546
add tracing and qlogging of state transitions for ECN validation
marten-seemann Sep 1, 2023
f9cfa24
implement ECN path validation logic, send ECN-marked 1-RTT packets
marten-seemann Sep 1, 2023
b6ce91b
stop appending to a GSO batch when the ECN marking changes
marten-seemann Sep 1, 2023
797e275
congestion: rename OnPacketLost to OnCongestionEvent
marten-seemann Sep 1, 2023
d6ac630
feed ECN feedback into the congestion controller
marten-seemann Sep 2, 2023
1f25153
Merge pull request #4059 from quic-go/ecn
marten-seemann Sep 11, 2023
d1f6ea9
save the RTT in non-0-RTT session tickets (#4042)
tanghaowillow Sep 11, 2023
2a8dc12
remove duplicate mocks for the Tracer and the ConnectionTracer (#4076)
marten-seemann Sep 12, 2023
d52e9f3
ackhandler: detect ECN mangling (#4080)
marten-seemann Sep 12, 2023
7599f81
ci: clean up Codecov ignore list (#4081)
marten-seemann Sep 12, 2023
37a3c41
expose GSO usage through ConnectionState (#4083)
birneee Sep 14, 2023
862e64c
add a Transport config option for the key used to encrypt tokens (#4066)
marten-seemann Sep 15, 2023
c1ce4a8
http09: increase the startup timeout in tests (#4071)
marten-seemann Sep 15, 2023
5b25d8b
ci: fail if any Go files contain an ignore directive (#4055)
marten-seemann Sep 15, 2023
22eac50
ci: combine the go generate workflow with the linting workflow (#4053)
marten-seemann Sep 15, 2023
ab1c1be
basic ClusterFuzzLite integration (#4034)
marten-seemann Sep 15, 2023
d8cc4cb
http3: introduce an HTTP/3 error type (#4039)
marten-seemann Sep 16, 2023
9b82196
make the logging.Tracer and logging.ConnectionTracer a struct (#4082)
marten-seemann Sep 16, 2023
1affe38
move MaxTokenAge configuration option to the Transport (#4084)
marten-seemann Sep 16, 2023
55eebd4
return the cancellation cause for cancelled dials (#4078)
marten-seemann Sep 16, 2023
22fb59e
create FUNDING.yml
marten-seemann Sep 17, 2023
9010cfd
remove unused unknownPacketHandler interface (#4093)
marten-seemann Sep 17, 2023
c12f425
ackhandler: don't fail ECN validation if less than 10 testing packets…
marten-seemann Sep 17, 2023
4a04618
ackhandler: fix ECN mangling detection when packets are lost (#4089)
marten-seemann Sep 18, 2023
4bdff39
README: add Hysteria (#4085)
tobyxdd Sep 24, 2023
9a397ab
update gomock to v0.3.0 (#4087)
marten-seemann Sep 24, 2023
2b29074
fix IPv4 ECN control message length on FreeBSD (#4110)
marten-seemann Oct 17, 2023
7c77243
upstream: sync to 0.39.1
gaukas Oct 27, 2023
77691cc
fix: error after sync
gaukas Oct 27, 2023
92311cd
fix: go 1.20 failing test
gaukas Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .clusterfuzzlite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM gcr.io/oss-fuzz-base/base-builder-go:v1

ARG TARGETPLATFORM
RUN echo "TARGETPLATFORM: ${TARGETPLATFORM}"

ENV GOVERSION=1.20.7

RUN platform=$(echo ${TARGETPLATFORM} | tr '/' '-') && \
filename="go${GOVERSION}.${platform}.tar.gz" && \
wget https://dl.google.com/go/${filename} && \
mkdir temp-go && \
rm -rf /root/.go/* && \
tar -C temp-go/ -xzf ${filename} && \
mv temp-go/go/* /root/.go/ && \
rm -r ${filename} temp-go

RUN apt-get update && apt-get install -y make autoconf automake libtool

COPY . $SRC/quic-go
WORKDIR quic-go
COPY .clusterfuzzlite/build.sh $SRC/
9 changes: 9 additions & 0 deletions .clusterfuzzlite/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -eu

export CXX="${CXX} -lresolv" # required by Go 1.20

compile_go_fuzzer github.com/refraction-networking/uquic/fuzzing/frames Fuzz frame_fuzzer
compile_go_fuzzer github.com/refraction-networking/uquic/fuzzing/header Fuzz header_fuzzer
compile_go_fuzzer github.com/refraction-networking/uquic/fuzzing/transportparameters Fuzz transportparameter_fuzzer
compile_go_fuzzer github.com/refraction-networking/uquic/fuzzing/tokens Fuzz token_fuzzer
compile_go_fuzzer github.com/refraction-networking/uquic/fuzzing/handshake Fuzz handshake_fuzzer
1 change: 1 addition & 0 deletions .clusterfuzzlite/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
language: go
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: [marten-seemann] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Ginkgo Test Status](https://github.com/refraction-networking/uquic/actions/workflows/ginkgo_test.yml/badge.svg?branch=master)](https://github.com/refraction-networking/uquic/actions/workflows/ginkgo_test.yml)
[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/refraction-networking/uquic)
---
uQUIC is a fork of [quic-go](https://github.com/quic-go/quic-go), which provides Initial Packet fingerprinting resistance and other features. While the handshake is still performed by quic-go, this library provides interface to customize the unencrypted Initial Packet which may reveal fingerprint-able information.
uQUIC is a fork of [quic-go](https://github.com/refraction-networking/uquic), which provides Initial Packet fingerprinting resistance and other features. While the handshake is still performed by quic-go, this library provides interface to customize the unencrypted Initial Packet which may reveal fingerprint-able information.

Golang 1.20+ is required.

Expand Down Expand Up @@ -32,7 +32,7 @@ If you are interested in our research, please stay tuned for our paper.
- [ ] QUIC ACK Frame (on hold)
- [x] TLS ClientHello Message (by [uTLS](https://github.com/refraction-networking/utls))
- [x] QUIC Transport Parameters (in a uTLS extension)
- [ ] Customize Initial ACK behavior ([#1](https://github.com/refraction-networking/uquic/issues/1), [quic-go#4007](https://github.com/quic-go/quic-go/issues/4007))
- [ ] Customize Initial ACK behavior ([#1](https://github.com/refraction-networking/uquic/issues/1), [quic-go#4007](https://github.com/refraction-networking/uquic/issues/4007))
- [ ] Customize Initial Retry behavior ([#2](https://github.com/refraction-networking/uquic/issues/2))
- [ ] Add preset QUIC parrots
- [x] Google Chrome parrot (call for parrots w/ `Token/PSK`)
Expand Down
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type client struct {

conn quicConn

tracer logging.ConnectionTracer
tracer *logging.ConnectionTracer
tracingID uint64
logger utils.Logger
}
Expand Down Expand Up @@ -155,7 +155,7 @@ func dial(
if c.config.Tracer != nil {
c.tracer = c.config.Tracer(context.WithValue(ctx, ConnectionTracingKey, c.tracingID), protocol.PerspectiveClient, c.destConnID)
}
if c.tracer != nil {
if c.tracer != nil && c.tracer.StartedConnection != nil {
c.tracer.StartedConnection(c.sendConn.LocalAddr(), c.sendConn.RemoteAddr(), c.srcConnID, c.destConnID)
}

Expand Down Expand Up @@ -238,7 +238,7 @@ func (c *client) dial(ctx context.Context) error {
select {
case <-ctx.Done():
c.conn.shutdown()
return ctx.Err()
return context.Cause(ctx)
case err := <-errorChan:
return err
case recreateErr := <-recreateChan:
Expand Down
21 changes: 11 additions & 10 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var _ = Describe("Client", func() {
initialPacketNumber protocol.PacketNumber,
enable0RTT bool,
hasNegotiatedVersion bool,
tracer logging.ConnectionTracer,
tracer *logging.ConnectionTracer,
tracingID uint64,
logger utils.Logger,
v protocol.VersionNumber,
Expand All @@ -55,10 +55,11 @@ var _ = Describe("Client", func() {
tlsConf = &tls.Config{NextProtos: []string{"proto1"}}
connID = protocol.ParseConnectionID([]byte{0, 0, 0, 0, 0, 0, 0x13, 0x37})
originalClientConnConstructor = newClientConnection
tracer = mocklogging.NewMockConnectionTracer(mockCtrl)
var tr *logging.ConnectionTracer
tr, tracer = mocklogging.NewMockConnectionTracer(mockCtrl)
config = &Config{
Tracer: func(ctx context.Context, perspective logging.Perspective, id ConnectionID) logging.ConnectionTracer {
return tracer
Tracer: func(ctx context.Context, perspective logging.Perspective, id ConnectionID) *logging.ConnectionTracer {
return tr
},
Versions: []protocol.VersionNumber{protocol.Version1},
}
Expand All @@ -71,7 +72,7 @@ var _ = Describe("Client", func() {
destConnID: connID,
version: protocol.Version1,
sendConn: packetConn,
tracer: tracer,
tracer: tr,
logger: utils.DefaultLogger,
}
getMultiplexer() // make the sync.Once execute
Expand Down Expand Up @@ -122,7 +123,7 @@ var _ = Describe("Client", func() {
_ protocol.PacketNumber,
enable0RTT bool,
_ bool,
_ logging.ConnectionTracer,
_ *logging.ConnectionTracer,
_ uint64,
_ utils.Logger,
_ protocol.VersionNumber,
Expand Down Expand Up @@ -159,7 +160,7 @@ var _ = Describe("Client", func() {
_ protocol.PacketNumber,
enable0RTT bool,
_ bool,
_ logging.ConnectionTracer,
_ *logging.ConnectionTracer,
_ uint64,
_ utils.Logger,
_ protocol.VersionNumber,
Expand Down Expand Up @@ -196,7 +197,7 @@ var _ = Describe("Client", func() {
_ protocol.PacketNumber,
_ bool,
_ bool,
_ logging.ConnectionTracer,
_ *logging.ConnectionTracer,
_ uint64,
_ utils.Logger,
_ protocol.VersionNumber,
Expand Down Expand Up @@ -281,7 +282,7 @@ var _ = Describe("Client", func() {
_ protocol.PacketNumber,
_ bool,
_ bool,
_ logging.ConnectionTracer,
_ *logging.ConnectionTracer,
_ uint64,
_ utils.Logger,
versionP protocol.VersionNumber,
Expand Down Expand Up @@ -324,7 +325,7 @@ var _ = Describe("Client", func() {
pn protocol.PacketNumber,
_ bool,
hasNegotiatedVersion bool,
_ logging.ConnectionTracer,
_ *logging.ConnectionTracer,
_ uint64,
_ utils.Logger,
versionP protocol.VersionNumber,
Expand Down
9 changes: 0 additions & 9 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
coverage:
round: nearest
ignore:
- streams_map_incoming_bidi.go
- streams_map_incoming_uni.go
- streams_map_outgoing_bidi.go
- streams_map_outgoing_uni.go
- http3/gzip_reader.go
- interop/
- internal/ackhandler/packet_linkedlist.go
- internal/handshake/cipher_suite.go
- internal/utils/byteinterval_linkedlist.go
- internal/utils/newconnectionid_linkedlist.go
- internal/utils/packetinterval_linkedlist.go
- internal/utils/linkedlist/linkedlist.go
- logging/null_tracer.go
- fuzzing/
- metrics/
status:
Expand Down
52 changes: 23 additions & 29 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"time"

"github.com/refraction-networking/uquic/internal/protocol"
"github.com/refraction-networking/uquic/internal/utils"
"github.com/refraction-networking/uquic/quicvarint"
)

Expand All @@ -17,7 +16,11 @@ func (c *Config) Clone() *Config {
}

func (c *Config) handshakeTimeout() time.Duration {
return utils.Max(protocol.DefaultHandshakeTimeout, 2*c.HandshakeIdleTimeout)
return 2 * c.HandshakeIdleTimeout
}

func (c *Config) maxRetryTokenAge() time.Duration {
return c.handshakeTimeout()
}

func validateConfig(config *Config) error {
Expand Down Expand Up @@ -50,12 +53,6 @@ func validateConfig(config *Config) error {
// it may be called with nil
func populateServerConfig(config *Config) *Config {
config = populateConfig(config)
if config.MaxTokenAge == 0 {
config.MaxTokenAge = protocol.TokenValidity
}
if config.MaxRetryTokenAge == 0 {
config.MaxRetryTokenAge = protocol.RetryTokenValidity
}
if config.RequireAddressValidation == nil {
config.RequireAddressValidation = func(net.Addr) bool { return false }
}
Expand Down Expand Up @@ -110,27 +107,24 @@ func populateConfig(config *Config) *Config {
}

return &Config{
GetConfigForClient: config.GetConfigForClient,
Versions: versions,
HandshakeIdleTimeout: handshakeIdleTimeout,
MaxIdleTimeout: idleTimeout,
MaxTokenAge: config.MaxTokenAge,
MaxRetryTokenAge: config.MaxRetryTokenAge,
RequireAddressValidation: config.RequireAddressValidation,
KeepAlivePeriod: config.KeepAlivePeriod,
InitialStreamReceiveWindow: initialStreamReceiveWindow,
MaxStreamReceiveWindow: maxStreamReceiveWindow,
InitialConnectionReceiveWindow: initialConnectionReceiveWindow,
MaxConnectionReceiveWindow: maxConnectionReceiveWindow,
AllowConnectionWindowIncrease: config.AllowConnectionWindowIncrease,
MaxIncomingStreams: maxIncomingStreams,
MaxIncomingUniStreams: maxIncomingUniStreams,
TokenStore: config.TokenStore,
EnableDatagrams: config.EnableDatagrams,
DisablePathMTUDiscovery: config.DisablePathMTUDiscovery,
DisableVersionNegotiationPackets: config.DisableVersionNegotiationPackets,
Allow0RTT: config.Allow0RTT,
Tracer: config.Tracer,
GetConfigForClient: config.GetConfigForClient,
Versions: versions,
HandshakeIdleTimeout: handshakeIdleTimeout,
MaxIdleTimeout: idleTimeout,
RequireAddressValidation: config.RequireAddressValidation,
KeepAlivePeriod: config.KeepAlivePeriod,
InitialStreamReceiveWindow: initialStreamReceiveWindow,
MaxStreamReceiveWindow: maxStreamReceiveWindow,
InitialConnectionReceiveWindow: initialConnectionReceiveWindow,
MaxConnectionReceiveWindow: maxConnectionReceiveWindow,
AllowConnectionWindowIncrease: config.AllowConnectionWindowIncrease,
MaxIncomingStreams: maxIncomingStreams,
MaxIncomingUniStreams: maxIncomingUniStreams,
TokenStore: config.TokenStore,
EnableDatagrams: config.EnableDatagrams,
DisablePathMTUDiscovery: config.DisablePathMTUDiscovery,
Allow0RTT: config.Allow0RTT,
Tracer: config.Tracer,
}
}

Expand Down
14 changes: 2 additions & 12 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ var _ = Describe("Config", func() {
f.Set(reflect.ValueOf(time.Second))
case "MaxIdleTimeout":
f.Set(reflect.ValueOf(time.Hour))
case "MaxTokenAge":
f.Set(reflect.ValueOf(2 * time.Hour))
case "MaxRetryTokenAge":
f.Set(reflect.ValueOf(2 * time.Minute))
case "TokenStore":
f.Set(reflect.ValueOf(NewLRUTokenStore(2, 3)))
case "InitialStreamReceiveWindow":
Expand Down Expand Up @@ -115,12 +111,7 @@ var _ = Describe("Config", func() {
return c
}

It("uses 10s handshake timeout for short handshake idle timeouts", func() {
c := &Config{HandshakeIdleTimeout: time.Second}
Expect(c.handshakeTimeout()).To(Equal(protocol.DefaultHandshakeTimeout))
})

It("uses twice the handshake idle timeouts for the handshake timeout, for long handshake idle timeouts", func() {
It("uses twice the handshake idle timeouts for the handshake timeout", func() {
c := &Config{HandshakeIdleTimeout: time.Second * 11 / 2}
Expect(c.handshakeTimeout()).To(Equal(11 * time.Second))
})
Expand All @@ -132,7 +123,7 @@ var _ = Describe("Config", func() {
GetConfigForClient: func(info *ClientHelloInfo) (*Config, error) { return nil, errors.New("nope") },
AllowConnectionWindowIncrease: func(Connection, uint64) bool { calledAllowConnectionWindowIncrease = true; return true },
RequireAddressValidation: func(net.Addr) bool { calledAddrValidation = true; return true },
Tracer: func(context.Context, logging.Perspective, ConnectionID) logging.ConnectionTracer {
Tracer: func(context.Context, logging.Perspective, ConnectionID) *logging.ConnectionTracer {
calledTracer = true
return nil
},
Expand Down Expand Up @@ -192,7 +183,6 @@ var _ = Describe("Config", func() {
Expect(c.MaxConnectionReceiveWindow).To(BeEquivalentTo(protocol.DefaultMaxReceiveConnectionFlowControlWindow))
Expect(c.MaxIncomingStreams).To(BeEquivalentTo(protocol.DefaultMaxIncomingStreams))
Expect(c.MaxIncomingUniStreams).To(BeEquivalentTo(protocol.DefaultMaxIncomingUniStreams))
Expect(c.DisableVersionNegotiationPackets).To(BeFalse())
Expect(c.DisablePathMTUDiscovery).To(BeFalse())
Expect(c.GetConfigForClient).To(BeNil())
})
Expand Down
Loading